lua-users home
lua-l archive

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


PIC is enabled by default on OS X.

From: http://docstore.mik.ua/orelly/unix3/mac/ch05_03.htm
[[ One difference between Darwin and many other Unix systems is that
no position-independent code (PIC) flag is needed, since it is the
default for Darwin. ]]


On Wed, May 6, 2015 at 6:45 PM, Rob Kendrick <rjek@rjek.com> wrote:
> 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.
>
> B.
>