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
e8b470139c ("tools: add options to optimize host binaries").

Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/18812
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Shiji Yang 2025-05-16 18:56:36 +08:00 committed by Robert Marko
parent f60bbfa23f
commit e3bec5692c
1 changed files with 1 additions and 1 deletions

View File

@ -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))