Re: Linker refuses to link my dylib? Why?
Re: Linker refuses to link my dylib? Why?
- Subject: Re: Linker refuses to link my dylib? Why?
- From: Eric Albert <email@hidden>
- Date: Thu, 15 Feb 2007 11:57:38 -0800
On Feb 15, 2007, at 11:52 AM, Jonas Maebe wrote:
On 15 feb 2007, at 20:12, Eric Albert wrote:
Mac OS X requires libraries to be relocatable, so you can't build
them with -mdynamic-no-pic. The errors Theodore posted about are
exactly what you'll see when you build a library with -mdynamic-no-
pic. Non-PIC code in a library would be very slightly faster, but
PIC code has the advantage of actually working....
Just a small remark: it is possible to create working non-pic
dynamic libraries for ppc32 and i386 on at least Mac OS X 10.4.x
(maybe not with gcc though, but I can create them using our own
compiler). It is impossible for ppc64 though. I don't know about
x86_64.
It definitely isn't supported. You can construct the code, but dyld
assumes that all libraries are relocatable, so if the library has to
be slid due to other things inserted into the process' address space
it'll go ahead and slide the library. If the library is non-PIC,
it'll run incorrectly when it's slid.
In other words, I'd strongly suggest that you not ship libraries
built non-PIC.
-Eric
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden