Fail to set LD_LIBRARY_PATH then cross build for ARM

kinke via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Thu Aug 3 05:26:32 PDT 2017


On Wednesday, 2 August 2017 at 21:39:00 UTC, Oleg B wrote:
> But I don't understand how it use through dub. Dub don't know 
> about any arch expect x86(_64). If add dflags "-march=arm" or 
> something like this in dub.sdl it applies only for building 
> package, not for dependencies. Building without dub is some 
> painful for me and it's not useful to change .ldc/ldc2.conf 
> when need arm and when need x86... Maybe I do something wrong?

The currently intended way is to augment your LDC config file on 
a per-triple basis. See step 4 in 
https://github.com/ldc-developers/ldc/pull/2142#issuecomment-304472412. Use `ldc2 -mtriple=... -v` to check the real triple (displayed in the config line), in your case probably `arm--linux-gnueabihf`, and add a config file section for it, by copying the default section and tweaking the lib directories. Specifying a compatible `-mtriple` in the LDC command line is then enough.
I don't use dub, so I don't know what's missing for full 
cross-compilation support.

> I'm looking forward to full cross-building. It's plained? Or 
> always be need external cross-linker?

It's already built-in for Windows MSVC targets since LDC v1.3 
(`-link-internally` switch). I opened a PR to integrate LLD for 
ELF and Mach-O targets as well: 
https://github.com/ldc-developers/ldc/pull/2203. It's completely 
untested, so guys like you experimenting with it are very 
welcome. Needs LLVM >= 5.0 incl. LLD.


More information about the digitalmars-d-ldc mailing list