summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShiji Yang2025-05-16 11:30:30 +0000
committerRobert Marko2025-05-16 18:42:43 +0000
commit17eeb6c3faf5a1130738498c60766227b655d6bb (patch)
treec6508d05a60f734fe60cc5cc2b156ab6d0ff0c7b
parentf060615a78e5c5e86829b2e40c3f77e5cf7033bf (diff)
downloadopenwrt-17eeb6c3faf5a1130738498c60766227b655d6bb.tar.gz
rules.mk: respect the empty CONFIG_HOST_FLAGS_OPT
Currently, the empty CONFIG_HOST_FLAGS_OPT will be overridden by "-O2". Fix this issue by checking if its parent menuconfig symbol CONFIG_OPTIMIZE_HOST_TOOLS was defined. Fixes: e3bec5692c50 ("rules.mk: set default host tools GCC optimization level to -O2") Reported-by: Christian Marangi <ansuelsmth@gmail.com> Signed-off-by: Shiji Yang <yangshiji66@outlook.com> Link: https://github.com/openwrt/openwrt/pull/18815 Signed-off-by: Robert Marko <robimarko@gmail.com>
-rw-r--r--rules.mk2
1 files changed, 1 insertions, 1 deletions
diff --git a/rules.mk b/rules.mk
index 3971852f45..929d8e00e8 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:=$(if $(CONFIG_HOST_FLAGS_OPT),$(call qstrip,$(CONFIG_HOST_FLAGS_OPT)),"-O2")
+HOST_FLAGS_OPT:=$(if $(CONFIG_OPTIMIZE_HOST_TOOLS),$(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))