shared static this not invoked on almalinux 8.5, all is well on fedora 35

ichneumwn idonotenjoyemail at idonotenjoyemail.org
Mon Jun 13 14:14:43 UTC 2022


On Monday, 13 June 2022 at 13:37:41 UTC, ichneumwn wrote:
> On Friday, 10 June 2022 at 11:48:37 UTC, kinke wrote:
>> Ah, so meson seems to link manually, not via the D compiler, 
>> ignoring LDC's preference for linkers (so you most likely 
>> ended up using uber-slow ld.bfd instead of ld.gold) etc. It 
>> needs to be adapted for LDC v1.29 (to include the special 
>> prebuilt object file mentioned above that LDC would link in 
>> implicitly) if it hasn't been already - 'big news' #5 in 
>> https://github.com/ldc-developers/ldc/releases/tag/v1.29.0.
>
> I see, that probably explains the "hanging" when I use 1.29.0. 
> meson is mostly pleasant to use, but it is rather opaque and it 
> is often unclear how to influence what it decides to do (part 
> of that could be inexperience)

Hang on, I am talking rubbish. This is the chain of events:

meson compile --version told me:

     ldc2 -of=mwe mwe.p/dsostub.d.o mwe.p/md_static_import.d.o 
mwe.p/main.d.o -L=--allow-shlib-undefined -link-defaultlib-shared

I added a "-v" to this and reexecuted this manually. This told me 
that the following gets executed:

     /bin/cc mwe.p/dsostub.d.o mwe.p/md_static_import.d.o 
mwe.p/main.d.o -o mwe -Xlinker --allow-shlib-undefined 
-L/opt/ldc2-1.28.0/lib -lphobos2-ldc-shared -ldruntime-ldc-shared 
-Wl,-rpath,/opt/ldc2-1.28.0/lib -Wl,--gc-sections -lrt -ldl 
-lpthread -lm -m64

And that seems to invoke /bin/ld which through 
/etc/alternatives/ld links to /usr/bin/ld.bfd. So that seems how 
I end up with ld.bfd... Meson not to blame, apologies to meson 
:). I might be able to get meson to pass -fuse-ld=ld.gold or lld 
through ldc2 to /bin/cc.





More information about the digitalmars-d-ldc mailing list