Skip to contentSkip to conversation

glib-2.0-native:add option march to BUILD_CFLAGS

PATCH In review Hongxu Jia 2 participants 4 messages Jan 6, 2013 – Jan 9, 2013

lore
Share & tools
lore

Hongxu Jia

author
#0 lore raw

cover glib-2.0-native:add option march to BUILD_CFLAGS

The following changes since commit 09359e6ec00901abfe49157f1f9730117b4d284b:

freetype: update to 2.4.11 which includes fixes for CVE-2012-{5668, 5669, 5670} (2012-12-31 09:43:27 +0000)

are available in the git repository at:

git://git.pokylinux.org/poky-contrib hongxu/glib-2.0-native
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=hongxu/glib-2.0-native

Hongxu Jia (1):
glib-2.0-native:add option march to BUILD_CFLAGS

 meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Signature · 1 line
1.7.10.4
author
#1 lore raw

PATCH 1/1 glib-2.0-native:add option march to BUILD_CFLAGS

Add option -march to BUILD_CFLAGS in order to let the atomic operations ("lock free") be available while using old version GCC (4.3.4 for example) on x86 host to compile glib-2.0-native.

---
 meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb +5 -1
index 9854585..07d16bd 100644
@@ -1,6 +1,6 @@
 require glib.inc
 
-PR = "r0"
+PR = "r1"
 PE = "1"
 
 DEPENDS += "libffi python-argparse-native zlib"
@@ -38,6 +38,10 @@ RDEPENDS_${PN}-ptest += "\
             python-pygobject \
             python-dbus \
            "
+# Add option -march to BUILD_CFLAGS in order to let the atomic operations
+# ("lock free") be available while using old version GCC on x86 host to
+# compile glib-2.0-native
+BUILD_CFLAGS += "-march=${@'${BUILD_ARCH}'.replace('_','-')}"
 
 do_configure_prepend() {
 	sed -i -e '1s,#!.*,#!${USRBINPATH}/env python,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in
Signature · 1 line
1.7.10.4
#2 lore raw

meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb RDEPENDS_${PN}-ptest += "\ · line 44

Quoted 4 lines · Hongxu Jia
meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb +4 -0
+# Add option -march to BUILD_CFLAGS in order to let the atomic operations
+# ("lock free") be available while using old version GCC on x86 host to
+# compile glib-2.0-native
+BUILD_CFLAGS += "-march=${@'${BUILD_ARCH}'.replace('_','-')}"

Shouldn't this be handled more generically for all native recipes?

author
#3 lore raw
Quoted 9 lines · Colin Walters

meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb RDEPENDS_${PN}-ptest += "\ · line 44

Quoted 4 lines · Hongxu Jia
meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb +4 -0
+# Add option -march to BUILD_CFLAGS in order to let the atomic operations
+# ("lock free") be available while using old version GCC on x86 host to
+# compile glib-2.0-native
+BUILD_CFLAGS += "-march=${@'${BUILD_ARCH}'.replace('_','-')}"

Shouldn't this be handled more generically for all native recipes?

Hi Colin,

I have a fully test and the qemu-native has the similar problem, and I will resend the patch.

It's a bad idea to modify bitbake.conf to add option -march to BUILD_CFLAGS, because it's global and its side effect is unknown, such as beecrypt-native do_compile will fail if we do that.

So it's best to test most of the native recipes to have a check about the similar problem and fix them separately, and the packagegroup-toolset-native.bb could work for that.

Regards,
Hongxu