Re: Cross OS version UB development
Re: Cross OS version UB development
- Subject: Re: Cross OS version UB development
- From: Greg Guerin <email@hidden>
- Date: Sat, 24 Feb 2007 12:01:27 -0700
Andreas Wittenstein wrote:
>I wish that were true. Unfortunately, Xcode's automatic Universal
>Binary creation facility always applies exactly the same rules to
>exactly the same set of files for both the ppc and i386 editions of a
>Universal Binary. Any deviation from this prescription requires that
>the two editions be lipo'd together manually.
>
>In my case, the real-time lossless SheerVideo codecs have a large
>number of G4-specific, G5-specific, and Intel-specific functions
>containing vector-processor-specific assembler code and requiring
>processor-specific optimization flags. Because in gcc all
>optimization flags can only be specified on the command line, not as
>#pragmas in the source code, this means I have many processor-
>specific source files with processor-specific flags.
Just to clarify, these are PROCESSOR-specific optimizations. The
ARCHITECTURE is basically a set of processors with similar
instruction-sets, endianness, etc.
I have created many multi-ARCHITECTURE projects with different settings
(including SDK and GCC version) for each one. Xcode can handle these
distinctions with ease, and direct lipo'ing is unnecessary.
Within an architecture, though, Xcode does not support processor-specific
suffixing like it does for architectures. At least not that I've found.
These are further described in 'man 3 arch', where CPU_TYPE corresponds to
Xcode's term "architecture" and CPU_SUBTYPE means "processor-specific".
That man page lists quite a few ppc* subtype names, which I couldn't get
them to work. That was quite some time ago, and maybe I did something
wrong at the time (I was a UB-newbie), and those subtype names really will
work. It might be worth a try.
>But the way Xcode works, a universal binary is a single configuration
>with two architectures.
Two OR MORE architectures.
>So there's no way to give it architecture-specific flags.
That is incorrect:
ARCHITECTURE-specific flags work (CPU_TYPE).
PROCESSOR-specific doesn't work, AFAICT (CPU_SUBTYPE).
However, if you can somehow convince Xcode to recognize the CPU_SUBTYPE
names mentioned in 'man 3 arch', then you should be able to get it to
compile that as a separate architecture, and correctly mark it as such in
your UB executable. In particular, there should be a binary for PPC (G4),
one for the G5, and one for i386.
I don't know which of the arch CPU_SUBTYPE's should be used for the G5, but
someone else might, or it might be available via 'sysctl'.
-- GG
_______________________________________________
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