From 5f69fdaabd40caaf81e63cdb09d175e3d660daa2 Mon Sep 17 00:00:00 2001 From: ian Date: Mon, 29 Sep 2014 23:37:27 +0000 Subject: 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215699 138bc75d-0d04-0410-961f-82ee72b054a4 --- libgo/configure | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'libgo/configure') diff --git a/libgo/configure b/libgo/configure index 08ddb1808eef..486129030f39 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 -- cgit v1.2.3