Cross compiling from windows targetting linux armel arm9

kinke via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Fri Feb 17 01:12:36 PST 2017


On Friday, 17 February 2017 at 02:10:41 UTC, Sai wrote:
> On Thursday, 16 February 2017 at 17:47:28 UTC, kinke wrote:
>> On Thursday, 16 February 2017 at 16:57:56 UTC, Sai wrote:
>>> Any help is appreciated.
>>> Testing on Ubuntu 16.10 with all updates installed.
>>
>> -relocation-model=pic ?
>
>
> I tried that too, but no luck :-(
>
> sai at saivb:~/tmp$ ldc2 -relocation-model=pic t.d
> /usr/bin/ld: 
> /home/sai/Programs/ldc2-1.1.0-linux-x86_64/bin/../lib/libdruntime-ldc.a(errno.c.o): relocation R_X86_64_PC32 against symbol `__errno_location@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: final link failed: Bad value
> collect2: error: ld returned 1 exit status
> Error: /usr/bin/gcc failed with status: 1
>
>
> BTW:
>
> sai at saivb:~/tmp$ cat t.d
> import std.stdio;
>
> int main(string[] args) {
> 	writefln("Hello world!");
> 	return 0;
> }

Your linker complains about druntime not having been compiled 
with `-relocation-model=pic`. If PIC is mandatory for Ubuntu 
16.10, even for executables and not just shared objects, then 
you'd need to recompile druntime/Phobos yourself. But I'd first 
look into your command-line flags/config file, as the error 
message is rather strange, you probably want an executable and 
not a DLL.


More information about the digitalmars-d-ldc mailing list