[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Building Secondary Modules
- From: Etan Reisner <deryni@...>
- Date: Wed, 23 Jun 2010 14:25:43 -0400
On Wed, Jun 23, 2010 at 03:00:08PM -0300, Antonio Scuri wrote:
> 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
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"
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.)