diff options
author | ro <ro@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-05-24 09:23:33 +0000 |
---|---|---|
committer | ro <ro@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-05-24 09:23:33 +0000 |
commit | b14cf757ecf4b177d69f1d831b73f5f4d55bbdcc (patch) | |
tree | d1dcff032474a779e717176fb89cb748ad236427 /libgfortran | |
parent | 9776e8bf8bb7bb22c0622ee83b8d556dbe68ac0b (diff) | |
download | gcc-b14cf757ecf4b177d69f1d831b73f5f4d55bbdcc.tar.gz |
Use -z ignore instead of --as-needed on Solaris
* acinclude.m4 (libgfor_cv_have_as_needed): Check for -z ignore, too.
* configure: Regenerate.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199285 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 5 | ||||
-rw-r--r-- | libgfortran/acinclude.m4 | 24 | ||||
-rwxr-xr-x | libgfortran/configure | 48 |
3 files changed, 67 insertions, 10 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 8b34b125770..59ac4da949f 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2013-05-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> + + * acinclude.m4 (libgfor_cv_have_as_needed): Check for -z ignore, too. + * configure: Regenerate. + 2013-05-05 David Edelsohn <dje.gcc@gmail.com> * caf/libcaf.h (_gfortran_caf_critical): Add a prototype. diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4 index 35698ec00f6..ba890f98391 100644 --- a/libgfortran/acinclude.m4 +++ b/libgfortran/acinclude.m4 @@ -296,7 +296,7 @@ AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [ if test "x$libgfor_cv_have_float128" = xyes; then AC_DEFINE(HAVE_FLOAT128, 1, [Define if have a usable __float128 type.]) - dnl Check whether -Wl,--as-needed is supported + dnl Check whether -Wl,--as-needed resp. -Wl,-zignore is supported dnl dnl Turn warnings into error to avoid testsuite breakage. So enable dnl AC_LANG_WERROR, but there's currently (autoconf 2.64) no way to turn @@ -304,23 +304,39 @@ AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [ dnl AC_PATH_XTRA. dnl Cf. http://gcc.gnu.org/ml/gcc-patches/2010-05/msg01889.html ac_xsave_[]_AC_LANG_ABBREV[]_werror_flag=$ac_[]_AC_LANG_ABBREV[]_werror_flag - AC_CACHE_CHECK([whether --as-needed works], + AC_CACHE_CHECK([whether --as-needed/-z ignore works], [libgfor_cv_have_as_needed], [ + # Test for native Solaris options first. + # No whitespace after -z to pass it through -Wl. + libgfor_cv_as_needed_option="-zignore" + libgfor_cv_no_as_needed_option="-zrecord" save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -Wl,--as-needed -lm -Wl,--no-as-needed" + LDFLAGS="$LDFLAGS -Wl,$libgfor_cv_as_needed_option -lm -Wl,$libgfor_cv_no_as_needed_option" libgfor_cv_have_as_needed=no AC_LANG_WERROR AC_LINK_IFELSE([AC_LANG_PROGRAM([])], [libgfor_cv_have_as_needed=yes], [libgfor_cv_have_as_needed=no]) LDFLAGS="$save_LDFLAGS" + if test "x$libgfor_cv_have_as_needed" = xno; then + libgfor_cv_as_needed_option="--as-needed" + libgfor_cv_no_as_needed_option="--no-as-needed" + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,$libgfor_cv_as_needed_option -lm -Wl,$libgfor_cv_no_as_needed_option" + libgfor_cv_have_as_needed=no + AC_LANG_WERROR + AC_LINK_IFELSE([AC_LANG_PROGRAM([])], + [libgfor_cv_have_as_needed=yes], + [libgfor_cv_have_as_needed=no]) + LDFLAGS="$save_LDFLAGS" + fi ac_[]_AC_LANG_ABBREV[]_werror_flag=$ac_xsave_[]_AC_LANG_ABBREV[]_werror_flag ]) dnl For static libgfortran linkage, depend on libquadmath only if needed. if test "x$libgfor_cv_have_as_needed" = xyes; then - LIBQUADSPEC="%{static-libgfortran:--as-needed} -lquadmath %{static-libgfortran:--no-as-needed}" + LIBQUADSPEC="%{static-libgfortran:$libgfor_cv_as_needed_option} -lquadmath %{static-libgfortran:$libgfor_cv_no_as_needed_option}" else LIBQUADSPEC="-lquadmath" fi diff --git a/libgfortran/configure b/libgfortran/configure index 8385e968458..8601d8440fa 100755 --- a/libgfortran/configure +++ b/libgfortran/configure @@ -600,6 +600,7 @@ ac_includes_default="\ ac_header_list= ac_func_list= ac_c_werror_flag= +ac_c_werror_flag= ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS @@ -12333,7 +12334,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12336 "configure" +#line 12337 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -12439,7 +12440,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 12442 "configure" +#line 12443 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -25720,14 +25721,18 @@ $as_echo "#define HAVE_FLOAT128 1" >>confdefs.h ac_xsave_c_werror_flag=$ac_c_werror_flag - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether --as-needed works" >&5 -$as_echo_n "checking whether --as-needed works... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether --as-needed/-z ignore works" >&5 +$as_echo_n "checking whether --as-needed/-z ignore works... " >&6; } if test "${libgfor_cv_have_as_needed+set}" = set; then : $as_echo_n "(cached) " >&6 else + # Test for native Solaris options first. + # No whitespace after -z to pass it through -Wl. + libgfor_cv_as_needed_option="-zignore" + libgfor_cv_no_as_needed_option="-zrecord" save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS -Wl,--as-needed -lm -Wl,--no-as-needed" + LDFLAGS="$LDFLAGS -Wl,$libgfor_cv_as_needed_option -lm -Wl,$libgfor_cv_no_as_needed_option" libgfor_cv_have_as_needed=no ac_c_werror_flag=yes @@ -25753,6 +25758,37 @@ fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" + if test "x$libgfor_cv_have_as_needed" = xno; then + libgfor_cv_as_needed_option="--as-needed" + libgfor_cv_no_as_needed_option="--no-as-needed" + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -Wl,$libgfor_cv_as_needed_option -lm -Wl,$libgfor_cv_no_as_needed_option" + libgfor_cv_have_as_needed=no + +ac_c_werror_flag=yes + if test x$gcc_no_link = xyes; then + as_fn_error "Link tests are not allowed after GCC_NO_EXECUTABLES." "$LINENO" 5 +fi +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + libgfor_cv_have_as_needed=yes +else + libgfor_cv_have_as_needed=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + fi ac_c_werror_flag=$ac_xsave_c_werror_flag fi @@ -25760,7 +25796,7 @@ fi $as_echo "$libgfor_cv_have_as_needed" >&6; } if test "x$libgfor_cv_have_as_needed" = xyes; then - LIBQUADSPEC="%{static-libgfortran:--as-needed} -lquadmath %{static-libgfortran:--no-as-needed}" + LIBQUADSPEC="%{static-libgfortran:$libgfor_cv_as_needed_option} -lquadmath %{static-libgfortran:$libgfor_cv_no_as_needed_option}" else LIBQUADSPEC="-lquadmath" fi |