-mmacosx-version-min=10.5 and nm, strings, otool, et al
-mmacosx-version-min=10.5 and nm, strings, otool, et al
- Subject: -mmacosx-version-min=10.5 and nm, strings, otool, et al
- From: "Dallman, John" <email@hidden>
- Date: Mon, 20 Sep 2010 18:08:36 +0200
- Thread-topic: -mmacosx-version-min=10.5 and nm, strings, otool, et al
The product I work on is a library, not an application. It is sold
to various ISVs in dylib form, and they produce applications that
use it. The only applications we build along with the dylib are
test harnesses, which aren't intended for end-users. We use the
Xcode compiler, linker and so on, but not the IDE; it doesn't suit
several things about the way we work (no IDE does).
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. The
ability of the Mac OS X and Xcode combination to build backwards-
compatible code is thus very appealing to us. At present, we want to
build 64-bit and 32-bit dylibs on 10.6 with Xcode 3.2, and backwards
compatibility to 10.5.
But we are having trouble getting this to work. If we compile with,
for example:
-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)
We get the same with strings, otool and install_name_tool. That latter
is important: there is no canonical place on the OS where this library
should be installed, since it forms part of many applications from
different vendors, with no connection with each other. So they need
separate copies, and thus our customers need to be able to use
install_name_tool to set the id of their copies of the library.
Is there a Technical Note on how to build libraries so they are fully
backwards compatible, and can be used by developers working on 10.5?
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. 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; 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.
thanks,
--
John Dallman
_______________________________________________
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