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

login
register
mail settings
Submitter Hongxu Jia
Date Dec. 20, 2012, 8:10 a.m.
Message ID <8bfee81d0404d9325ccaccb260cadad8269d92ae.1355990839.git.hongxu.jia@windriver.com>
Download mbox | patch
Permalink /patch/41371/
State New
Headers show

Comments

Hongxu Jia - Dec. 20, 2012, 8:10 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(-)
Ross Burton - Dec. 20, 2012, 10:05 a.m.
On 20 December 2012 08:10, 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 on x86 host to
> +# compile glib-2.0-native
> +BUILD_CFLAGS += "-march=`echo ${BUILD_ARCH} | sed 's/_/-/'`"

Should we do this inside bitbake.conf instead of just in glib?

Ross
Hongxu Jia - Jan. 5, 2013, 2:40 a.m.
On 12/20/2012 06:05 PM, Burton, Ross wrote:
> On 20 December 2012 08:10, 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 on x86 host to
>> +# compile glib-2.0-native
>> +BUILD_CFLAGS += "-march=`echo ${BUILD_ARCH} | sed 's/_/-/'`"
> Should we do this inside bitbake.conf instead of just in glib?
>
> Ross

This is only needed by glib-2.0-native, and didn't notice
this error for other recipes, so I just added it for glib-2.0-native.

Hongxu

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 966a851..7c0a2cb 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"
@@ -19,6 +19,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=`echo ${BUILD_ARCH} | sed 's/_/-/'`"
+
 do_configure_prepend() {
 	sed -i -e '1s,#!.*,#!${USRBINPATH}/env python,' ${S}/gio/gdbus-2.0/codegen/gdbus-codegen.in
 }