Liblua error: relocation R_X86_64_32 against `luaO_nilobject_’

The full error will be like as below:

/usr/bin/ld: /usr/local/lib/liblua.a(lapi.o): relocation R_X86_64_32 against `luaO_nilobject_’ can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/liblua.a: could not read symbols: Bad value

I got the above error in between easyapache. It’s pretty sure lua is present in server but something went unoticed or bad while its installation. The missing part was nothing but I compiled 32 bit lua in 64 bit server, so the above error was showing mismatch class error for liblua.

I tried to recompile lua as follows:

Download lua source archive from their official site

# cd /usr/src
# curl -R -O
# tar zxf lua-5.2.3.tar.gz

Now you need to make sure that you will compile this time for 64 bit class.

For compilation in 64 bit arch server, you should make the following changes in lua source file before proceeding with installation.

# cd lua-5.2.3
# vi src/Makefile





Save and exit from file.

Now do the installlation.

# make linux test

# make

# make install

you are done 🙂 now the job left is to finish the easyapache process.

Error while loading shared libraries:

I got this liblua error while apache,php recompilation.

At first I tried to find the dependencies of lua

# ldd `which lua` => (0x00007fff1dd7d000) => not found => /lib64/ (0x0000003b68800000) => /lib64/ (0x0000003b68400000) => /lib64/ (0x0000003b68000000) => /lib64/ (0x0000003b67800000) => /lib64/ (0x0000003b67400000) => /lib64/ (0x0000003b6a400000)
/lib64/ (0x0000003b67000000)

Then I tried to search for liblua in “/” using find command.

# find / -iname liblua*

The made a symlink like as follows:

# ln -s /opt/lua/lib/ /opt/lua/lib/

# ll /opt/lua/lib/
lrwxrwxrwx 1 root root 13 Aug 18 11:08 /opt/lua/lib/ ->*

Now do recompile again and finish the process successfully 🙂

In case if lua is completely missing, you can install using yum or do manual compilation.

# yum install lua lua-devel

for manual compilation, download lua source from and install it.