Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | From 55253b55b9c65f3e0efbbe03cbab2a4c4014a16b Mon Sep 17 00:00:00 2001 |
| 2 | From: Song.Li <Song.Li@windriver.com> |
| 3 | Date: Thu, 5 Jul 2012 15:09:41 +0800 |
| 4 | Subject: [PATCH] add -march=i486 into CFLAGS automatically |
| 5 | |
| 6 | Upstream-Status: Inappropriate [configuration] |
| 7 | |
| 8 | glib configure will check if current gcc need -march=i486, |
| 9 | when gcc need -march=i486 but CFLAGS don't have, |
| 10 | glib configure will abort and advise the user to add -march=i486 or later. |
| 11 | This will break the build process,it's not good for automatic build system. |
| 12 | so change this to adding -march=i485 automatically when it is needed. |
| 13 | --- |
| 14 | configure.ac | 6 ++++-- |
| 15 | 1 files changed, 4 insertions(+), 2 deletions(-) |
| 16 | |
| 17 | Index: glib-2.36.0/configure.ac |
| 18 | =================================================================== |
| 19 | --- glib-2.36.0.orig/configure.ac |
| 20 | +++ glib-2.36.0/configure.ac |
| 21 | @@ -2378,7 +2378,7 @@ dnl |
| 22 | dnl Note that the atomic ops are only available with GCC on x86 when |
| 23 | dnl using -march=i486 or higher. If we detect that the atomic ops are |
| 24 | dnl not available but would be available given the right flags, we want |
| 25 | -dnl to abort and advise the user to fix their CFLAGS. It's better to do |
| 26 | +dnl to add -march=i486 automatically to fix their CFLAGS. It's better to do |
| 27 | dnl that then to silently fall back on emulated atomic ops just because |
| 28 | dnl the user had the wrong build environment. |
| 29 | |
| 30 | @@ -2401,7 +2401,8 @@ AC_CACHE_CHECK([for lock-free atomic int |
| 31 | AC_TRY_COMPILE([], |
| 32 | [volatile int atomic = 2;\ |
| 33 | __sync_bool_compare_and_swap (&atomic, 2, 3);], |
| 34 | - [AC_MSG_ERROR([GLib must be build with -march=i486 or later.])], |
| 35 | + [AC_MSG_WARN([GLib must be build with -march=i486 or later.]) |
| 36 | + SAVE_CFLAGS="${SAVE_CFLAGS} -march=i486"], |
| 37 | []) |
| 38 | CFLAGS="${SAVE_CFLAGS}" |
| 39 | fi |