aboutsummaryrefslogtreecommitdiff
path: root/libgo
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2014-09-29 23:37:27 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2014-09-29 23:37:27 +0000
commita819231d57698c60fca33e720078c4dba5ee0d88 (patch)
treebd6acdbba63b2782809e2af042e9315061e37c60 /libgo
parent150dfa34a384bbc247a42989704bf96a9cdae8ad (diff)
downloadgcc-a819231d57698c60fca33e720078c4dba5ee0d88.zip
gcc-a819231d57698c60fca33e720078c4dba5ee0d88.tar.gz
gcc-a819231d57698c60fca33e720078c4dba5ee0d88.tar.bz2
libgo/configure: Use -Qunused-arguments for asm tests if supported.
This supports clang, which by default issues warnings about unused command line arguments, a habit that interacts poorly with configure scripts. From-SVN: r215699
Diffstat (limited to 'libgo')
-rwxr-xr-xlibgo/configure37
-rw-r--r--libgo/configure.ac24
2 files changed, 61 insertions, 0 deletions
diff --git a/libgo/configure b/libgo/configure
index 08ddb18..4861290 100755
--- a/libgo/configure
+++ b/libgo/configure
@@ -15241,6 +15241,28 @@ $as_echo "#define EH_FRAME_FLAGS \"aw\"" >>confdefs.h
fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Qunused-arguments" >&5
+$as_echo_n "checking if compiler supports -Qunused-arguments... " >&6; }
+if test "${libgo_cv_c_unused_arguments+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+else
+ CFLAGS_hold=$CFLAGS
+CFLAGS="$CFLAGS -Qunused-arguments"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+int i;
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ libgo_cv_c_unused_arguments=yes
+else
+ libgo_cv_c_unused_arguments=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS=$CFLAGS_hold
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgo_cv_c_unused_arguments" >&5
+$as_echo "$libgo_cv_c_unused_arguments" >&6; }
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if assembler supports GNU comdat group syntax" >&5
$as_echo_n "checking if assembler supports GNU comdat group syntax... " >&6; }
if test "${libgo_cv_as_comdat_gnu+set}" = set; then :
@@ -15248,11 +15270,16 @@ if test "${libgo_cv_as_comdat_gnu+set}" = set; then :
else
echo '.section .text,"axG",@progbits,.foo,comdat' > conftest.s
+CFLAGS_hold=$CFLAGS
+if test "$libgo_cv_c_unused_arguments" = yes; then
+ CFLAGS="$CFLAGS -Qunused-arguments"
+fi
if $CC $CFLAGS -c conftest.s > /dev/null 2>&1; then
libgo_cv_as_comdat_gnu=yes
else
libgo_cv_as_comdat_gnu=no
fi
+CFLAGS=$CFLAGS_hold
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgo_cv_as_comdat_gnu" >&5
@@ -15271,9 +15298,14 @@ else
libgo_cv_as_x86_pcrel=yes
echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
+CFLAGS_hold=$CFLAGS
+if test "$libgo_cv_c_unused_arguments" = yes; then
+ CFLAGS="$CFLAGS -Qunused-arguments"
+fi
if $CC $CFLAGS -c conftest.s 2>&1 | $EGREP -i 'illegal|warning' > /dev/null; then
libgo_cv_as_x86_pcrel=no
fi
+CFLAGS=$CFLAGS_hold
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgo_cv_as_x86_pcrel" >&5
@@ -15292,9 +15324,14 @@ else
libgo_cv_as_x86_64_unwind_section_type=yes
echo '.section .eh_frame,"a",@unwind' > conftest.s
+CFLAGS_hold=$CFLAGS
+if test "$libgo_cv_c_unused_arguments" = yes; then
+ CFLAGS="$CFLAGS -Qunused-arguments"
+fi
if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
libgo_cv_as_x86_64_unwind_section_type=no
fi
+CFLAGS=$CFLAGS_hold
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgo_cv_as_x86_64_unwind_section_type" >&5
diff --git a/libgo/configure.ac b/libgo/configure.ac
index 5e1e4d9..11bba70 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -785,14 +785,28 @@ else
[Define to the flags needed for the .section .eh_frame directive.])
fi
+AC_CACHE_CHECK([if compiler supports -Qunused-arguments],
+[libgo_cv_c_unused_arguments],
+[CFLAGS_hold=$CFLAGS
+CFLAGS="$CFLAGS -Qunused-arguments"
+AC_COMPILE_IFELSE([[int i;]],
+[libgo_cv_c_unused_arguments=yes],
+[libgo_cv_c_unused_arguments=no])
+CFLAGS=$CFLAGS_hold])
+
AC_CACHE_CHECK([if assembler supports GNU comdat group syntax],
libgo_cv_as_comdat_gnu, [
echo '.section .text,"axG",@progbits,.foo,comdat' > conftest.s
+CFLAGS_hold=$CFLAGS
+if test "$libgo_cv_c_unused_arguments" = yes; then
+ CFLAGS="$CFLAGS -Qunused-arguments"
+fi
if $CC $CFLAGS -c conftest.s > /dev/null 2>&1; then
libgo_cv_as_comdat_gnu=yes
else
libgo_cv_as_comdat_gnu=no
fi
+CFLAGS=$CFLAGS_hold
])
if test "x$libgo_cv_as_comdat_gnu" = xyes; then
AC_DEFINE(HAVE_AS_COMDAT_GAS, 1,
@@ -803,9 +817,14 @@ AC_CACHE_CHECK([assembler supports pc related relocs],
libgo_cv_as_x86_pcrel, [
libgo_cv_as_x86_pcrel=yes
echo '.text; foo: nop; .data; .long foo-.; .text' > conftest.s
+CFLAGS_hold=$CFLAGS
+if test "$libgo_cv_c_unused_arguments" = yes; then
+ CFLAGS="$CFLAGS -Qunused-arguments"
+fi
if $CC $CFLAGS -c conftest.s 2>&1 | $EGREP -i 'illegal|warning' > /dev/null; then
libgo_cv_as_x86_pcrel=no
fi
+CFLAGS=$CFLAGS_hold
])
if test "x$libgo_cv_as_x86_pcrel" = xyes; then
AC_DEFINE(HAVE_AS_X86_PCREL, 1,
@@ -816,9 +835,14 @@ AC_CACHE_CHECK([assembler supports unwind section type],
libgo_cv_as_x86_64_unwind_section_type, [
libgo_cv_as_x86_64_unwind_section_type=yes
echo '.section .eh_frame,"a",@unwind' > conftest.s
+CFLAGS_hold=$CFLAGS
+if test "$libgo_cv_c_unused_arguments" = yes; then
+ CFLAGS="$CFLAGS -Qunused-arguments"
+fi
if $CC $CFLAGS -c conftest.s 2>&1 | grep -i warning > /dev/null; then
libgo_cv_as_x86_64_unwind_section_type=no
fi
+CFLAGS=$CFLAGS_hold
])
if test "x$libgo_cv_as_x86_64_unwind_section_type" = xyes; then
AC_DEFINE(HAVE_AS_X86_64_UNWIND_SECTION_TYPE, 1,