lua-users home
lua-l archive

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


We get conflicting instructions here:

Rob says to use -fPIC everywhere...

On Tue, Mar 13, 2012 at 10:35 AM, Rob Kendrick <rjek@rjek.com> wrote:
> I'm mildly astonished that this bug is still there.  -fPIC is required
> when building a shared object, regardless of CPU architecture.

...while Jay says to use it only where needed.

> On Tue, Mar 13, 2012 at 3:02 PM, Jay Carlson <nop@nop.com> wrote:
>> As a side note, please do not write -fPIC until you get a "fails to
>> build" bug report on some architecture (probably sparc). -fPIC can be
>> drastically less efficient than -fpic

Steve sums the confusion up nicely:

On Tue, Mar 13, 2012 at 10:16 AM, steve donovan
<steve.j.donovan@gmail.com> wrote:
> Oops, because the current received wisdom is to slap -fPIC on any
> Linux Lua extension...(to compensate for not using it before, of
> course ;)).

I used to follow Jay's advice and LuaRocks did only add -fPIC to
CFLAGS when building specific architectures (x86_64, in that case).
But then people started complaining and I just changed it to all
architectures. I guess having it everywhere at least ensures it works
(even if at sub-optimal performance) without having to check whether
every possible architecture needs it (and that's not a matter of
laziness -- I don't know every possible arch LR can run on, and I'd
rather have it working out of the box on them than waiting for error
reports and adding -fPIC on a case-by-case basis).

-- Hisham
http://hisham.hm/