strange -fPIC compilation error

Charles Hixson via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Oct 30 16:51:57 PDT 2016


Just as a test I tried it with ldc, and, as expected, there wasn't any 
problem.


On 10/30/2016 11:02 AM, Charles Hixson via Digitalmars-d-learn wrote:
>  dmd --version
> DMD64 D Compiler v2.071.2
> Copyright (c) 1999-2015 by Digital Mars written by Walter Bright
> on debian testing.
>
> dub is installed via apt-get.
>
> Should I revert to an earlier version?  Or what?
>
> The program:
>
>
> import    std.stdio;
>
> void    main()
> {    //int[]    t1;
>
>     //t1    ~=    1;
>     //t1    ~=    2;
>     //writeln ("t1 = ", t1);
> }
>
> fails with the 442 lines of error:
>
> /usr/bin/ld: test.o: relocation R_X86_64_32 against symbol 
> `__dmd_personality_v0' can not be used when making a shared object; 
> recompile with -fPIC
> /usr/bin/ld: 
> /usr/lib/x86_64-linux-gnu/libphobos2.a(exception_224_3b4.o): 
> relocation R_X86_64_32 against symbol `__dmd_personality_v0' can not 
> be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: 
> /usr/lib/x86_64-linux-gnu/libphobos2.a(exception_227_4a2.o): 
> relocation R_X86_64_32 against symbol `__dmd_personality_v0' can not 
> be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: 
> /usr/lib/x86_64-linux-gnu/libphobos2.a(exception_229_5cc.o): 
> relocation R_X86_64_32 against symbol `__dmd_personality_v0' can not 
> be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libphobos2.a(dmain2_626_47b.o): 
> relocation R_X86_64_32 against symbol `_D6object9Throwable7__ClassZ' 
> can not be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libphobos2.a(dmain2_628_776.o): 
> relocation R_X86_64_32 against symbol `__dmd_personality_v0' can not 
> be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: 
> /usr/lib/x86_64-linux-gnu/libphobos2.a(dwarfeh_62b_6b9.o): relocation 
> R_X86_64_32 against symbol `__dmd_personality_v0' can not be used when 
> making a shared object; recompile with -fPIC
> ...
>
> /usr/bin/ld: /usr/lib/x86_64-linux-gnu/libphobos2.a(aaA_51a_53e.o): 
> relocation R_X86_64_32 against symbol `__dmd_personality_v0' can not 
> be used when making a shared object; recompile with -fPIC
> /usr/bin/ld: final link failed: Nonrepresentable section on output
> collect2: error: ld returned 1 exit status
> --- errorlevel 1
>
>



More information about the Digitalmars-d-learn mailing list