diff mbox

[libatomic] Always compile atomic builtin tests with $XCFLAGS (PR other/53284)

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

Commit Message

Rainer Orth May 10, 2012, 9:16 a.m. UTC
As described in the PR, several 32-bit libatomic tests FAIL on
Solaris/x86 with infinite recursion e.g. in
__atomic_compare_exchange_8.  It turns out that this happens because,
unlike on glibc targets, the atomic builtin configure tests are run as
compile tests, but are currently not compiled with $XCFLAGS, unlike the
real code.  The following patch fixes this, tested on
i386-pc-solaris2.10 and x86_64-unknown-linux-gnu, approved by rth in the
PR, installed on mainline.

	Rainer


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

	PR other/53284
	* acinclude.m4 (LIBAT_TEST_ATOMIC_BUILTIN): Add -O0 -S to CFLAGS
	instead of overriding.
	* configure: Regenerate.
diff mbox

Patch

# HG changeset patch
# Parent 6c6136d0a9792bfd3fe9600f7867d5edf5c9b114
Always compile atomic builtin tests with $XCFLAGS

diff --git a/libatomic/acinclude.m4 b/libatomic/acinclude.m4
--- a/libatomic/acinclude.m4
+++ b/libatomic/acinclude.m4
@@ -67,7 +67,7 @@  AC_DEFUN([LIBAT_TEST_ATOMIC_BUILTIN],[
     else
       old_CFLAGS="$CFLAGS"
       # Compile unoptimized.
-      CFLAGS='-O0 -S'
+      CFLAGS="$CFLAGS -O0 -S"
       if AC_TRY_EVAL(ac_compile); then
         if grep __atomic_ conftest.s >/dev/null 2>&1 ; then
 	  eval $2=no