lua-users home
lua-l archive

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

On Thu, 18 Feb 2010 08:33:46 +0200
steve donovan <> wrote:

> On Wed, Feb 17, 2010 at 9:10 PM, Rob Kendrick <> wrote:
> > Does this mean that it passes -fPIC -DPIC regardless of
> > architecture, now?
> No, it tries to be clever - does not use -fPIC for x86.  It would
> appear that -fPIC is at the very least harmless for x86 (there
> appeared to be old compiler issues) so this cleverness may be
> unneeded.

The problem is that shared libraries can be loaded at any position in
memory; you don't know where in advance and it's unlikely any two
processes will have you loaded in the same location.

This means your code has to be PIC.  While shared objects appear to
work on x86 without -fPIC, it can lead to inefficiencies in how much of
the object is shared between users.  The solution is to pass -fPIC
regardless of architecture, and everybody is happy.

Alternatively, perhaps LuaRocks should use libtool if it is installed
on the system on which it is running.