lua-users home
lua-l archive

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


On Wed, Jun 23, 2010 at 03:00:08PM -0300, Antonio Scuri wrote:
<snip>
>   If Lua 5.2 will solve mine too then it is good news. In the meanwhile I
> still want to hear other possible solutions to the linker problem.
>
>   BTW, without having to explicit link to module1, I also do not have to set
> LD_LIBRARY_PATH.
>
> Best,
> Scuri

I'm not sure what problem that is at this point. You should be able to
link module2 with unresolved symbols in module1 (no need for -l at all)
and have it work if module1's symbols are exported from lua when loaded
(what RTLD_GLOBAL does).

I don't know that there's a correct way to use -lmodule1 (in any form)
when linking module2 for how you want to be using them (require"module1"
and require"module2").

Hm... you might be able to use the all-in-one loader for this actually by
packing the two modules into one .so but that'd require renaming their
luaopen_* functions to match.

Short of that the best you could probably do is have module2
dlopen/dlsym/etc. the symbols from module1 itself at runtime (by searching
for the module in package.cpath locations yourself, etc.)

    -Etan