Cross compiling linux x86_64 to linux arm

user user at tmp.com
Mon Apr 9 22:30:20 UTC 2018


I created runtime and phobos lib for arm as described here: 
https://wiki.dlang.org/Building_LDC_runtime_libraries

This command ran and created the libs successfully:
CC=arm-linux-gnueabihf-gcc ldc-build-runtime --ninja 
--dFlags="-w;-mtriple=arm-linux-gnueabihf" 
--targetSystem="Linux;UNIX"


Now I am confused how to use these files to cross compile my 
application. I tried:

ldc2 -mtriple=arm-linux-gnueabihf lib/libdruntime-ldc.a 
lib/libphobos2-ldc.a app.d

/usr/bin/ld: app.o: Relocations in generic ELF (EM: 40)
       (above line repeated several times)
/usr/bin/ld: app.o: Relocations in generic ELF (EM: 40)
app.o: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
Error: /usr/bin/gcc failed with status: 1

It failed with above error, any help is appreciated.




More information about the digitalmars-d-ldc mailing list