Fail to set LD_LIBRARY_PATH then cross build for ARM
Joakim via digitalmars-d-ldc
digitalmars-d-ldc at puremagic.com
Tue Aug 1 20:28:48 PDT 2017
On Wednesday, 2 August 2017 at 00:46:01 UTC, Oleg B wrote:
> On Tuesday, 1 August 2017 at 20:18:43 UTC, Joakim wrote:
>> It is not clear what you're trying to do. You want to use the
>> ldc 1.3 compiler on linux/x64 to cross-compile to linux/armhf?
>
> Yes.
>
>> To do this, you are building the ldc 1.4 libraries natively on
>> linux/armhf, then copying them over to linux/x64 and trying to
>> use them with ldc 1.3?
>
> Yes, I build master ldc some time ago (before 1.3.0 release)
> and it have version 1.4.0 (it's not master now, I say master
> because it was not a tag and I don't know why developers names
> it 1.4.0) and it's very long time building. Now I only try
> using builded libs. If they did not work, I must be rebuild
> they. But they work! And working druntime and phobos isn't a
> question.
>
>> If you have a working ldc 1.4 on your Raspberry/ARM board, why
>> not just use that?
>
> Because rpi2 have 1GB RAM, building gtk-d need more 1.6 GB RAM.
> For code without gtk-d building is very slow.
>
>> Please detail exactly what you're doing, as you seem to be
>> trying something unusual.
>
> I try build my soft on rpi.
>
> Main question is how to specify dir with ARM version of
> druntime and phobos and remove default dir from call extern gcc
> compiler? Default dir is /usr/lib64 and it contains druntime
> and phobos (x86_64). Additional dir not scans because build
> fails while trying loading existing x86_64 libs.
OK, got it, would have helped a lot if you'd explained all this
from the beginning. I'm guessing you're using ldc 1.3 installed
by your distro's package manager, as I don't see any lib64 in the
ldc download, so your distro packages a ldc2.conf that adds the
lib64 path. You can make sure by looking at /usr/etc/ldc2.conf,
or wherever your distro puts that config file, and looking for
lib64 in there.
You're probably best off creating a .ldc/ldc2.conf in your home
directory, with the specific config you want for linux/armhf.
See this previous post for an example:
http://forum.dlang.org/post/skdqeursuheqdsermmwh@forum.dlang.org
We're working on making it much simpler to cross-compile the
stdlib for the next ldc 1.4 beta, see kinke's latest patch here:
https://github.com/ldc-developers/ldc/pull/2253
I'm not sure how well your approach will work, as the ldc 1.4
stdlib may not work with ldc 1.3. I'll be submitting a PR soon
that should make it even easier, so you may want to wait for the
next 1.4 beta instead.
More information about the digitalmars-d-ldc
mailing list