Skip to contentSkip to conversation

native recipes:add option march to BUILD_CFLAGS

PATCH In review Hongxu Jia 2 participants 5 messages Jan 9, 2013

lore
Share & tools
lore

Hongxu Jia

author
#0 lore raw

cover native recipes: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 on x86 host to compile glib-2.0-native.

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. The glib-2.0-native and qemu-native need to be fixed.

[YOCTO #3563]

The following changes since commit 7e1f8faad0c4b6f490c26f87acc698dd6e002b15:

perl: Remove bashism from perl-tests.inc (2013-01-07 22:37:37 +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 (2):
glib-2.0-native:add option march to BUILD_CFLAGS qemu-native:add option march to BUILD_CFLAGS

 meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb |    7 ++++++-
 meta/recipes-devtools/qemu/qemu.inc           |    5 +++++
 2 files changed, 11 insertions(+), 1 deletion(-)
Signature · 1 line
1.7.10.4
author
#1 lore raw

PATCH 1/2 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.

[YOCTO #3563]

---
 meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb +6 -1
index 9854585..bc3f4ca 100644
@@ -1,6 +1,6 @@
 require glib.inc
 
-PR = "r0"
+PR = "r1"
 PE = "1"
 
 DEPENDS += "libffi python-argparse-native zlib"
@@ -21,6 +21,11 @@ SRC_URI[sha256sum] = "855fcbf87cb93065b488358e351774d8a39177281023bae58c286f4161
 SRC_URI_append_class-native = " file://glib-gettextize-dir.patch"
 BBCLASSEXTEND = "native nativesdk"
 
+# 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('_','-')}"
+
 RDEPENDS_${PN}-ptest += "\
             eglibc-gconv-utf-16 \
             eglibc-charmap-utf-8 \
Signature · 1 line
1.7.10.4
author
#2 lore raw

PATCH 2/2 qemu-native:add option march to BUILD_CFLAGS

In reply to Hongxu Jia

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.

[YOCTO #3563]

---
 meta/recipes-devtools/qemu/qemu.inc |    5 +++++
 1 file changed, 5 insertions(+)
meta/recipes-devtools/qemu/qemu.inc +5 -0
index ca411a6..acc7cbc 100644
@@ -38,6 +38,11 @@ EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disa
 				--disable-curl \
 				"
 
+# 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_class-native() {
 	# Undo the -lX11 added by linker-flags.patch, don't assume that host has libX11 installed
 	sed -i 's/-lX11//g' Makefile.target
Signature · 1 line
1.7.10.4
#3 lore raw

Re: [PATCH 2/2] qemu-native:add option march to BUILD_CFLAGS

Quoted 3 lines · Hongxu Jia

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.

Did you mean to say glib?

Ross

author
#4 lore raw

Re: [PATCH 2/2] qemu-native:add option march to BUILD_CFLAGS

Quoted 7 lines · Ross
Quoted 3 lines · Hongxu Jia

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.

Did you mean to say glib?

Ross

I mean using old version GCC(4.3.4 for example) on x86 host to compile glib-2.0-native.

See bugzilla for detail:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=3563

Hongxu