[Issue 5278] gentoo's 'hardended' gcc doesn't work with dmd

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 20 19:32:45 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=5278



--- Comment #21 from Chad Joan <chadjoan at gmail.com> 2012-01-20 19:32:30 PST ---
(In reply to comment #20)
> The core issue is that your gcc is linking PIE by default but
> PIC support for dmd still has some bug and probably would need
> more that -fPIC to support PIE. Currently you should pass
> -fno-pie to gcc for linking.
> 
> Please help to find out why --export-dynamic is involved.
> Does it trigger alter the PIE behavior?

How do I find this out?

> What's the backtrace of your segfault core dumps?

Also, how do I find this out?
Running the program just makes it print "Segmentation fault"; there is no
backtrace for me to copy.  Maybe I am missing something (where would I find a
core dump for this?).

> Please list any linker warnings you get
> (-Wl,--verbose for gcc or -L--verbose for dmd).

Stock DMD v2.057
64-bit:
chad at Hugin /mnt/bulk/dprojects/helloD2 $ which dmd
/usr/local/share/dcompilers/dmd/linux/bin64/dmd

chad at Hugin /mnt/bulk/dprojects/helloD2 $ cat main.d
import std.stdio;

void main()
{
        writefln("hello world!");
}

Without -m32 it isn't able to compile my program:
http://pastebin.com/GqP5JC3z

With -m32 it does, but segfaults:
http://pastebin.com/hd5zEtD2

32-bit dmd:
chad at Hugin /mnt/bulk/dprojects/helloD2 $ which dmd
/usr/local/share/dcompilers/dmd/linux/bin32/dmd

Segfaults:
http://pastebin.com/d7miSKtH

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list