Patchwork [2/2] qemu-native:fix do_compile failed with gcc 4.3.4 on x86 host

login
register
mail settings
Submitter Hongxu Jia
Date Feb. 28, 2013, 7:09 a.m.
Message ID <3da91af174eb9daba91a9684af4f2d4093d8d44b.1362033854.git.hongxu.jia@windriver.com>
Download mbox | patch
Permalink /patch/45259/
State New
Headers show

Comments

Hongxu Jia - Feb. 28, 2013, 7:09 a.m.
When compile qemu-native with GCC 4.3.4 on x86 host, the GCC needs
`-march' to let the atomic operations ("lock free") be available. Pass
`-march=native' to cause the compiler to auto-detect the architecture of the
build computer, If the auto-detect is unsuccessful the option has no effect.

[YOCTO #3563]

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
---
 meta/recipes-devtools/qemu/qemu.inc |    6 ++++++
 1 file changed, 6 insertions(+)

Patch

diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index 6c44b31..73734f4 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -38,6 +38,12 @@  EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disa
 				--disable-curl \
 				"
 
+# When compile qemu-native with GCC 4.3.4 on x86 host, the GCC needs
+# `-march' to let the atomic operations ("lock free") be available. Pass
+# `-march=native' to cause the compiler to auto-detect the architecture of the
+# build computer, If the auto-detect is unsuccessful the option has no effect.
+BUILD_CFLAGS += "-march=native"
+
 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