-
-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linux: Don't default to ld.gold linker & fix TLS range with static x86/x64 druntime #3848
Conversation
For reference, here are some linking times on Ubuntu 20.04 for a pretty large executable (~1.1 GB with debuginfos, FWIW compiled with DMD) using the distro linkers:
|
Oh, lld is more picky than gold, and rightfully so:
These are auto-generated dtors which don't inherit the |
The frontend workaround is now proposed as dlang/dmd#13167. It's really just a workaround for simple cases like this, and just addressing the IMO oddity that derived C++ classes get a superfluous dtor, even if they don't introduce any new fields requiring destruction or user dtors. The Not using gold has led to #3849. And the LTO lit-tests with lld run into #3786 apparently. |
I hope the issues with old bfd aren't really a thing anymore. The main reason is that the user might have set LLD as default `/usr/bin/ld` symlink, and LDC not using it by default isn't intuitive. And LLD can be significantly faster than gold.
bfd cannot be used for linking the final compiler with LTO, it rejects bitcode .a libs.
As bfd doesn't support lib{druntime,phobos}-ldc-lto.a libs.
0f68e03
to
913276e
Compare
aa6afcc
to
8cf9460
Compare
After some manual tests with bfd and lld linkers, this should fix ldc-developers#3849.
8cf9460
to
93be02b
Compare
As for Azure CI Linux, using the LLD bundled with the LDC-LLVM package and thus matching the LLVM version LDC is linked against. The prebuilt Linux packages are thus linked with LLD now.
Now that lld is tested by Azure & Travis, use GH Actions for gold. Cirrus & Circle use bfd.
93be02b
to
15e87a9
Compare
To work around the LTO test failures with lld (ldc-developers#3786).
I hope the issues with old bfd aren't really a thing anymore.
The main reason is that the user might have set LLD as default
/usr/bin/ld
symlink, and LDC not using it by default isn't intuitive. And LLD can be significantly faster than gold.