diff options
author | ro <ro@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-15 09:52:37 +0000 |
---|---|---|
committer | ro <ro@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-05-15 09:52:37 +0000 |
commit | 30566810bc8aba091a8763c87865522cc91ebf13 (patch) | |
tree | ea0beae0da2a6e8d4a4227bc5aeea890d1d26bb9 /lto-plugin | |
parent | 3e9481da3fbca87b1f5b167690381ed130a6db11 (diff) | |
download | gcc-30566810bc8aba091a8763c87865522cc91ebf13.tar.gz |
Check for -static-libgcc before use (PR lto/60981)
PR lto/60981
* configure.ac: Check for -static-libgcc.
* configure: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@210465 138bc75d-0d04-0410-961f-82ee72b054a4
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 75a1f8f6076..332067ea48e 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 2fc838329c7..a579b99f404 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 4003ae61bdc..a5f1774dff4 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) |