Commit 8dc877eb by Rainer Orth Committed by Rainer Orth

Support --sysroot with Solaris ld

	* configure.ac (gcc_cv_ld_static_dynamic): Also check stderr for
	$gcc_cv_ld --help output.
	(gcc_cv_ld_demangle): Likewise.
	(gcc_cv_ld_eh_frame_hdr): Likewise.
	(gcc_cv_ld_pie): Likewise.
	(gcc_cv_ld_as_needed): Likewise.  Prefer native forms unless $gnu_ld.
	(gcc_cv_ld_buildid): Likewise.
	(gcc_cv_ld_sysroot): Likewise.
	(ld_bndplt_support): Likewise.
	(ld_pushpopstate_support): Likewise.
	* configure: Regenerate.
	* config/sol2.h [!USE_GLD] (SYSROOT_SPEC): Define.

From-SVN: r249496
parent c83c219a
2017-06-22 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* configure.ac (gcc_cv_ld_static_dynamic): Also check stderr for
$gcc_cv_ld --help output.
(gcc_cv_ld_demangle): Likewise.
(gcc_cv_ld_eh_frame_hdr): Likewise.
(gcc_cv_ld_pie): Likewise.
(gcc_cv_ld_as_needed): Likewise. Prefer native forms unless $gnu_ld.
(gcc_cv_ld_buildid): Likewise.
(gcc_cv_ld_sysroot): Likewise.
(ld_bndplt_support): Likewise.
(ld_pushpopstate_support): Likewise.
* configure: Regenerate.
* config/sol2.h [!USE_GLD] (SYSROOT_SPEC): Define.
2017-06-21 Jakub Jelinek <jakub@redhat.com> 2017-06-21 Jakub Jelinek <jakub@redhat.com>
PR target/81151 PR target/81151
......
...@@ -331,6 +331,11 @@ along with GCC; see the file COPYING3. If not see ...@@ -331,6 +331,11 @@ along with GCC; see the file COPYING3. If not see
#endif #endif
#ifndef USE_GLD #ifndef USE_GLD
/* Prefer native form with Solaris ld. */
#define SYSROOT_SPEC "-z sysroot=%R"
#endif
#ifndef USE_GLD
/* With Sun ld, use mapfile to enforce direct binding to libgcc_s unwinder. */ /* With Sun ld, use mapfile to enforce direct binding to libgcc_s unwinder. */
#define LINK_LIBGCC_MAPFILE_SPEC \ #define LINK_LIBGCC_MAPFILE_SPEC \
"%{shared|shared-libgcc:-M %slibgcc-unwind.map}" "%{shared|shared-libgcc:-M %slibgcc-unwind.map}"
......
...@@ -24372,8 +24372,8 @@ if test $in_tree_ld = yes ; then ...@@ -24372,8 +24372,8 @@ if test $in_tree_ld = yes ; then
fi fi
elif test x$gcc_cv_ld != x; then elif test x$gcc_cv_ld != x; then
# Check if linker supports -Bstatic/-Bdynamic option # Check if linker supports -Bstatic/-Bdynamic option
if $gcc_cv_ld --help 2>/dev/null | grep -- -Bstatic > /dev/null \ if $gcc_cv_ld --help 2>&1 | grep -- -Bstatic > /dev/null \
&& $gcc_cv_ld --help 2>/dev/null | grep -- -Bdynamic > /dev/null; then && $gcc_cv_ld --help 2>&1 | grep -- -Bdynamic > /dev/null; then
gcc_cv_ld_static_dynamic=yes gcc_cv_ld_static_dynamic=yes
else else
case "$target" in case "$target" in
...@@ -24426,7 +24426,7 @@ $as_echo_n "checking linker --demangle support... " >&6; } ...@@ -24426,7 +24426,7 @@ $as_echo_n "checking linker --demangle support... " >&6; }
fi fi
elif test x$gcc_cv_ld != x -a x"$gnu_ld" = xyes; then elif test x$gcc_cv_ld != x -a x"$gnu_ld" = xyes; then
# Check if the GNU linker supports --demangle option # Check if the GNU linker supports --demangle option
if $gcc_cv_ld --help 2>/dev/null | grep no-demangle > /dev/null; then if $gcc_cv_ld --help 2>&1 | grep no-demangle > /dev/null; then
gcc_cv_ld_demangle=yes gcc_cv_ld_demangle=yes
fi fi
fi fi
...@@ -28058,7 +28058,7 @@ if test $in_tree_ld = yes ; then ...@@ -28058,7 +28058,7 @@ if test $in_tree_ld = yes ; then
elif test x$gcc_cv_ld != x; then elif test x$gcc_cv_ld != x; then
if echo "$ld_ver" | grep GNU > /dev/null; then if echo "$ld_ver" | grep GNU > /dev/null; then
# Check if linker supports --eh-frame-hdr option # Check if linker supports --eh-frame-hdr option
if $gcc_cv_ld --help 2>/dev/null | grep eh-frame-hdr > /dev/null; then if $gcc_cv_ld --help 2>&1 | grep eh-frame-hdr > /dev/null; then
gcc_cv_ld_eh_frame_hdr=yes gcc_cv_ld_eh_frame_hdr=yes
fi fi
else else
...@@ -28136,7 +28136,7 @@ if test $in_tree_ld = yes ; then ...@@ -28136,7 +28136,7 @@ if test $in_tree_ld = yes ; then
fi fi
elif test x$gcc_cv_ld != x; then elif test x$gcc_cv_ld != x; then
# Check if linker supports -pie option # Check if linker supports -pie option
if $gcc_cv_ld --help 2>/dev/null | grep -- -pie > /dev/null; then if $gcc_cv_ld --help 2>&1 | grep -- -pie > /dev/null; then
gcc_cv_ld_pie=yes gcc_cv_ld_pie=yes
case "$target" in case "$target" in
*-*-solaris2*) *-*-solaris2*)
...@@ -28494,18 +28494,18 @@ if test $in_tree_ld = yes ; then ...@@ -28494,18 +28494,18 @@ if test $in_tree_ld = yes ; then
fi fi
elif test x$gcc_cv_ld != x; then elif test x$gcc_cv_ld != x; then
# Check if linker supports --as-needed and --no-as-needed options # Check if linker supports --as-needed and --no-as-needed options
if $gcc_cv_ld --help 2>/dev/null | grep as-needed > /dev/null; then if $gcc_cv_ld --help 2>&1 | grep as-needed > /dev/null; then
gcc_cv_ld_as_needed=yes gcc_cv_ld_as_needed=yes
else fi
case "$target" in case "$target:$gnu_ld" in
# Solaris 2 ld always supports -z ignore/-z record. *-*-solaris2*:no)
*-*-solaris2*) # Solaris 2 ld always supports -z ignore/-z record. Prefer the native
# forms.
gcc_cv_ld_as_needed=yes gcc_cv_ld_as_needed=yes
gcc_cv_ld_as_needed_option="-z ignore" gcc_cv_ld_as_needed_option="-z ignore"
gcc_cv_ld_no_as_needed_option="-z record" gcc_cv_ld_no_as_needed_option="-z record"
;; ;;
esac esac
fi
fi fi
# --as-needed/-z ignore can only be used if libgcc_s.so.1 uses # --as-needed/-z ignore can only be used if libgcc_s.so.1 uses
# dl_iterate_phdr, i.e. since Solaris 11. # dl_iterate_phdr, i.e. since Solaris 11.
...@@ -28808,7 +28808,7 @@ else ...@@ -28808,7 +28808,7 @@ else
gcc_cv_ld_buildid=yes gcc_cv_ld_buildid=yes
fi fi
elif test x$gcc_cv_ld != x; then elif test x$gcc_cv_ld != x; then
if $gcc_cv_ld --help 2>/dev/null | grep build-id > /dev/null; then if $gcc_cv_ld --help 2>&1 | grep build-id > /dev/null; then
gcc_cv_ld_buildid=yes gcc_cv_ld_buildid=yes
fi fi
fi fi
...@@ -28881,7 +28881,7 @@ else ...@@ -28881,7 +28881,7 @@ else
gcc_cv_ld_sysroot=yes gcc_cv_ld_sysroot=yes
fi fi
elif test x$gcc_cv_ld != x; then elif test x$gcc_cv_ld != x; then
if $gcc_cv_ld --help 2>/dev/null | grep sysroot > /dev/null; then if $gcc_cv_ld --help 2>&1 | grep sysroot > /dev/null; then
gcc_cv_ld_sysroot=yes gcc_cv_ld_sysroot=yes
fi fi
fi fi
...@@ -29857,7 +29857,7 @@ if test x"$ld_is_gold" = xno; then ...@@ -29857,7 +29857,7 @@ if test x"$ld_is_gold" = xno; then
fi fi
elif test x$gcc_cv_ld != x; then elif test x$gcc_cv_ld != x; then
# Check if linker supports -a bndplt option # Check if linker supports -a bndplt option
if $gcc_cv_ld --help 2>/dev/null | grep -- '-z bndplt' > /dev/null; then if $gcc_cv_ld --help 2>&1 | grep -- '-z bndplt' > /dev/null; then
ld_bndplt_support=yes ld_bndplt_support=yes
fi fi
fi fi
...@@ -29881,7 +29881,7 @@ if test x"$ld_is_gold" = xno; then ...@@ -29881,7 +29881,7 @@ if test x"$ld_is_gold" = xno; then
fi fi
elif test x$gcc_cv_ld != x; then elif test x$gcc_cv_ld != x; then
# Check if linker supports --push-state/--pop-state options # Check if linker supports --push-state/--pop-state options
if $gcc_cv_ld --help 2>/dev/null | grep -- '--push-state' > /dev/null; then if $gcc_cv_ld --help 2>&1 | grep -- '--push-state' > /dev/null; then
ld_pushpopstate_support=yes ld_pushpopstate_support=yes
fi fi
fi fi
......
...@@ -3569,8 +3569,8 @@ if test $in_tree_ld = yes ; then ...@@ -3569,8 +3569,8 @@ if test $in_tree_ld = yes ; then
fi fi
elif test x$gcc_cv_ld != x; then elif test x$gcc_cv_ld != x; then
# Check if linker supports -Bstatic/-Bdynamic option # Check if linker supports -Bstatic/-Bdynamic option
if $gcc_cv_ld --help 2>/dev/null | grep -- -Bstatic > /dev/null \ if $gcc_cv_ld --help 2>&1 | grep -- -Bstatic > /dev/null \
&& $gcc_cv_ld --help 2>/dev/null | grep -- -Bdynamic > /dev/null; then && $gcc_cv_ld --help 2>&1 | grep -- -Bdynamic > /dev/null; then
gcc_cv_ld_static_dynamic=yes gcc_cv_ld_static_dynamic=yes
else else
case "$target" in case "$target" in
...@@ -3614,7 +3614,7 @@ if test x"$demangler_in_ld" = xyes; then ...@@ -3614,7 +3614,7 @@ if test x"$demangler_in_ld" = xyes; then
fi fi
elif test x$gcc_cv_ld != x -a x"$gnu_ld" = xyes; then elif test x$gcc_cv_ld != x -a x"$gnu_ld" = xyes; then
# Check if the GNU linker supports --demangle option # Check if the GNU linker supports --demangle option
if $gcc_cv_ld --help 2>/dev/null | grep no-demangle > /dev/null; then if $gcc_cv_ld --help 2>&1 | grep no-demangle > /dev/null; then
gcc_cv_ld_demangle=yes gcc_cv_ld_demangle=yes
fi fi
fi fi
...@@ -4985,7 +4985,7 @@ if test $in_tree_ld = yes ; then ...@@ -4985,7 +4985,7 @@ if test $in_tree_ld = yes ; then
elif test x$gcc_cv_ld != x; then elif test x$gcc_cv_ld != x; then
if echo "$ld_ver" | grep GNU > /dev/null; then if echo "$ld_ver" | grep GNU > /dev/null; then
# Check if linker supports --eh-frame-hdr option # Check if linker supports --eh-frame-hdr option
if $gcc_cv_ld --help 2>/dev/null | grep eh-frame-hdr > /dev/null; then if $gcc_cv_ld --help 2>&1 | grep eh-frame-hdr > /dev/null; then
gcc_cv_ld_eh_frame_hdr=yes gcc_cv_ld_eh_frame_hdr=yes
fi fi
else else
...@@ -5056,7 +5056,7 @@ if test $in_tree_ld = yes ; then ...@@ -5056,7 +5056,7 @@ if test $in_tree_ld = yes ; then
fi fi
elif test x$gcc_cv_ld != x; then elif test x$gcc_cv_ld != x; then
# Check if linker supports -pie option # Check if linker supports -pie option
if $gcc_cv_ld --help 2>/dev/null | grep -- -pie > /dev/null; then if $gcc_cv_ld --help 2>&1 | grep -- -pie > /dev/null; then
gcc_cv_ld_pie=yes gcc_cv_ld_pie=yes
case "$target" in case "$target" in
*-*-solaris2*) *-*-solaris2*)
...@@ -5383,18 +5383,18 @@ if test $in_tree_ld = yes ; then ...@@ -5383,18 +5383,18 @@ if test $in_tree_ld = yes ; then
fi fi
elif test x$gcc_cv_ld != x; then elif test x$gcc_cv_ld != x; then
# Check if linker supports --as-needed and --no-as-needed options # Check if linker supports --as-needed and --no-as-needed options
if $gcc_cv_ld --help 2>/dev/null | grep as-needed > /dev/null; then if $gcc_cv_ld --help 2>&1 | grep as-needed > /dev/null; then
gcc_cv_ld_as_needed=yes gcc_cv_ld_as_needed=yes
else fi
case "$target" in case "$target:$gnu_ld" in
# Solaris 2 ld always supports -z ignore/-z record. *-*-solaris2*:no)
*-*-solaris2*) # Solaris 2 ld always supports -z ignore/-z record. Prefer the native
# forms.
gcc_cv_ld_as_needed=yes gcc_cv_ld_as_needed=yes
gcc_cv_ld_as_needed_option="-z ignore" gcc_cv_ld_as_needed_option="-z ignore"
gcc_cv_ld_no_as_needed_option="-z record" gcc_cv_ld_no_as_needed_option="-z record"
;; ;;
esac esac
fi
fi fi
# --as-needed/-z ignore can only be used if libgcc_s.so.1 uses # --as-needed/-z ignore can only be used if libgcc_s.so.1 uses
# dl_iterate_phdr, i.e. since Solaris 11. # dl_iterate_phdr, i.e. since Solaris 11.
...@@ -5634,7 +5634,7 @@ AC_CACHE_CHECK(linker --build-id support, ...@@ -5634,7 +5634,7 @@ AC_CACHE_CHECK(linker --build-id support,
gcc_cv_ld_buildid=yes gcc_cv_ld_buildid=yes
fi fi
elif test x$gcc_cv_ld != x; then elif test x$gcc_cv_ld != x; then
if $gcc_cv_ld --help 2>/dev/null | grep build-id > /dev/null; then if $gcc_cv_ld --help 2>&1 | grep build-id > /dev/null; then
gcc_cv_ld_buildid=yes gcc_cv_ld_buildid=yes
fi fi
fi]) fi])
...@@ -5689,7 +5689,7 @@ AC_CACHE_CHECK(linker --sysroot support, ...@@ -5689,7 +5689,7 @@ AC_CACHE_CHECK(linker --sysroot support,
gcc_cv_ld_sysroot=yes gcc_cv_ld_sysroot=yes
fi fi
elif test x$gcc_cv_ld != x; then elif test x$gcc_cv_ld != x; then
if $gcc_cv_ld --help 2>/dev/null | grep sysroot > /dev/null; then if $gcc_cv_ld --help 2>&1 | grep sysroot > /dev/null; then
gcc_cv_ld_sysroot=yes gcc_cv_ld_sysroot=yes
fi fi
fi]) fi])
...@@ -6363,7 +6363,7 @@ if test x"$ld_is_gold" = xno; then ...@@ -6363,7 +6363,7 @@ if test x"$ld_is_gold" = xno; then
fi fi
elif test x$gcc_cv_ld != x; then elif test x$gcc_cv_ld != x; then
# Check if linker supports -a bndplt option # Check if linker supports -a bndplt option
if $gcc_cv_ld --help 2>/dev/null | grep -- '-z bndplt' > /dev/null; then if $gcc_cv_ld --help 2>&1 | grep -- '-z bndplt' > /dev/null; then
ld_bndplt_support=yes ld_bndplt_support=yes
fi fi
fi fi
...@@ -6384,7 +6384,7 @@ if test x"$ld_is_gold" = xno; then ...@@ -6384,7 +6384,7 @@ if test x"$ld_is_gold" = xno; then
fi fi
elif test x$gcc_cv_ld != x; then elif test x$gcc_cv_ld != x; then
# Check if linker supports --push-state/--pop-state options # Check if linker supports --push-state/--pop-state options
if $gcc_cv_ld --help 2>/dev/null | grep -- '--push-state' > /dev/null; then if $gcc_cv_ld --help 2>&1 | grep -- '--push-state' > /dev/null; then
ld_pushpopstate_support=yes ld_pushpopstate_support=yes
fi fi
fi fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment