-fPIC related error compiling hello_world.d with dmd

rikki cattermole via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Nov 18 06:10:43 PST 2016


On 19/11/2016 3:05 AM, Alessandro wrote:
> On Friday, 18 November 2016 at 13:12:14 UTC, rikki cattermole wrote:
>> On 19/11/2016 2:09 AM, Alessandro wrote:
>>> Hi everyone,
>>> I'm almost ashamed to ask help on this...
>>> I used dmd/dub on an arch linux machine for some time in the past
>>> without any problem.
>>> Now I'm experiencing a strange problem after switching to a debian
>>> jessie (testing) machine when compiling even the simplest hello_world
>>> application :( !!
>>> After successfully compiling the source file, I get hundreds of linker
>>> error messages of the form:
>>>
>>> /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libphobos2.a(aaA_52e_53e.o):
>>> relocation R_X86_64_32 against symbol `__dmd_personality_v0' can not be
>>> used when making a shared object; recompile with -fPIC
>>>
>>> It looks like the linker cannot link together phobos library modules
>>> into the final binary or something like that.
>>> I'm using the official package dmd_2.072.0-0_amd64.deb from dlang
>>> website, but also the package in debian repositories (version 2.071.2)
>>> does the same.
>>> Any idea what the problem might be?
>>
>> Yup lots of posts about this problem lately.
>> Here's my answer to an identical question[0].
>>
>> [0] http://forum.dlang.org/post/nvekf6$1pvb$1@digitalmars.com
>
> Thank you for your support Rikki!
> Indeed, modifying dmd.conf as you suggested solved the problem.
> Sorry for duplicating posts on this: I searched for fPIC problems
> beforehand but somehow didn't find that previous post.
> Is this problem affecting debian users only? Or maybe just those using
> testing?
> Would it be an option to modify the configuration of the official .deb
> package accordingly?
> Thank you again!

No problem, its Ubuntu/Debian has moved over to a hardened mode fairly 
recently and we haven't updated to match it yet.



More information about the Digitalmars-d-learn mailing list