summaryrefslogtreecommitdiff
path: root/gcc/configure.ac
diff options
context:
space:
mode:
authorro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-15 10:31:57 +0000
committerro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-15 10:31:57 +0000
commit8aaed91dfc5f8fcd17fd6b61de3a6d68e59b5e1e (patch)
treec14f024bbdb6a514a3b90e6bfd980a6fc278ed5a /gcc/configure.ac
parent98c0d6572c62b325c1e8635df3d6b22003b83619 (diff)
downloadgcc-8aaed91dfc5f8fcd17fd6b61de3a6d68e59b5e1e.tar.gz
Use -z ignore instead of --as-needed on Solaris
* configure.ac (gcc_cv_ld_as_needed): Set gcc_cv_ld_as_needed_option, gcc_cv_no_as_needed_option. Use -z ignore, -z record on *-*-solaris2*. (HAVE_LD_AS_NEEDED): Update comment. (LD_AS_NEEDED_OPTION, LD_NO_AS_NEEDED_OPTION): Define. * configure: Regenerate. * config.in: Regenerate. * gcc.c (init_gcc_specs) [USE_LD_AS_NEEDED]: Use LD_AS_NEEDED_OPTION, LD_NO_AS_NEEDED_OPTION. * config/sol2.h [HAVE_LD_AS_NEEDED] (USE_LD_AS_NEEDED): Define. * doc/tm.texi.in (USE_LD_AS_NEEDED): Allow for --as-needed equivalents. Fix markup. * doc/tm.texi: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197964 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/configure.ac')
-rw-r--r--gcc/configure.ac17
1 files changed, 16 insertions, 1 deletions
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 068c66ae9a3..1d5175b9f7e 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -4538,6 +4538,8 @@ AC_MSG_RESULT($gcc_cv_ld_eh_gc_sections_bug)
AC_CACHE_CHECK(linker --as-needed support,
gcc_cv_ld_as_needed,
[gcc_cv_ld_as_needed=no
+gcc_cv_ld_as_needed_option='--as-needed'
+gcc_cv_ld_no_as_needed_option='--no-as-needed'
if test $in_tree_ld = yes ; then
if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 16 -o "$gcc_cv_gld_major_version" -gt 2 \
&& test $in_tree_ld_is_elf = yes; then
@@ -4547,12 +4549,25 @@ elif test x$gcc_cv_ld != x; then
# 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
gcc_cv_ld_as_needed=yes
+ else
+ case "$target" in
+ # Solaris 2 ld always supports -z ignore/-z record.
+ *-*-solaris2*)
+ gcc_cv_ld_as_needed=yes
+ gcc_cv_ld_as_needed_option="-z ignore"
+ gcc_cv_ld_no_as_needed_option="-z record"
+ ;;
+ esac
fi
fi
])
if test x"$gcc_cv_ld_as_needed" = xyes; then
AC_DEFINE(HAVE_LD_AS_NEEDED, 1,
-[Define if your linker supports --as-needed and --no-as-needed options.])
+[Define if your linker supports --as-needed/--no-as-needed or equivalent options.])
+ AC_DEFINE_UNQUOTED(LD_AS_NEEDED_OPTION, "$gcc_cv_ld_as_needed_option",
+[Define to the linker option to ignore unused dependencies.])
+ AC_DEFINE_UNQUOTED(LD_NO_AS_NEEDED_OPTION, "$gcc_cv_ld_no_as_needed_option",
+[Define to the linker option to keep unused dependencies.])
fi
case "$target:$tm_file" in