From: Shiji Yang Date: Fri, 16 May 2025 10:56:36 +0000 (+0800) Subject: rules.mk: set default host tools GCC optimization level to -O2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F18812%2Fhead;p=thirdparty%2Fopenwrt.git 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 Link: https://github.com/openwrt/openwrt/pull/18812 Signed-off-by: Robert Marko --- diff --git a/rules.mk b/rules.mk index ccf97fe7b7b..3971852f454 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))