Compile error with lua lib
rickywu opened this issue · comments
rickywu commented
/usr/bin/ld: //usr/local/lib/liblua.a(lapi.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making
/usr/bin/ld: //usr/local/lib/liblua.a(ldebug.o): relocation R_X86_64_32S against internal symbol `luaP_opmodes' can not be
/usr/bin/ld: //usr/local/lib/liblua.a(ldo.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making
/usr/bin/ld: //usr/local/lib/liblua.a(ldump.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when makin
/usr/bin/ld: //usr/local/lib/liblua.a(lfunc.o): relocation R_X86_64_32 against `.text' can not be used when making a share
/usr/bin/ld: //usr/local/lib/liblua.a(lgc.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shar
/usr/bin/ld: //usr/local/lib/liblua.a(lmem.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making
/usr/bin/ld: //usr/local/lib/liblua.a(lobject.o): relocation R_X86_64_32S against `.rodata' can not be used when making a
/usr/bin/ld: //usr/local/lib/liblua.a(lparser.o): relocation R_X86_64_32S against `.rodata.str1.1' can not be used when ma
/usr/bin/ld: //usr/local/lib/liblua.a(lstate.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when maki
/usr/bin/ld: //usr/local/lib/liblua.a(lstring.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when mak
/usr/bin/ld: //usr/local/lib/liblua.a(ltable.o): relocation R_X86_64_32S against `.rodata' can not be used when making a s
/usr/bin/ld: //usr/local/lib/liblua.a(ltm.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shar
/usr/bin/ld: //usr/local/lib/liblua.a(lundump.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when mak
/usr/bin/ld: //usr/local/lib/liblua.a(lvm.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making
/usr/bin/ld: //usr/local/lib/liblua.a(lauxlib.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when mak
/usr/bin/ld: //usr/local/lib/liblua.a(linit.o): relocation R_X86_64_32 against symbol `luaopen_base' can not be used when
/usr/bin/ld: //usr/local/lib/liblua.a(lcode.o): relocation R_X86_64_32S against `.rodata.str1.1' can not be used when maki
/usr/bin/ld: //usr/local/lib/liblua.a(llex.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making
/usr/bin/ld: //usr/local/lib/liblua.a(lbaselib.o): relocation R_X86_64_32 against `.text' can not be used when making a sh
/usr/bin/ld: //usr/local/lib/liblua.a(lcorolib.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when ma
/usr/bin/ld: //usr/local/lib/liblua.a(ldblib.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when maki
/usr/bin/ld: //usr/local/lib/liblua.a(liolib.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when maki
/usr/bin/ld: //usr/local/lib/liblua.a(lmathlib.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when ma
/usr/bin/ld: //usr/local/lib/liblua.a(loadlib.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when mak
/usr/bin/ld: //usr/local/lib/liblua.a(loslib.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when maki
/usr/bin/ld: //usr/local/lib/liblua.a(lstrlib.o): relocation R_X86_64_32 against `.rodata.str1.8' can not be used when mak
/usr/bin/ld: //usr/local/lib/liblua.a(ltablib.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when mak
/usr/bin/ld: //usr/local/lib/liblua.a(lutf8lib.o): relocation R_X86_64_32S against `.rodata' can not be used when making a
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make: *** [vis] Error 1
I installed lua 5.3.0 or 5.4.1 got the same error, lua is installed by compile source
Marc André Tanner commented
This is because the vis build system by default tries to create a position independent executable, but your static Lua library is not compiled position independently.
Either remove the -pie
flag from vis' config.mk
or preferably build the Lua library position independently by adding the appropriate flags.
rickywu commented
use 'make MYCFLAGS="-fPIC" linux' to build lua