[build] Use -z ignore instead of --as-needed on Solaris

Rainer Orth ro@CeBiTec.Uni-Bielefeld.DE
Mon Apr 8 13:23:00 GMT 2013


While the Solaris linker doesn't support the --as-needed/--no-as-needed
options (yet), it long has provided the equivalent -z ignore/-z record
options.  This patch makes use of them, avoiding unnecessary
dependencies on libgcc_s.so.1.

Bootstrapped without regressions on i386-pc-solaris2.11 (and checking
that many dependencies on libgcc_s.so.1 in runtime libraries are gone
that were flagged as unused by ldd -u) and x86_64-unknown-linux-gnu
(gcc/specs unchanged, make check still running).

Ok for mainline if it passes?

Thanks.
        Rainer


2013-04-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* 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.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sol2-as-needed.patch
Type: text/x-patch
Size: 3265 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20130408/9d65274e/attachment.bin>
-------------- next part --------------

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


More information about the Gcc-patches mailing list