re PR rtl-optimization/79003 (r238991 breaks ODR)
authorJakub Jelinek <jakub@redhat.com>
Sun, 8 Jan 2017 16:43:30 +0000 (17:43 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sun, 8 Jan 2017 16:43:30 +0000 (17:43 +0100)
PR bootstrap/79003
* Makefile.in (CFLAGS, CPPFLAGS, LDFLAGS): Remove -fno-lto.
(NOLTO_FLAGS): New variable.
(ALL_CFLAGS): Use it.
* configure.ac (nolto_flags): New ACX_PROG_CC_WARNING_OPTS,
check for whether -fno-lto works.
* configure: Regenerated.

From-SVN: r244208

libdecnumber/ChangeLog
libdecnumber/Makefile.in
libdecnumber/configure
libdecnumber/configure.ac

index 0326fa371ceb23717bd408f1444f6323fcbbbee3..287e373efc873d9a4cec475fdd869690b84f1db6 100644 (file)
@@ -1,3 +1,13 @@
+2017-01-08  Jakub Jelinek  <jakub@redhat.com>
+
+       PR bootstrap/79003
+       * Makefile.in (CFLAGS, CPPFLAGS, LDFLAGS): Remove -fno-lto.
+       (NOLTO_FLAGS): New variable.
+       (ALL_CFLAGS): Use it.
+       * configure.ac (nolto_flags): New ACX_PROG_CC_WARNING_OPTS,
+       check for whether -fno-lto works.
+       * configure: Regenerated.
+
 2017-01-06  Martin Liska  <mliska@suse.cz>
 
        PR bootstrap/79003
index 2cfc5f4872026bd6eecaec216d6ce60ed65be452..8f13f324edf1f1d02de1ca1dcf920ba18b0a640b 100644 (file)
@@ -31,19 +31,20 @@ ACLOCAL = @ACLOCAL@
 AUTOCONF = @AUTOCONF@
 AUTOHEADER = @AUTOHEADER@
 CC = @CC@
-CFLAGS = @CFLAGS@ -fno-lto
+CFLAGS = @CFLAGS@
 WARN_CFLAGS = @WARN_CFLAGS@ @WARN_PEDANTIC@ @WERROR@
 CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@ -fno-lto
+CPPFLAGS = @CPPFLAGS@
 INSTALL_DATA = @INSTALL_DATA@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
-LDFLAGS = @LDFLAGS@ -fno-lto
+LDFLAGS = @LDFLAGS@
 LIBICONV = @LIBICONV@
 PACKAGE = @PACKAGE@
 PICFLAG = @PICFLAG@
 RANLIB = @RANLIB@
 SHELL = @SHELL@
 objext = @OBJEXT@
+NOLTO_FLAGS = @nolto_flags@
 
 datarootdir = @datarootdir@
 datadir = @datadir@
@@ -58,7 +59,8 @@ enable_decimal_float= @enable_decimal_float@
 
 INCLUDES = -I$(srcdir) -I.
 
-ALL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(INCLUDES) $(CPPFLAGS) $(PICFLAG)
+ALL_CFLAGS = $(CFLAGS) $(WARN_CFLAGS) $(NOLTO_FLAGS) $(INCLUDES) $(CPPFLAGS) \
+            $(PICFLAG)
 
 bid_OBJS = bid2dpd_dpd2bid.$(objext) host-ieee32.$(objext) \
        host-ieee64.$(objext) host-ieee128.$(objext)
index 35baf0798bc9fee63df5d6a4ca5fd6e298b1c243..4cb732e80d45e0f23c6ecf3c3bd41fecfef87b7c 100755 (executable)
@@ -613,6 +613,7 @@ EGREP
 GREP
 CPP
 WERROR
+nolto_flags
 WARN_PEDANTIC
 WARN_CFLAGS
 AUTOHEADER
@@ -3382,6 +3383,64 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+nolto_flags=
+save_CFLAGS="$CFLAGS"
+for real_option in -fno-lto; do
+  # Do the check with the no- prefix removed since gcc silently
+  # accepts any -Wno-* option on purpose
+  case $real_option in
+    -Wno-*) option=-W`expr x$real_option : 'x-Wno-\(.*\)'` ;;
+    *) option=$real_option ;;
+  esac
+  as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh`
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5
+$as_echo_n "checking whether $CC supports $option... " >&6; }
+if { as_var=$as_acx_Woption; eval "test \"\${$as_var+set}\" = set"; }; then :
+  $as_echo_n "(cached) " >&6
+else
+  CFLAGS="$option"
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$as_acx_Woption=yes"
+else
+  eval "$as_acx_Woption=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+eval ac_res=\$$as_acx_Woption
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; then :
+  nolto_flags="$nolto_flags${nolto_flags:+ }$real_option"
+fi
+  done
+CFLAGS="$save_CFLAGS"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
 # Only enable with --enable-werror-always until existing warnings are
 # corrected.
 ac_ext=c
index 2945ca39a835e1226cb83d1c881ea8a1aa50881b..c9f341f2f7bc74fcfb3f2942ca23b1ff554ea040 100644 (file)
@@ -43,6 +43,8 @@ ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \
                          -Wmissing-format-attribute -Wcast-qual])
 ACX_PROG_CC_WARNING_ALMOST_PEDANTIC([-Wno-long-long])
 
+ACX_PROG_CC_WARNING_OPTS([-fno-lto], [nolto_flags])
+
 # Only enable with --enable-werror-always until existing warnings are
 # corrected.
 ACX_PROG_CC_WARNINGS_ARE_ERRORS([manual])