dmd.conf's -L--export-dynamic prevents my compiler from working

Martin Nowak dawg at dawgfoto.de
Sun Dec 18 11:34:04 PST 2011


On Sun, 18 Dec 2011 16:54:39 +0100, Chad J  
<chadjoan at __spam.is.bad__gmail.com> wrote:

> Speaking of issues that will frustrate newcomers... having dmd generate
> executables that segfault would be particularly /bad/.
>
> I refer to my post 19 on this bug:
> http://d.puremagic.com/issues/show_bug.cgi?id=5278
> (which is the most recent as of this writing.)
>
> Stock DMD hasn't worked on my system for... let's see... a little over a
> year now.
>
> I just can't compile things with D unless I go through some strange
> contortions.
>
> The problem was introduced when -L--export-dynamic was placed in  
> dmd.conf.
>
> Unless there is an important reason for -L--export-dynamic to be there,
> could we please remove it?  It makes my (usually awesome) D experience,
> uh, suck!
> (From my perspective it was unceremoniously added and then made my
> compiler just spontaneously not work at all anymore.  Bad bad bad!)

Apparently you build shared executables with you gentoo setup.
I'd guess that you need to compile your dmd executables with -fPIC for
this to work properly.
There are some relocation bugs with dmd's PIC code though. I'm working on  
shared library
support for Elf, so most of them are fixed here  
https://github.com/dawgfoto/dmd/commits/SharedElf.

Not sure why you can sometimes compile working programs but maybe  
--export-dynamic
triggers shared executables.

http://www.gentoo.org/proj/en/hardened/pie-ssp.xml


More information about the Digitalmars-d mailing list