digitalmars.D - lld status
- Andrei Alexandrescu (5/5) Dec 21 2017 I only became aware today about https://lld.llvm.org, llvm's own linker....
- David Nadlinger (14/17) Dec 21 2017 Internal linking is currently enabled by a separate command-line
- kinke (19/22) Dec 21 2017 Currently only for Windows-MSVC targets (both 32 and 64 bits) and
- Atila Neves (8/13) Dec 21 2017 I tried lld on Linux for D binaries and some of them crash. That
- Jacob Carlborg (5/10) Dec 22 2017 I tried to use lld to cross compile to macOS on Linux. It crashed on the...
- Paolo Invernizzi (4/13) Dec 22 2017 It worked for me the other way round, to Linux on macOS, and
I only became aware today about https://lld.llvm.org, llvm's own linker. I wonder how that changes distribution dynamics for us - I heard ldc already uses its embedded variant for linking programs (on Widows? Posix? 32bit? 64bit?). Can we distribute it as an alternative to optlink? Thanks! -- Andrei
Dec 21 2017
On Thursday, 21 December 2017 at 18:40:54 UTC, Andrei Alexandrescu wrote:I heard ldc already uses its embedded variant for linking programs (on Widows? Posix? 32bit? 64bit?)Internal linking is currently enabled by a separate command-line flag; we still use the system linker by default (just as a precaution to avoid needless breakage because of a new feature). lld works for COFF, ELF as well as Mach-O. For the latter, there is the problem of locating the appropriate C runtime libraries to consider, though (those that the `gcc` linker driver implicitly passes to the underlying `ld`).Can we distribute it as an alternative to optlink?Yes, that should work. As far as I know, it doesn't support OMF, though, so we would need to find COFF C/system libraries we can redistribute - it is unclear whether Microsoft's license allows redistribution of their static libraries. - David
Dec 21 2017
On Thursday, 21 December 2017 at 18:40:54 UTC, Andrei Alexandrescu wrote:I heard ldc already uses its embedded variant for linking programs (on Widows? Posix? 32bit? 64bit?).Currently only for Windows-MSVC targets (both 32 and 64 bits) and only when specifying the `-link-internally` switch. The host platform doesn't matter, i.e., it works for cross-linking from any Posix system too, even on ARM etc. ['Embedded variant' => we're linking in the static LLD libs and so share the common LLVM code in a single executable.]Can we distribute it as an alternative to optlink?Now that it's capable of outputting debuginfo .pdb's too (since v5.0, at least on Windows hosts), it should basically be fine. There's one catch though, and that's the rather big size of the executable (26 MB for the v5.0.1 32-bit executable when linked against the static MS runtime with VS 2017, with enabled LLVM backends for x86[_64], ARM, AArch64 and Nvidia PTX). That's due to LLD being a cross-linker by default, capable of outputting Windows, ELF and Mach-O binaries, and because of included codegen capabilities (for Link-Time Optimization), i.e., stuff that DMD doesn't need. Unfortunately, those features cannot be simply opted-out via CMake.
Dec 21 2017
On Thursday, 21 December 2017 at 18:40:54 UTC, Andrei Alexandrescu wrote:I only became aware today about https://lld.llvm.org, llvm's own linker. I wonder how that changes distribution dynamics for us - I heard ldc already uses its embedded variant for linking programs (on Widows? Posix? 32bit? 64bit?). Can we distribute it as an alternative to optlink? Thanks! -- AndreiI tried lld on Linux for D binaries and some of them crash. That might not mean anything on Windows, but given that I've run into 2 dmd bugs so far in which picking one of ld.bfd or ld.gold produced crashing binaries, I'd be wary of using lld on Windows until it's thoroughly tested on dozens of executables. Atila
Dec 21 2017
On 2017-12-22 00:11, Atila Neves wrote:I tried lld on Linux for D binaries and some of them crash. That might not mean anything on Windows, but given that I've run into 2 dmd bugs so far in which picking one of ld.bfd or ld.gold produced crashing binaries, I'd be wary of using lld on Windows until it's thoroughly tested on dozens of executables.I tried to use lld to cross compile to macOS on Linux. It crashed on the first try, might even have been a C program. -- /Jacob Carlborg
Dec 22 2017
On Friday, 22 December 2017 at 09:46:40 UTC, Jacob Carlborg wrote:On 2017-12-22 00:11, Atila Neves wrote:It worked for me the other way round, to Linux on macOS, and worked also to Win64 on macOS. /PaoloI tried lld on Linux for D binaries and some of them crash. That might not mean anything on Windows, but given that I've run into 2 dmd bugs so far in which picking one of ld.bfd or ld.gold produced crashing binaries, I'd be wary of using lld on Windows until it's thoroughly tested on dozens of executables.I tried to use lld to cross compile to macOS on Linux. It crashed on the first try, might even have been a C program.
Dec 22 2017