Fail to set LD_LIBRARY_PATH then cross build for ARM

Oleg B via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Tue Aug 1 06:22:41 PDT 2017


I try build simple program for ARM use this instruction 
https://wiki.dlang.org/LDC_cross-compilation_for_ARM_GNU/Linux#Build_a_command-line_executable

In my system it's looks like this:

   ldc2 -v -mtriple=arm-linux-gnueabihf 
-gcc=/usr/bin/arm-linux-gnueabihf-gcc test.d

Building fails because ldc2 use /usr/lib64 as library path and I 
get this message:

   /usr/bin/arm-linux-gnueabihf-gcc test.o -o test -L/usr/lib64 
-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

If I copy first line and replace -L flag to ldc2's arm building 
dir (I build ldc2 on arm) like this

   -L/home/deviator/Documents/ldc_build_arm/lib

gcc use this path and build and link my program!

I try to set LD_LIBRARY_PATH variable but it's have no effect.
Is possible to set -L flag through ldc2 arguments?


More information about the digitalmars-d-ldc mailing list