Skip to contentSkip to conversation

fix native package compile error with gcc 4.3.4 on x86 host

PATCH Superseded Hongxu Jia 1 participant 3 messages Jan 17, 2013

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Hongxu Jia

author
#0 lore raw

cover fix native package compile error with gcc 4.3.4 on x86 host

Add an option `-march' to BUILD_CFLAGS, GCC 4.3.4 on x86 host needs this option to let the atomic operations ("lock free") be available while it is used 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 9f263a60e3521b800121a6f527a7b30dc9b62432:

oprofile: add AArch64 support (2013-01-16 16:10:39 +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:fix do_configure failed with gcc 4.3.4 on x86 host qemu-native:fix do_compile failed with gcc 4.3.4 on x86 host

 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:fix do_configure failed with gcc 4.3.4 on x86 host

Add an option `-march' to BUILD_CFLAGS, GCC 4.3.4 on x86 host needs this option to let the atomic operations ("lock free") be available while it is used 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 e1d44e2..33ab881 100644
@@ -1,6 +1,6 @@
 require glib.inc
 
-PR = "r1"
+PR = "r2"
 PE = "1"
 
 DEPENDS += "libffi python-argparse-native zlib"
@@ -40,6 +40,11 @@ RDEPENDS_${PN}-ptest += "\
             python-dbus \
            "
 
+# Add an option `-march' to BUILD_CFLAGS, GCC 4.3.4 on x86 host needs this
+# option to let the atomic operations ("lock free") be available while it
+# is used 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
author
#2 lore raw

PATCH 2/2 qemu-native:fix do_compile failed with gcc 4.3.4 on x86 host

In reply to Hongxu Jia

Add an option `-march' to BUILD_CFLAGS, GCC 4.3.4 on x86 host needs this option to let the atomic operations ("lock free") be available while it is used to compile qemu-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..467035c 100644
@@ -38,6 +38,11 @@ EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disa
 				--disable-curl \
 				"
 
+# Add an option `-march' to BUILD_CFLAGS, GCC 4.3.4 on x86 host needs this
+# option to let the atomic operations ("lock free") be available while it
+# is used to compile qemu-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