This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Use --push-state --as-needed and --pop-state instead of --as-needed and --no-as-needed for libgcc
- From: Matthias Klose <doko at ubuntu dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 12 Apr 2018 09:29:02 +0200
- Subject: Re: [PATCH] Use --push-state --as-needed and --pop-state instead of --as-needed and --no-as-needed for libgcc
- References: <20180411103108.GP8577@tucnak> <d3c278fb-45e8-ea3f-5148-8a693a1ce857@ubuntu.com> <20180411185549.GA8577@tucnak>
On 11.04.2018 20:55, Jakub Jelinek wrote:
> On Wed, Apr 11, 2018 at 06:07:17PM +0200, Matthias Klose wrote:
>> On 11.04.2018 12:31, Jakub Jelinek wrote:
>>> Hi!
>>>
>>> As discussed, using --as-needed and --no-as-needed is dangerous, because
>>> it results in --no-as-needed even for libraries after -lgcc_s, even when the
>>> default is --as-needed or --as-needed has been specified earlier on the
>>> command line.
>>>
>>> If the linker supports --push-state/--pop-state, we should IMHO use it.
>>>
>>> Bootstrapped/regtested on x86_64-linux and i686-linux, ok for stage1?
>>>
>>> Or is this something we want in GCC8 too?
>>
>> this is problematic for binutils versions with --push-state/--pop-state support
>> in the BFD linker but not in gold, and then using -fuse-ld=gold. So maybe the
>> version check for the BFD linker should only succeed for the first binutils
>> version which also has -push-state/--pop-state support in gold.
>
> Does anybody use -fuse-ld=gold?
grep the build log of your favorite distro, unless these are not beautified and
not showing any command line options.
For Debian/Ubuntu it's haskell using gold by default, and some upstreams like
systemd turns it on by default, assuming it has the same quality on any
architecture.