Windows --> arm-linux cross compiler and lld
kinke
kinke at libero.it
Mon Apr 9 09:53:31 UTC 2018
On Monday, 9 April 2018 at 01:04:51 UTC, Mike Franklin wrote:
> I'm exploring the idea of creating an LDC Windows (host) to
> arm-linux-gnueabihf (target) cross-compiler. However, it
> appears LDC still expects GCC to be present for linking, even
> on Windows.
>
> Does LDC still have a hard dependency on GCC for linking?
For non-Windows targets, we expect a gcc-compatible linker
driver, i.e., gcc or clang, and as Jacob pointed out, you can
choose between them via CC env variable (and a hidden -gcc option
IIRC).
A while ago, I integrated LLD into LDC itself. It's currently
only able to link MSVC binaries, so `-link-internally` only works
for MSVC targets.
There's a PR in which I extended it to ELF and Mach-O targets
too; it seems to be working after a quick test (if you have the
required libs obviously), but the needed linker flags normally
added by gcc makes the command-line explode:
https://github.com/ldc-developers/ldc/pull/2203#issuecomment-339167131
The command-line flags could be added once to the config file
though if your environment is stable.
> I suppose I could copy the necessary .a/.o/.so files to the
> Windows host
Yep, that's what I'd do.
More information about the digitalmars-d-ldc
mailing list