diff mbox

[libatomic] Don't include XCFLAGS in CFLAGS

Message ID yddk40o1bvs.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth May 7, 2012, 11:14 a.m. UTC
Solaris 10 and 11/x86 bootstrap is currently broken configuring the
64-bit libatomic: configure aborts with

configure:3499: /var/gcc/regression/trunk/11-gcc/build/./gcc/xgcc -B/var/gcc/regression/trunk/11-gcc/build/./gcc/ -B/vol/gcc/i386-pc-solaris2.11/bin/ -B/vol/gcc/i386-pc-solaris2.11/lib/ -isystem /vol/gcc/i386-pc-solaris2.11/include -isystem /vol/gcc/i386-pc-solaris2.11/sys-include  -m64 -g -O2  -march=i486 -mtune=i386 -fomit-frame-pointer   conftest.c  >&5
conftest.c:1:0: error: CPU you selected does not support x86-64 instruction set
 /* confdefs.h */
 ^
conftest.c:1:0: error: CPU you selected does not support x86-64 instruction set
 /* confdefs.h */
 ^
configure:3503: $? = 1
configure:3540: result: 
configure: failed program was:
[...]
configure:3546: error: in `/var/gcc/regression/trunk/11-gcc/build/i386-pc-solaris2.11/amd64/libatomic':
configure:3549: error: C compiler cannot create executables
See `config.log' for more details.

The problem lies in the -march=i486 -mtune=i386 options which shouldn't
be there in combination with -m64.  They stem from the CFLAGS passed in
from the default (32-bit) multilib.  They are expected to be in XCFLAGS
only exactly for that reason, but appear also in CFLAGS.  The root cause
turns out to be a typo in configure.ac, where for -pthreads detection
XCFLAGS are added to CFLAGS instead of the correct XPCFLAGS.

The following patch fixes this and allows bootstrap to finish.

Ok for mainline (I guess this is obvious)?

	Rainer


2012-05-04  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* configure.ac: Add $XPCFLAGS to CFLAGS, not $XCFLAGS.
	* configure: Regenerate.

Comments

Richard Henderson May 7, 2012, 3:58 p.m. UTC | #1
On 05/07/2012 04:14 AM, Rainer Orth wrote:
> 2012-05-04  Rainer Orth<ro@CeBiTec.Uni-Bielefeld.DE>
>
> 	* configure.ac: Add $XPCFLAGS to CFLAGS, not $XCFLAGS.
> 	* configure: Regenerate.

Ok.


r~
diff mbox

Patch

# HG changeset patch
# Parent aa7a50ce274c373b20883a2a508fcb99145229ac
Don't include XCFLAGS in CFLAGS

diff --git a/libatomic/configure b/libatomic/configure
--- a/libatomic/configure
+++ b/libatomic/configure
@@ -14421,7 +14421,7 @@  rm -f core conftest.err conftest.$ac_obj
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
-  CFLAGS="$save_CFLAGS $XCFLAGS"
+  CFLAGS="$save_CFLAGS $XPCFLAGS"
   ;;
 esac
 
diff --git a/libatomic/configure.ac b/libatomic/configure.ac
--- a/libatomic/configure.ac
+++ b/libatomic/configure.ac
@@ -206,7 +206,7 @@  case " $config_path " in
        [pthread_t t; pthread_create(&t,NULL,g,NULL);])],
       [],
       [AC_MSG_ERROR([Pthreads are required to build libatomic])])])
-  CFLAGS="$save_CFLAGS $XCFLAGS"
+  CFLAGS="$save_CFLAGS $XPCFLAGS"
   ;;
 esac