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

login
register
mail settings
Submitter Hongxu Jia
Date Jan. 9, 2013, 8:46 a.m.
Message ID <1499acb24c57f9bf9b10c0b87e331df4f00ea5b4.1357719953.git.hongxu.jia@windriver.com>
Download mbox | patch
Permalink /patch/42361/
State New
Headers show

Comments

Hongxu Jia - Jan. 9, 2013, 8:46 a.m.
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]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-devtools/qemu/qemu.inc |    5 +++++
 1 file changed, 5 insertions(+)
Ross Burton - Jan. 9, 2013, 8:50 a.m.
On 9 January 2013 08:46, Hongxu Jia <hongxu.jia@windriver.com> wrote:
> 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
Hongxu Jia - Jan. 9, 2013, 8:58 a.m.
On 01/09/2013 04:50 PM, Burton, Ross wrote:
> On 9 January 2013 08:46, Hongxu Jia <hongxu.jia@windriver.com> wrote:
>> 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

Patch

diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index ca411a6..acc7cbc 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -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