Problems compiling 2.2.8 on CENTOS 7

I have installed lua-5.3.5 from source in /opt/lua-5.3.5. Previously I was able to compile haproxy 2.0.15 with this config, but 2.2.8 is giving me the following errors:
LD haproxy
/bin/ld: /opt/lua-5.3.5/lib/liblua.a(lapi.o): relocation R_X86_64_32 against hidden symbol luaO_nilobject_' can not be used when making a shared object /bin/ld: /opt/lua-5.3.5/lib/liblua.a(ldebug.o): relocation R_X86_64_32 against .rodata.str1.1’ can not be used when making a shared object; recompile with -fPIC
/bin/ld: /opt/lua-5.3.5/lib/liblua.a(ldo.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /bin/ld: /opt/lua-5.3.5/lib/liblua.a(ldump.o): relocation R_X86_64_32S against .rodata’ can not be used when making a shared object; recompile with -fPIC
/bin/ld: /opt/lua-5.3.5/lib/liblua.a(lgc.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /bin/ld: /opt/lua-5.3.5/lib/liblua.a(lmem.o): relocation R_X86_64_32 against .rodata.str1.8’ can not be used when making a shared object; recompile with -fPIC
/bin/ld: /opt/lua-5.3.5/lib/liblua.a(lobject.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /bin/ld: /opt/lua-5.3.5/lib/liblua.a(lparser.o): relocation R_X86_64_32 against .rodata.str1.1’ can not be used when making a shared object; recompile with -fPIC
/bin/ld: /opt/lua-5.3.5/lib/liblua.a(lstate.o): relocation R_X86_64_32S against hidden symbol luaO_nilobject_' can not be used when making a shared object /bin/ld: /opt/lua-5.3.5/lib/liblua.a(lstring.o): relocation R_X86_64_32 against .rodata.str1.1’ can not be used when making a shared object; recompile with -fPIC
/bin/ld: /opt/lua-5.3.5/lib/liblua.a(ltable.o): relocation R_X86_64_32S against .rodata' can not be used when making a shared object; recompile with -fPIC /bin/ld: /opt/lua-5.3.5/lib/liblua.a(ltm.o): relocation R_X86_64_32S against .rodata’ can not be used when making a shared object; recompile with -fPIC
/bin/ld: /opt/lua-5.3.5/lib/liblua.a(lundump.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /bin/ld: /opt/lua-5.3.5/lib/liblua.a(lvm.o): relocation R_X86_64_32 against .rodata.str1.1’ can not be used when making a shared object; recompile with -fPIC
/bin/ld: /opt/lua-5.3.5/lib/liblua.a(lauxlib.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /bin/ld: /opt/lua-5.3.5/lib/liblua.a(linit.o): relocation R_X86_64_32 against symbol luaopen_base’ can not be used when making a shared object; recompile with -fPIC
/bin/ld: /opt/lua-5.3.5/lib/liblua.a(lcode.o): relocation R_X86_64_32S against hidden symbol luaP_opmodes' can not be used when making a shared object /bin/ld: /opt/lua-5.3.5/lib/liblua.a(llex.o): relocation R_X86_64_32 against .rodata.str1.1’ can not be used when making a shared object; recompile with -fPIC
/bin/ld: /opt/lua-5.3.5/lib/liblua.a(lbaselib.o): relocation R_X86_64_32 against .text' can not be used when making a shared object; recompile with -fPIC /bin/ld: /opt/lua-5.3.5/lib/liblua.a(lbitlib.o): relocation R_X86_64_32 against .rodata.str1.8’ can not be used when making a shared object; recompile with -fPIC
/bin/ld: /opt/lua-5.3.5/lib/liblua.a(lcorolib.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /bin/ld: /opt/lua-5.3.5/lib/liblua.a(ldblib.o): relocation R_X86_64_32 against .rodata.str1.1’ can not be used when making a shared object; recompile with -fPIC
/bin/ld: /opt/lua-5.3.5/lib/liblua.a(liolib.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /bin/ld: /opt/lua-5.3.5/lib/liblua.a(lmathlib.o): relocation R_X86_64_32 against .rodata.str1.1’ can not be used when making a shared object; recompile with -fPIC
/bin/ld: /opt/lua-5.3.5/lib/liblua.a(loslib.o): relocation R_X86_64_32 against .rodata' can not be used when making a shared object; recompile with -fPIC /bin/ld: /opt/lua-5.3.5/lib/liblua.a(lstrlib.o): relocation R_X86_64_32 against .rodata.str1.8’ can not be used when making a shared object; recompile with -fPIC
/bin/ld: /opt/lua-5.3.5/lib/liblua.a(ltablib.o): relocation R_X86_64_32 against .rodata.str1.1' can not be used when making a shared object; recompile with -fPIC /bin/ld: /opt/lua-5.3.5/lib/liblua.a(lutf8lib.o): relocation R_X86_64_32S against .rodata’ can not be used when making a shared object; recompile with -fPIC
/bin/ld: /opt/lua-5.3.5/lib/liblua.a(loadlib.o): relocation R_X86_64_32 against `.rodata.str1.1’ can not be used when making a shared object; recompile with -fPIC
/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status

Build line is:
/usr/bin/make CPU=generic TARGET=linux-glibc USE_LUA=1 USE_OPENSSL=1 USE_PCRE=1 USE_ZLIB=1 USE_CRYPT_H=1 USE_SYSTEMD=1 USE_LINUX_TPROXY=1 USE_GETADDRINFO=1 USE_REGPARM=1 ‘ADDINC=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic’ ‘ADDLIB=-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld’ EXTRA_OBJS=contrib/prometheus-exporter/service-prometheus.o LUA_INC=/opt/lua-5.3.5/include LUA_LIB=/opt/lua-5.3.5/lib

1 Like