Cross compiling from windows targetting linux armel arm9

Sai via digitalmars-d-ldc digitalmars-d-ldc at
Sat Dec 24 17:25:12 PST 2016

On Monday, 12 December 2016 at 22:54:43 UTC, kinke wrote:
> On Monday, 12 December 2016 at 16:57:36 UTC, Sai wrote:
>> Don't know if I can/want to build druntime now, I also don't 
>> have visual studio, etc.
> Visual Studio is exactly what you don't need, since you don't 
> target Windows. You need a linker (in your case most likely a 
> Windows executable) able to target your ARM platform, and the 
> libs. A matching GCC+binutils cross-compilation package 
> ( maybe) should work.
> You can then cross-compile the druntime objects and archive 
> them manually to a static lib if need be.

I finally managed to install virtualbox and lubuntu.
Now I get the following errors. Please help?

$ cat t.d
import std.stdio;

int main(string[] args) {
	writefln("Hello world!");
	return 0;

$ ldc2 t.d
/usr/bin/ld: t.o: relocation R_X86_64_32 against `.rodata.str1.1' 
can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Error: /usr/bin/gcc failed with status: 1

$ gdc t.d
/usr/include/d/core/stdc/stdarg.d:48:23: error: undefined 
identifier '__va_list_tag'
      alias __va_list = __va_list_tag;

$ ldc2 -no-pie t.d
ldc2: Unknown command line argument '-no-pie'.  Try: 'ldc2 -help'
ldc2: Did you mean '-noasm'?

$ gdc  -no-pie t.d
/usr/include/d/core/stdc/stdarg.d:48:23: error: undefined 
identifier '__va_list_tag'
      alias __va_list = __va_list_tag;

More information about the digitalmars-d-ldc mailing list