lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


2015-06-08 15:00 GMT+02:00 Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>:
>> On 64-bit Ubuntu, as usual I had to rebuild Lua having added -fPIC to
>> MYCFLAGS.
>
> Why? How does it matter for static libraries, which is what the standard
> Makefile builds?
>
> I usually have to add -fPIC when building dynamic C libraries to be used in Lua,
> but not for building Lua itself.

I don't know why.

All I know is that when building SILE I got the message

/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

and after I rebuilt Lua with -fPIC, that message did not appear again.

Maybe it is because SILE embeds liblua rather than that the Lua executable
loads a C module.