lua-users home
lua-l archive

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

Hi people,

I'm trying to release a new version of the Debian package of Lua
4.0, but I'm stuck with an error concerning dynamic linking...

Here's the whole story. For personal reasons I wanted to have a Lua
with a "loadlib" function that would let me link with ".so"s
containing new Lua functions; so I took the "loadlib.c" file of cgilua
and created another Lua library file, "", with it, and
another binary, "dllua", that links with that library and registers
its functions.

Note: loadlib.c needs the functions dlopen, dlsym and dlclose, that
live in libdl. If I had just added loadlib.c to liblualib then
everybody would have to use "gcc -llua -llualib -ldl" instead of
"gcc -llua -llualib" and that would make compilation scripts would
crash. That's why I had to create an extra library and an extra

But my "dllua" was segfaulting at very simple Lua programs, and when I
tried to find what was wrong I discovered that its list of libraries
to link with was severely brain-damaged:

/usr/src/lua-4.0/debian/tmp-lua/usr# ldd bin/lua bin/dllua
bin/lua: => /usr/lib/ (0x40021000) => /usr/lib/ (0x40032000) => /lib/ (0x40040000) => /lib/ (0x4005d000)
        /lib/ => /lib/ (0x40000000)
bin/dllua: => /lib/ (0x40021000) => /lib/ (0x40024000) => /lib/ (0x40042000)
        /lib/ => /lib/ (0x40000000)

and when I tried to discover the causes for that I got brain-damaged
too: I can't figure out why in some cases gcc creates a binary with
the right DL info and in some cases it doesn't (tee the output of
creating the package with "debian/rules binary" and search for "dllua"
and "ldd" to see what I'm talking about) and why stripping seems to
drops DL information.

I need help.

P.S.: I have sent this message:

to a Debian list but got no answer yet.

  Eduardo Ochs