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 09:23:00 PDT 2017


On Tuesday, 1 August 2017 at 14:39:27 UTC, Oleg B wrote:
>> Is possible to set -L flag through ldc2 arguments?
>
> -L-L flag can add library path
>
>   ldc2 -v -L-L/home/deviator/Documents/ldc_build_arm/lib 
> -mtriple=arm-linux-gnueabihf 
> -gcc=/usr/bin/arm-linux-gnueabihf-gcc test.d
>
> but it's fails too
>
> /usr/bin/arm-linux-gnueabihf-gcc test.o -o test -L/usr/lib64 
> -L/home/deviator/Documents/ldc_build_arm/lib -lphobos2-ldc 
> -ldruntime-ldc -Wl,--gc-sections -lrt -ldl -lpthread -lm
> /usr/lib64/libphobos2-ldc.so: file not recognized: File format 
> not recognized
> collect2: error: ld returned 1 exit status
> Error: /usr/bin/arm-linux-gnueabihf-gcc failed with status: 1
>
> only if remove default -L/usr/lib64 it's work

Could you explain your build environment a bit: you're 
cross-compiling from linux/x64 to linux/armhf?  Using the old 
compiler built from source as on that wiki page, or by using the 
official pre-built release build of ldc?  The former shouldn't 
add /usr/lib64 to your linker path.  Maybe you mean to run the 
former but are running the latter by mistake.


More information about the digitalmars-d-ldc mailing list