lua-users home
lua-l archive

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


On Nov 30, 2012, at 12:51 PM, Luiz Henrique de Figueiredo wrote:

> What is the output of "nm -g /usr/local/lib64/lua/5.1/bit.so" ?

This works because the .so file has not been stripped. In the general case you probably want "nm --dynamic" aka "nm -D" which looks at the symbols used for dynamic loading.

I would try looking at the output of the dynamic linker. Run lua like this, and you'll get spammed:

$ LD_DEBUG=symbols lua

Ignore all the initial output. (Once you start typing, you'll discover some symbols have not been resolved even once the prompt has been printed.) Once you require bit, you'll probably get some kind of failure instead of this:

xxxxx: symbol=luaopen_bit;  lookup in file=/usr/lib/x86_64-linux-gnu/lua/5.1/bit.so

Of course Mike just diagnosed it from looking at CFLAGS. -fwhole-program will actually work with some suitable definitions of LUA_API but you probably don't want to be trying that unless you already knew about LD_DEBUG.  I don't see any good reason to blast -fwhole-program into *any* CFLAGS without -flto.

Jay