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/acinclude.m4 | |
parent | 9776e8bf8bb7bb22c0622ee83b8d556dbe68ac0b (diff) | |
download | ppe42-gcc-b14cf757ecf4b177d69f1d831b73f5f4d55bbdcc.tar.gz ppe42-gcc-b14cf757ecf4b177d69f1d831b73f5f4d55bbdcc.zip |
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/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 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 |