[Prev] Thread [Next]  |  [Prev] Date [Next]

Re: -mmacosx-version-min=10.5 and nm, strings, otool, et al Ken Thomases Mon Sep 20 12:00:34 2010

On Sep 20, 2010, at 11:08 AM, Dallman, John wrote:

> Since we have to keep versions of this library under maintenance for 
> some time, we try to move up OS versions as fast as we can.

This is beside the point, but the above seems very counter-intuitive to me.  If 
you need to keep older versions of the library under maintenance, you should 
keep an old build environment around.  (It's not practical, but in theory one 
would keep the entire build environment in version control along with the 
source code.  Including hardware. ;)

> -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5
> That builds us a library that runs on 10.5, but when you try to 
> look at it with nm on 10.5, we get messages like:
> nm: object: /path/to/mylib.dylib malformed object (unknown load command
> 5)

I don't have direct experience with this, but as you've discovered, there's 
mounting evidence that there's a bug with building libraries (but not 
executables) with the Snow Leopard tools for deployment to 10.5.  File a bug 
with Apple at <http://bugreport.apple.com>.  Once you've done that, it might 
also be worth opening a developer technical support incident 
<http://developer.apple.com/support/resources/technical-support.html> with 
them, too.  (The bug reporter is very clearly not a mechanism for obtaining 
workarounds or the like.  Tech support incidents can be used to ask for 
workarounds for bugs.)

> Searching, I've found other instances of people hitting this problem, 
> such as:
> http://lists.apple.com/archives/xcode-users/2010/Aug/msg00219.html
> http://lists.apple.com/archives/xcode-users/2010/Mar/msg00077.html
> The second of those has a solution of "Add -mmacosx-version-min=10.4"
> Is that actually correct? It works, but it seems inconsistent with 
> using the 10.5 SDK.

It is not inconsistent.  The SDK dictates the latest API your code is allowed 
to use.  The minimum OS version (AKA deployment target) is the earliest OS on 
which your code is loadable.

It is perfectly possible for code to be (carefully) written so that it can take 
advantage of 10.5 API when running on 10.5 but still be loadable on 10.4, at 
which point it falls back to earlier API (or drops features which depend on the 
later API).

> Trying to use the 10.4 SDK doesn't work: if you 
> use -isysroot for the 10.4 SDK, you can't compile code that uses 
> stdarg.h, or various other headers;

This part is due to the version of GCC used.  If you build against the 10.4 
SDK, you have to use GCC 4.0, not 4.2.

> if you use -sysroot for the 10.4 
> SDK, you can compile, but 10.4 doesn't have many of the 64-bit 
> libraries we need. 

Can't help with that part.


Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      ([EMAIL PROTECTED])
Help/Unsubscribe/Update your Subscription:

This email sent to [EMAIL PROTECTED]