From 2af7683e5ff962c5a244d005ea85317a0446f05a Mon Sep 17 00:00:00 2001 From: Michael Nosthoff Date: Fri, 7 Aug 2020 10:58:12 +0200 Subject: [PATCH] package/boost: fixup Optimization flag in boost build When building with Boost Build the CXXFLAGS are extended depending on the optimization level set. When not defined explicitly the optimization level depends on the . For release it's 'speed' and for debug it's set to 'off' These flags overwrite the -O flag passed in with TARGET_CXXFLAGS as it is appended when calling g++. This commit sets the Optimization flags generated by Boost Build to the value of TARGET_OPTIMIZATION no matter what level is used. As Boost Build offers no nice way to alter those values the gcc toolchain file is altered directly. Signed-off-by: Michael Nosthoff Signed-off-by: Yann E. MORIN (cherry picked from commit af148ef4f01aaa4f8b1ac47f5e46514394bc79aa) Signed-off-by: Peter Korsgaard --- package/boost/boost.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/package/boost/boost.mk b/package/boost/boost.mk index 2daf7f5a96..8e47a90c39 100644 --- a/package/boost/boost.mk +++ b/package/boost/boost.mk @@ -134,6 +134,7 @@ define BOOST_CONFIGURE_CMDS (cd $(@D) && ./bootstrap.sh $(BOOST_FLAGS)) echo "using gcc : `$(TARGET_CC) -dumpversion` : $(TARGET_CXX) : \"$(BOOST_TARGET_CXXFLAGS)\" \"$(TARGET_LDFLAGS)\" ;" > $(@D)/user-config.jam echo "" >> $(@D)/user-config.jam + sed -i "s/: -O.* ;/: $(TARGET_OPTIMIZATION) ;/" $(@D)/tools/build/src/tools/gcc.jam endef define BOOST_BUILD_CMDS