lua-users home
lua-l archive

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


On Mon, 26 Jan 2004, Marius Kjeldahl wrote:

> I've successfully compiled lua 5.0 and the current version of luasocket
> 2.0.

(The reason this isn't just a message to Diego is that it's something
other extension authors should be aware of.)

Speaking of luasocket 2.0-alpha, there is one buglet in how it's
built.  Although it is possible to dynamically load code that is not
position independent on Linux, it incurs a significant performance
penalty.  (In particular, at load time, relocations must be processed,
rendering the pages unsharable.)  In the current luasocket, the same
non-position-independent .o files are used to build both the .a static
library and the .so shared library.

The conventional way to handle this is to build your object files
twice: once as .o files as you normally would, and again to another
extension (often ".os") with -fPIC or whatever other flags are needed
to compile objects for shared libraries.

The simplest thing for luasocket to do is to only build the shared
library by default, since I think most users care more about that than
the static version.

Jay