Open dlblv opened 6 years ago
-link-internally
is still somewhat experimental (no LTO, LLD compatibility issues with Apple's ld64
), and is only available if the LLD libs are available when building LDC, which apparently wasn't the case when building the ArchLinux package (please file an issue there if that bothers you, we don't maintain distro packages ourselves). The official prebuilt release package features it.
Additionally, the C system libs etc. are still needed as linker input, so if you don't go through gcc, you have to specify them manually; see the PR linked in the release notes. Edit: this doesn't apply to Windows/MSVC, where it's working fine without additional linker flags as long as you have a MSVC installation.
Wrt. to your extended post now:
--no-warn-search-mismatch
, that's in the etc/ldc2.conf
config file. Too bad LLD doesn't support it; that's a further ld
incompatibility preventing a drop-in replacement. You can remove that flag, but will probably also have to specify a single libs dir then in the config file (not both lib
and lib32
dirs), and won't be able to link both 32- and 64-bit binaries (easily) anymore.FYI, using LLD works with a betterC Hello World program on macOS without any additional flags, see the bottom of this post https://github.com/ldc-developers/ldc/issues/2662#issuecomment-383698114,
Also see recent forum thread and issue #2028, the upshot being that it would be almost impossible for us to support the crazy variety of linux distros and alternate toolchains, so we offload that work to the specially-configured C compilers.
We could in theory still provide a script/command line flag to extract the linker flags from gcc -v and store them to our config file to later be used.
I see the main usage of -link-internally
for cross-linking (at least for Posix), so manual tweaking will most likely be required in those cases anyway. I fail to see a reason to use it for normal linking on Posix, at least as long as LTO doesn't work that way.
Archlinux, ldc 1.9.0, using DUB 1.9.0 to build projects.
Why does LDC 1.9.0 still use GCC? How can I switch it to use LLVM stack only (under both Linux and Windows)?
On version 1.10.0 beta1 strange thing occurs:
or