February 17, 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@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@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.
February 17, 2017
On Friday, 17 February 2017 at 09:12:36 UTC, kinke wrote:
> 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@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@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.


I am getting the feeling that LDC is not ready for newbies/hobbyists. I am thinking may be I should stick with previous version for now. I guess I can always fall back to C++ if this does not work.


1 2
Next ›   Last »