Fail to set LD_LIBRARY_PATH then cross build for ARM

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

I try build simple program for ARM use this instruction

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/ 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


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