Patchwork [1/2] glib-2.0-native:add option march to BUILD_CFLAGS

login
register
mail settings
Submitter Hongxu Jia
Date Jan. 9, 2013, 8:46 a.m.
Message ID <aa9eb2aa5b239128138eab2552ccfb99f3ac5d3a.1357719953.git.hongxu.jia@windriver.com>
Download mbox | patch
Permalink /patch/42365/
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-core/glib-2.0/glib-2.0_2.34.3.bb |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Patch

diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb
index 9854585..bc3f4ca 100644
--- a/meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb
+++ b/meta/recipes-core/glib-2.0/glib-2.0_2.34.3.bb
@@ -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 \