tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: fixing "libtool -module" for C++



On Saturday 22 Mar 2025, at 13:31, Martin Husemann wrote:
> On Sat, Mar 22, 2025 at 01:18:31PM +0100, Anthony Mallet wrote:
> > For instance, using your fixunsdfdi example (x86_64):
> > $ nm /usr/lib/libgcc_s.so  | grep fixunsdfdi
> > 000000000000b8c4 T __fixunsdfdi
>
> Indeed:
>
> 0000bea0 t 00008000.got2.plt_pic32.__fixunsdfdi
> 0000b78c T __fixunsdfdi

So is this spec excerpt really needed?
%{!static-libgcc:--as-needed -lgcc_s --no-as-needed -lgcc}
                                                    ^^^^^^

I feel like -lgcc could be removed (or added under a %{!static}).

If I dumpspec gcc12 from pkgsrc, I get for libgcc:
%{static|static-libgcc|static-pie:-lgcc -lgcc_eh}%{!static:%{!static-libgcc:%{!static-pie:%{!shared-libgcc:-lgcc --push-state --as-needed -lgcc_s --pop-state}%{shared-libgcc:-lgcc_s%{!shared: -lgcc}}}}}
and this effectively removes -lgcc in the shared case as seen with:
$ /usr/local/gcc12/bin/g++ -shared -v /dev/null
-> -lstdc++ -lm -lgcc_s -lc -lgcc_s

> All of our toolchains pre-define __ELF__ as 1 (AFAICT).

Ok, this can at least simply this part of libtool :)


Home | Main Index | Thread Index | Old Index