Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/boost: fixup Optimization flag in boost build
@ 2020-08-05 12:41 Michael Nosthoff
  2020-08-06 20:16 ` Yann E. MORIN
  2020-08-07  8:58 ` [Buildroot] [PATCH v2] " Michael Nosthoff
  0 siblings, 2 replies; 6+ messages in thread
From: Michael Nosthoff @ 2020-08-05 12:41 UTC (permalink / raw)
  To: buildroot

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 <variant>. 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.

Signed-off-by: Michael Nosthoff <buildroot@heine.tech>
---
 package/boost/boost.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/boost/boost.mk b/package/boost/boost.mk
index ef638fc9df..1fcb264062 100644
--- a/package/boost/boost.mk
+++ b/package/boost/boost.mk
@@ -134,6 +134,11 @@ define BOOST_CONFIGURE_CMDS
 	(cd $(@D) && ./bootstrap.sh $(BOOST_FLAGS))
 	echo "using gcc : `$(TARGET_CC) -dumpversion` : $(TARGET_CXX) : <cxxflags>\"$(BOOST_TARGET_CXXFLAGS)\" <linkflags>\"$(TARGET_LDFLAGS)\" ;" > $(@D)/user-config.jam
 	echo "" >> $(@D)/user-config.jam
+	echo "import modules ;" >> $(@D)/user-config.jam
+	echo "modules.poke gcc : flags gcc.compile OPTIONS <optimization>off : $(TARGET_OPTIMIZATION) ;" >> $(@D)/user-config.jam
+	echo "modules.poke gcc : flags gcc.compile OPTIONS <optimization>speed : $(TARGET_OPTIMIZATION) ;" >> $(@D)/user-config.jam
+	echo "modules.poke gcc : flags gcc.compile OPTIONS <optimization>space : $(TARGET_OPTIMIZATION) ;" >> $(@D)/user-config.jam
+	echo "" >> $(@D)/user-config.jam
 endef
 
 define BOOST_BUILD_CMDS
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-08-28 15:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-05 12:41 [Buildroot] [PATCH] package/boost: fixup Optimization flag in boost build Michael Nosthoff
2020-08-06 20:16 ` Yann E. MORIN
2020-08-07  8:32   ` Michael Nosthoff
2020-08-07  8:58 ` [Buildroot] [PATCH v2] " Michael Nosthoff
2020-08-07 19:19   ` Yann E. MORIN
2020-08-28 15:03   ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox