DMD Fails with fPIC error

Reuben via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jun 13 18:58:39 PDT 2014


Hi,
I'm new to D and am trying to compile a simple hello world 
program.
I get the following error when compiling it:

> dmd test.d
/usr/lib/gcc/x86_64-pc-linux-gnu/4.7.3/../../../../x86_64-pc-linux-gnu/bin/ld: 
/opt/dmd-2.065/lib64/libphobos2.a(lifetime_488_4cd.o): relocation 
R_X86_64_32 against `_D15TypeInfo_Shared7__ClassZ' can not be 
used when making a shared object; recompile with -fPIC
/opt/dmd-2.065/lib64/libphobos2.a: could not read symbols: Bad 
value
collect2: error: ld returned 1 exit status
--- errorlevel 1

This error occurs regardless of whether I use the -fPIC option or 
not.
Compiling DMD from source does not change anything.

I am using DMD 2.065.0 on Sabayon amd64, compiled from the dlang 
overlay with gcc (Gentoo Hardened 4.7.3-r1 p1.4, pie-0.5.5) 4.7.3.

Thanks in advance.


More information about the Digitalmars-d-learn mailing list