Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] Yocto: qt4: Let qmake control some compiler/linker flags
@ 2014-08-07 15:25 Marek Vasut
  2014-08-11  0:49 ` Otavio Salvador
  2014-08-26  2:04 ` Khem Raj
  0 siblings, 2 replies; 6+ messages in thread
From: Marek Vasut @ 2014-08-07 15:25 UTC (permalink / raw)
  To: openembedded-core; +Cc: Marek Vasut

In the case of building an Qt application outside of the Yocto
build system, we want to make sure that a "debug" configuration
of the application does contain debug symbols and is has the
compiler optimalization unset. On the other hand, we want to
have a "release" build which does not contain the debug symbols
and has the compiler optimalization turned on.

The OE_QMAKE_* flags serve to pass all kinds of flags into the
qmake-generated Makefile. Currently, we set OE_QMAKE_CFLAGS to
be ${CFLAGS} and ditto for CXXFLAGS and LDFLAGS in the SDK
toolchain environment script. This poses a problem, since the
CFLAGS can contain optimization options (-O*) and even flags to
produce debugging info (-g). The LDFLAGS may also contain some
harmful flags.

The easy way out is to let qmake's army of configuration files
handle the proper configuration of CFLAGS, CXXFLAGS and LDFLAGS
for the generated Makefile and don't interfere with qmake's
decisions by adding arbitrary flags. This patch completely
scrubs OE_QMAKE_C{,XX}FLAGS and leaves only harmless flags in
OE_QMAKE_LDFLAGS. With this patch, the behavior is as it is
explained in the first paragraph.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Eric Bénard <eric@eukrea.com>
---
 meta/recipes-qt/meta/meta-toolchain-qt.inc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/meta/recipes-qt/meta/meta-toolchain-qt.inc b/meta/recipes-qt/meta/meta-toolchain-qt.inc
index c9bdeae..6b162bd 100644
--- a/meta/recipes-qt/meta/meta-toolchain-qt.inc
+++ b/meta/recipes-qt/meta/meta-toolchain-qt.inc
@@ -7,9 +7,9 @@ require recipes-core/meta/meta-toolchain.bb
 QT_TOOLS_PREFIX = "${SDKPATHNATIVE}${bindir_nativesdk}"
 
 toolchain_create_sdk_env_script_append() {
-    echo 'export OE_QMAKE_CFLAGS="$CFLAGS"' >> $script
-    echo 'export OE_QMAKE_CXXFLAGS="$CXXFLAGS"' >> $script
-    echo 'export OE_QMAKE_LDFLAGS="$LDFLAGS"' >> $script
+    echo 'export OE_QMAKE_CFLAGS=""' >> $script
+    echo 'export OE_QMAKE_CXXFLAGS=""' >> $script
+    echo 'export OE_QMAKE_LDFLAGS="${TARGET_LINK_HASH_STYLE}"' >> $script
     echo 'export OE_QMAKE_CC=$CC' >> $script
     echo 'export OE_QMAKE_CXX=$CXX' >> $script
     echo 'export OE_QMAKE_LINK=$CXX' >> $script
-- 
2.0.1



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

end of thread, other threads:[~2014-08-28 14:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-07 15:25 [PATCH] Yocto: qt4: Let qmake control some compiler/linker flags Marek Vasut
2014-08-11  0:49 ` Otavio Salvador
2014-08-15 20:53   ` Marek Vasut
2014-08-26  1:33     ` Otavio Salvador
2014-08-26  2:04 ` Khem Raj
2014-08-28 12:52   ` Marek Vasut

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