[openwrt/openwrt] rules.mk: set default host tools GCC optimization level to -O2
LEDE Commits
lede-commits at lists.infradead.org
Fri May 16 04:16:20 PDT 2025
robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/e3bec5692c50ff3b8001d4611c8eb57f54efb6b5
commit e3bec5692c50ff3b8001d4611c8eb57f54efb6b5
Author: Shiji Yang <yangshiji66 at outlook.com>
AuthorDate: Fri May 16 18:56:36 2025 +0800
rules.mk: set default host tools GCC optimization level to -O2
This patch can help save over 60% of package build time. -O2
optimization level is the default value before the commit
e8b470139c78 ("tools: add options to optimize host binaries").
Signed-off-by: Shiji Yang <yangshiji66 at outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18812
Signed-off-by: Robert Marko <robimarko at gmail.com>
---
rules.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rules.mk b/rules.mk
index ccf97fe7b7..3971852f45 100644
--- a/rules.mk
+++ b/rules.mk
@@ -278,7 +278,7 @@ PKG_CONFIG:=$(STAGING_DIR_HOST)/bin/pkg-config
export PKG_CONFIG
-HOST_FLAGS_OPT:=$(call qstrip,$(CONFIG_HOST_FLAGS_OPT))
+HOST_FLAGS_OPT:=$(if $(CONFIG_HOST_FLAGS_OPT),$(call qstrip,$(CONFIG_HOST_FLAGS_OPT)),"-O2")
HOST_FLAGS_STRIP:=$(call qstrip,$(CONFIG_HOST_FLAGS_STRIP))
HOST_EXTRA_CFLAGS:=$(call qstrip,$(CONFIG_HOST_EXTRA_CFLAGS))
HOST_EXTRA_CXXFLAGS:=$(call qstrip,$(CONFIG_HOST_EXTRA_CXXFLAGS))
More information about the lede-commits
mailing list