Windows --> arm-linux cross compiler and lld

Jacob Carlborg doob at me.com
Mon Apr 9 06:49:02 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.

You can specify `-link-internally`, which at least works when not 
cross-compiling on Windows. There's also the `-linker` flag which 
allows you to specify which linker to use, but it still invokes 
GCC. You can use the `CC` environment variable to override the C 
compiler that is invoked for linking.

> Does LDC still have a hard dependency on GCC for linking?
>
> I suppose even without GCC, itself, LDC would still need the 
> libraries that GCC pulls in automatically (libc, etc.).  Is 
> there any plan to remove the dependency on the GNU toolchain 
> altogether sometime in the future?  Does LLVM have its own 
> implementations of libc or whatever else LDC requires from the 
> GNU toolchain?

LLVM contains replacements for most of the GNU toolchain, 
although it does not have its own implementation of libc. musl 
can be used as a replacement but only on Linux.

--
/Jacob Carlborg


More information about the digitalmars-d-ldc mailing list