diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2014-05-15 09:52:37 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2014-05-15 09:52:37 +0000 |
commit | a2555c65a0f29b846038229b2f55adbb1c550ac3 (patch) | |
tree | ea0beae0da2a6e8d4a4227bc5aeea890d1d26bb9 /lto-plugin | |
parent | c4622c2bed1f740f996ca7f2ed5300a4d14da143 (diff) | |
download | gcc-a2555c65a0f29b846038229b2f55adbb1c550ac3.zip gcc-a2555c65a0f29b846038229b2f55adbb1c550ac3.tar.gz gcc-a2555c65a0f29b846038229b2f55adbb1c550ac3.tar.bz2 |
Check for -static-libgcc before use (PR lto/60981)
PR lto/60981
* configure.ac: Check for -static-libgcc.
* configure: Regenerate.
From-SVN: r210465
Diffstat (limited to 'lto-plugin')
-rw-r--r-- | lto-plugin/ChangeLog | 6 | ||||
-rwxr-xr-x | lto-plugin/configure | 30 | ||||
-rw-r--r-- | lto-plugin/configure.ac | 14 |
3 files changed, 46 insertions, 4 deletions
diff --git a/lto-plugin/ChangeLog b/lto-plugin/ChangeLog index 75a1f8f..332067e 100644 --- a/lto-plugin/ChangeLog +++ b/lto-plugin/ChangeLog @@ -1,3 +1,9 @@ +2014-05-15 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + PR lto/60981 + * configure.ac: Check for -static-libgcc. + * configure: Regenerate. + 2014-04-17 Jakub Jelinek <jakub@redhat.com> PR sanitizer/56781 diff --git a/lto-plugin/configure b/lto-plugin/configure index 2fc8383..a579b99 100755 --- a/lto-plugin/configure +++ b/lto-plugin/configure @@ -4087,8 +4087,32 @@ fi done CFLAGS="$save_CFLAGS" + +# Check whether -static-libgcc is supported. +saved_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS -static-libgcc" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -static-libgcc" >&5 +$as_echo_n "checking for -static-libgcc... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + int main() {} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + have_static_libgcc=yes +else + have_static_libgcc=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_static_libgcc" >&5 +$as_echo "$have_static_libgcc" >&6; }; +LDFLAGS="$saved_LDFLAGS" # Need -Wc to get it through libtool. -if test "x$GCC" = xyes; then ac_lto_plugin_ldflags="-Wc,-static-libgcc"; fi +if test "x$have_static_libgcc" = xyes; then + ac_lto_plugin_ldflags="-Wc,-static-libgcc" +fi + case `pwd` in *\ * | *\ *) @@ -10562,7 +10586,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10565 "configure" +#line 10589 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -10668,7 +10692,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10671 "configure" +#line 10695 "configure" #include "confdefs.h" #if HAVE_DLFCN_H diff --git a/lto-plugin/configure.ac b/lto-plugin/configure.ac index 4003ae6..a5f1774d 100644 --- a/lto-plugin/configure.ac +++ b/lto-plugin/configure.ac @@ -7,9 +7,21 @@ AM_MAINTAINER_MODE AC_PROG_CC AC_SYS_LARGEFILE ACX_PROG_CC_WARNING_OPTS([-Wall], [ac_lto_plugin_warn_cflags]) + +# Check whether -static-libgcc is supported. +saved_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS -static-libgcc" +AC_MSG_CHECKING([for -static-libgcc]) +AC_LINK_IFELSE([ + int main() {}], [have_static_libgcc=yes], [have_static_libgcc=no]) +AC_MSG_RESULT($have_static_libgcc); +LDFLAGS="$saved_LDFLAGS" # Need -Wc to get it through libtool. -if test "x$GCC" = xyes; then ac_lto_plugin_ldflags="-Wc,-static-libgcc"; fi +if test "x$have_static_libgcc" = xyes; then + ac_lto_plugin_ldflags="-Wc,-static-libgcc" +fi AC_SUBST(ac_lto_plugin_ldflags) + AM_PROG_LIBTOOL ACX_LT_HOST_FLAGS AC_SUBST(target_noncanonical) |