diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2013-05-24 09:23:33 +0000 |
---|---|---|
committer | Rainer Orth <ro@gcc.gnu.org> | 2013-05-24 09:23:33 +0000 |
commit | 828012a527877b954f10ea4cda161b4c9860d69d (patch) | |
tree | d1dcff032474a779e717176fb89cb748ad236427 /libgfortran/acinclude.m4 | |
parent | 905b92cb0163ccff04b243053660754b583c3f61 (diff) | |
download | gcc-828012a527877b954f10ea4cda161b4c9860d69d.zip gcc-828012a527877b954f10ea4cda161b4c9860d69d.tar.gz gcc-828012a527877b954f10ea4cda161b4c9860d69d.tar.bz2 |
Use -z ignore instead of --as-needed on Solaris
* acinclude.m4 (libgfor_cv_have_as_needed): Check for -z ignore, too.
* configure: Regenerate.
From-SVN: r199285
Diffstat (limited to 'libgfortran/acinclude.m4')
-rw-r--r-- | libgfortran/acinclude.m4 | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4 index 35698ec..ba890f9 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 |