[Issue 5278] DMD generates programs that immediately segfault.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Dec 18 08:30:41 PST 2010


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



--- Comment #10 from Chad Joan <chadjoan at gmail.com> 2010-12-18 08:28:45 PST ---
So I thought it'd be wise to try it with both the working compiler version and
the not working compiler version and see what changed in the linker string.
Here it is:

chad at Hugin /mnt/sharedhd/dprojects/dtesting $ dmd trivial.d -L-v 2>
dmd2048.link
GNU ld (GNU Binutils) 2.20.1.20100303
chad at Hugin /mnt/sharedhd/dprojects/dtesting $ dmd trivial.d -L-v 2>
dmd2050.link
GNU ld (GNU Binutils) 2.20.1.20100303
chad at Hugin /mnt/sharedhd/dprojects/dtesting $ diff dmd2048.link dmd2050.link 
2c2
< /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/bin/ld
--eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -pie -z now -o
trivial /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib32/Scrt1.o
/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib32/crti.o
/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/crtbeginS.o
-L/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/32
-L/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/32
-L/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib32 -L/lib/../lib32
-L/usr/lib/../lib32 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2
-L/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2
-L/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/lib
-L/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../.. trivial.o -v
-L/usr/local/share/dcompilers/dmd/linux/bin/../lib -lphobos2 -lpthread -lm
-lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s
--no-as-needed /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/crtendS.o
/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib32/crtn.o
---
> /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/bin/ld --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -pie -z now -o trivial /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib32/Scrt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib32/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/crtbeginS.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/32 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/32 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib32 -L/lib/../lib32 -L/usr/lib/../lib32 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../.. trivial.o -v -L/usr/local/share/dcompilers/dmd/linux/bin/../lib --export-dynamic -lphobos2 -lpthread -lm -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/32/crtendS.o /usr/lib/gcc/x86_64-pc-linux-gnu/4.3.2/../../../../lib32/crtn.o


Note the that --export-dynamic is only present in the one that segfaults.  
I'm in a bit of a rush at the moment and I don't remember how to mess with
--export-dynamic, so that's all for now.

-- 
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