Windows --> arm-linux cross compiler and lld

Joakim dlang at joakim.fea.st
Tue Apr 17 06:53:59 UTC 2018


On Friday, 13 April 2018 at 03:56:24 UTC, Joakim wrote:
> On Wednesday, 11 April 2018 at 00:39:23 UTC, Mike Franklin 
> wrote:
>> How does clang know how to generate its linker command?
>
> I don't think it does, it's probably hard-coded based on the 
> target, though you can usually override various elements with 
> flags. Since every target has its own selection of flags and 
> object files it needs, we delegate linking to the C 
> (cross-)compiler for that target.
>
> You can always choose your own linker for ldc with the -linker= 
> flag and do everything manually if you want though.
>
>> Whatever it is, can ldc be made do the same?
>
> Yes, but it would be an impossible task to do it for any 
> non-trivial set of platforms. It's _much_ easier to free-ride 
> off the C compiler which has already been configured for the 
> target.

Btw, you may be interested in this thread about using the llvm 
linker, lld, which delves into a lot of the issues involved with 
not delegating to the C compiler:

https://github.com/ldc-developers/ldc/issues/2028


More information about the digitalmars-d-ldc mailing list