lua-users home
lua-l archive

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


Hi,

> 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, "libdllua.so", with it, and
> another binary, "dllua", that links with that library and registers
> its functions.
>
> ...
>
> 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:
>
> ...
>
> 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.

Some hours ago my brain damage went away (thanks to the good vibes of
the people of the list:) and I was able to spot the error and fix
it... if someone is curious, it was just that I wasn't deleting the
bin/dllua that was generated by "make all" (and that used the ".a"
libraries, not the ".so"s), and so "make sobin" didn't try to generate
another dllua that used the ".so"s.

Now there's a working (AFAIK) source package of Lua-4.0 in
http://angg.twu.net/tmp/. Quick installation instructions:

  apt-get install texinfo yada

  cd ~/tmp/
  wget http://angg.twu.net/tmp/lua_4.0-0.2.dsc
  wget http://angg.twu.net/tmp/lua_4.0-0.2.diff.gz
  wget http://angg.twu.net/tmp/lua_4.0.orig.tar.gz

  rm -Rv /usr/src/lua*
  cd /usr/src/
  dpkg-source -sn -x ~/tmp/lua_4.0-0.2.dsc

  cd /usr/src/lua-4.0/
  yada yada; yada rebuild rules
  dpkg-buildpackage -b -rfakeroot -us -uc

  # as root:
  dpkg -i /usr/src/lua_4.0-0.2_i386.deb

I'll try to make the package a bit more official in the next days, by
adding it to my Debian repository, creating a page on Lua with better
instructions, etc. I'm also planning to write some simple examples of
use of "loadlib", but that will go only in 4.0-0.3.

Cheers,
  Eduardo Ochs
  http://angg.twu.net/
  edrx@inx.com.br


P.S.: Thanks to all that have tried to help... and hey Tomas, the URL
that you gave me points to an empty directory, so I couldn't use your
Makefile because it wasn't there.