lua-users home
lua-l archive

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


On Wed, May 6, 2015 at 7:48 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> 2015-05-06 12:45 GMT+02:00 Rob Kendrick <rjek@rjek.com>:
>> On Wed, May 06, 2015 at 07:34:18AM -0300, Luiz Henrique de Figueiredo wrote:
>>> > Strictly speaking, -fPIC is needed for any shared library.  It just
>>> > happens that there's a happy coincidence that means you can often get
>>> > away without it on 32 bit x86.
>>>
>>> Mac OS X does not need -fPIC, even in 64-bit machines.
>>
>> My guess here is that this is either that it is enabled by default there
>> because they do ASLR, or it's some strange fall-out from OS X's bizarre
>> binary format :)
>>
>> A shared library needs to be position independent code, that much is
>> non-negotiable, but some tooling probably handles it for you.  It
>> should always be safe to add.
>
> And the reason that -shared does not imply -fPIC is presumably
> that -fpic might be adequate.
>

I recall having to rebuild Lua itself with -fPIC in order to be able
to use it in a shared library. IIRC it was dismissed as a non-issue
for whatever reason, I can't remember exactly...

-- 
Sent from my Game Boy.