diff mbox

PR target/70454: Check --with-arch=/--with-arch-32= for 32-bit x86 libatomic library

Message ID 20160330130132.GA18988@intel.com
State New
Headers show

Commit Message

H.J. Lu March 30, 2016, 1:01 p.m. UTC
If --with-arch-32= is used to configure GCC, it should be used to
compile 32-bit x86 libatomic library.  Since --with-arch for 64-bit
> i486, we can use it for 32-bit target library.

Tested on x86-64, with and without --with-arch=.  OK for stage 1?

H.J.
--
	PR target/70454
	* configure.tgt: Use --with-arch=/--with-arch-32= for 32-bit
	x86 target library.
---
 libatomic/configure.tgt | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/libatomic/configure.tgt b/libatomic/configure.tgt
index c5470d7..345c02b 100644
--- a/libatomic/configure.tgt
+++ b/libatomic/configure.tgt
@@ -83,8 +83,12 @@  case "${target_cpu}" in
   x86_64)
 	case " ${CC} ${CFLAGS} " in
 	  *" -m32 "*)
-	    XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic"
-	    XCFLAGS="${XCFLAGS} -fomit-frame-pointer"
+	    # Since --with-arch for 64-bit > i486, we can use it for
+	    # for 32-bit.
+	    if test -z "$with_arch_32" && test -z "$with_arch"; then
+	      XCFLAGS="${XCFLAGS} -march=i486 -mtune=generic"
+	      XCFLAGS="${XCFLAGS} -fomit-frame-pointer"
+	    fi
 	    ;;
 	  *)
 	    ;;