Patchwork [v3,build] Restrict -Wa,-nH use to Solaris (PR libstdc++/55594)

login
register
mail settings
Submitter Rainer Orth
Date Jan. 7, 2013, 4:39 p.m.
Message ID <yddobh13q1z.fsf@lokon.CeBiTec.Uni-Bielefeld.DE>
Download mbox | patch
Permalink /patch/209978/
State New
Headers show

Comments

Rainer Orth - Jan. 7, 2013, 4:39 p.m.
As reported in the PR, the AIX assembler also accepts the -nH option,
but with completely different semantics.  To avoid this, the current
patch restricts checking the option to Solaris targets.

Bootstrapped without regressions on i386-pc-solaris2.10 with Sun as
(-Wa,-nH is added), x86_64-unknown-linux-gnu (test no longer performed),
tested on AIX by David.

Ok for mainline?

	Rainer


2013-01-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR libstdc++/55594
	* acinclude.m4 (GLIBCXX_CHECK_ASSEMBLER_HWCAP): Restrict test to
	Solaris targets.
	* configure: Regenerate.
Jonathan Wakely - Jan. 7, 2013, 9:01 p.m.
On 7 January 2013 16:39, Rainer Orth wrote:
> As reported in the PR, the AIX assembler also accepts the -nH option,
> but with completely different semantics.  To avoid this, the current
> patch restricts checking the option to Solaris targets.
>
> Bootstrapped without regressions on i386-pc-solaris2.10 with Sun as
> (-Wa,-nH is added), x86_64-unknown-linux-gnu (test no longer performed),
> tested on AIX by David.
>
> Ok for mainline?

This is OK, thanks.

Patch

# HG changeset patch
# Parent 432f2ce7493ce21ac73d8d1a10d32695da22d58a
Restrict -Wa,-nH use to Solaris (PR libstdc++/55594)

diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -178,17 +178,23 @@  dnl
 AC_DEFUN([GLIBCXX_CHECK_ASSEMBLER_HWCAP], [
   test -z "$HWCAP_FLAGS" && HWCAP_FLAGS=''
 
-  ac_save_CFLAGS="$CFLAGS"
-  CFLAGS="$CFLAGS -Wa,-nH"
-
-  AC_MSG_CHECKING([for as that supports -Wa,-nH])
-  AC_TRY_COMPILE([], [return 0;], [ac_hwcap_flags=yes],[ac_hwcap_flags=no])
-  if test "$ac_hwcap_flags" = "yes"; then
-    HWCAP_FLAGS="-Wa,-nH $HWCAP_FLAGS"
-  fi
-  AC_MSG_RESULT($ac_hwcap_flags)
-
-  CFLAGS="$ac_save_CFLAGS"
+  # Restrict the test to Solaris, other assemblers (e.g. AIX as) have -nH
+  # with a different meaning.
+  case ${target_os} in
+    solaris2*)
+      ac_save_CFLAGS="$CFLAGS"
+      CFLAGS="$CFLAGS -Wa,-nH"
+
+      AC_MSG_CHECKING([for as that supports -Wa,-nH])
+      AC_TRY_COMPILE([], [return 0;], [ac_hwcap_flags=yes],[ac_hwcap_flags=no])
+      if test "$ac_hwcap_flags" = "yes"; then
+	HWCAP_FLAGS="-Wa,-nH $HWCAP_FLAGS"
+      fi
+      AC_MSG_RESULT($ac_hwcap_flags)
+
+      CFLAGS="$ac_save_CFLAGS"
+      ;;
+  esac
 
   AC_SUBST(HWCAP_FLAGS)
 ])