Multiple linker errors of: PIE object; recompile with -fPIC
Soulsbane opened this issue · 3 comments
Multiple linking errors with dmd 2.081. Linker errors are beyond me but is there an easy fix to this.
Errors:
/usr/bin/ld: ../../../.dub/packages/luad-master/luad/extlib/x86_64-linux-gnu/liblua.a(lapi.o): relocation R_X86_64_32 against hidden symbol
luaO_nilobject_' can not be used when making a PIE object
/usr/bin/ld: ../../../.dub/packages/luad-master/luad/extlib/x86_64-linux-gnu/liblua.a(ldebug.o): relocation R_X86_64_32S against hidden symbol luaP_opmodes' can not be used when making a PIE object /usr/bin/ld: ../../../.dub/packages/luad-master/luad/extlib/x86_64-linux-gnu/liblua.a(ldo.o): relocation R_X86_64_32 against
.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../../.dub/packages/luad-master/luad/extlib/x86_64-linux-gnu/liblua.a(lgc.o): relocation R_X86_64_32S against .rodata' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../.dub/packages/luad-master/luad/extlib/x86_64-linux-gnu/liblua.a(lmem.o): relocation R_X86_64_32 against
.rodata.str1.8' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../../.dub/packages/luad-master/luad/extlib/x86_64-linux-gnu/liblua.a(lobject.o): relocation R_X86_64_32S against .rodata' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../.dub/packages/luad-master/luad/extlib/x86_64-linux-gnu/liblua.a(lparser.o): relocation R_X86_64_32 against
.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../../.dub/packages/luad-master/luad/extlib/x86_64-linux-gnu/liblua.a(lstate.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../.dub/packages/luad-master/luad/extlib/x86_64-linux-gnu/liblua.a(ltable.o): relocation R_X86_64_32S against
.rodata' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../../.dub/packages/luad-master/luad/extlib/x86_64-linux-gnu/liblua.a(ltm.o): relocation R_X86_64_32S against .rodata' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../.dub/packages/luad-master/luad/extlib/x86_64-linux-gnu/liblua.a(lundump.o): relocation R_X86_64_32 against
.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../../.dub/packages/luad-master/luad/extlib/x86_64-linux-gnu/liblua.a(lvm.o): relocation R_X86_64_32S against .rodata' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../../.dub/packages/luad-master/luad/extlib/x86_64-linux-gnu/liblua.a(lauxlib.o): relocation R_X86_64_32 against
.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../../.dub/packages/luad-master/luad/extlib/x86_64-linux-gnu/liblua.a(lcode.o): relocation R_X86_64_32S against hidden symbol luaP_opmodes' can not be used when making a PIE object /usr/bin/ld: ../../../.dub/packages/luad-master/luad/extlib/x86_64-linux-gnu/liblua.a(llex.o): relocation R_X86_64_32S against hidden symbol
luaX_tokens' can not be used when making a PIE object
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Error: linker exited with status 1`
Thanks!
`
Thanks! No sadly the same result.
May have found a fix! Removing these lines from dub.json:
"sourceFiles-linux-x86": ["extlib/x86_32-linux-gnu/liblua.a"], "sourceFiles-linux-x86_64": ["extlib/x86_64-linux-gnu/liblua.a"],
Everything compiles fine then. There is also a line for windows but I didn't test it with it removed.