Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple linker errors of: PIE object; recompile with -fPIC #109

Open
Soulsbane opened this issue Jul 8, 2018 · 3 comments
Open

Multiple linker errors of: PIE object; recompile with -fPIC #109

Soulsbane opened this issue Jul 8, 2018 · 3 comments

Comments

@Soulsbane
Copy link

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!

`

@rikkimax
Copy link

rikkimax commented Jul 8, 2018 via email

@Soulsbane
Copy link
Author

Thanks! No sadly the same result.

@Soulsbane
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants