Backport link test fix from upstream Libtool:

* libltdl.m4 (_LT_SYS_DYNAMIC_LINKER, _LT_LINKER_SHLIBS):
	Add cache variables to tests that require the linker to work.
	For shlibpath_overrides_runpath, this also changes the semantics
	to let the result from the C compiler take precedence.
	compiler take precedence.

binutils/

	* configure: Regenerate.

opcodes/

	* configure: Regenerate.

bfd/

	* configure: Regenerate.

gas/

	* configure: Regenerate.

gprof/

	* configure: Regenerate.

ld/

	* configure: Regenerate.
This commit is contained in:
Ralf Wildenhues 2008-12-18 21:36:44 +00:00
parent a4fc1198a4
commit ca19de342d
1 changed files with 45 additions and 38 deletions

83
libtool.m4 vendored
View File

@ -2454,16 +2454,21 @@ linux* | k*bsd*-gnu)
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no shlibpath_overrides_runpath=no
# Some binutils ld are patched to set DT_RUNPATH # Some binutils ld are patched to set DT_RUNPATH
save_LDFLAGS=$LDFLAGS AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
save_libdir=$libdir [lt_cv_shlibpath_overrides_runpath=no
eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ save_LDFLAGS=$LDFLAGS
LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" save_libdir=$libdir
AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
[AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
[shlibpath_overrides_runpath=yes])]) AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
LDFLAGS=$save_LDFLAGS [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
libdir=$save_libdir [lt_cv_shlibpath_overrides_runpath=yes])])
LDFLAGS=$save_LDFLAGS
libdir=$save_libdir
])
shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
# This implies no fast_install, which is unacceptable. # This implies no fast_install, which is unacceptable.
# Some rework will be needed to allow for fast_install # Some rework will be needed to allow for fast_install
@ -5111,36 +5116,38 @@ x|xyes)
# Test whether the compiler implicitly links with -lc since on some # Test whether the compiler implicitly links with -lc since on some
# systems, -lgcc has to come before -lc. If gcc already passes -lc # systems, -lgcc has to come before -lc. If gcc already passes -lc
# to ld, don't add -lc before -lgcc. # to ld, don't add -lc before -lgcc.
AC_MSG_CHECKING([whether -lc should be explicitly linked in]) AC_CACHE_CHECK([whether -lc should be explicitly linked in],
$RM conftest* [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
echo "$lt_simple_compile_test_code" > conftest.$ac_ext [$RM conftest*
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile) 2>conftest.err; then if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
soname=conftest soname=conftest
lib=conftest lib=conftest
libobjs=conftest.$ac_objext libobjs=conftest.$ac_objext
deplibs= deplibs=
wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
compiler_flags=-v compiler_flags=-v
linker_flags=-v linker_flags=-v
verstring= verstring=
output_objdir=. output_objdir=.
libname=conftest libname=conftest
lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
_LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(allow_undefined_flag, $1)=
if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
then then
_LT_TAGVAR(archive_cmds_need_lc, $1)=no lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
else else
_LT_TAGVAR(archive_cmds_need_lc, $1)=yes lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
fi fi
_LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
else else
cat conftest.err 1>&5 cat conftest.err 1>&5
fi fi
$RM conftest* $RM conftest*
AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) ])
_LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
;; ;;
esac esac
fi fi