Re: Determining how the app is run (intel/ppc/rosetta/os version)?
Re: Determining how the app is run (intel/ppc/rosetta/os version)?
- Subject: Re: Determining how the app is run (intel/ppc/rosetta/os version)?
- From: Gerben Wierda <email@hidden>
- Date: Fri, 26 May 2006 21:48:38 +0200
My app contains:
x86 binary compiled with gcc 4 against 10.4 SDK
ppc binary compiled with gcc 3 against the 10.3 SDK to make sure it is
compatible with 10.3 on ppc
The ppc binary is a known trigger of the partial OS freeze bug of 10.4.6
The x86 binary does not work properly on 10.4.4 - 10.4.6 (on x86)
[Note: if I compile the ppc with gcc 4 against the 10.4 SDK it also
does not work properly on ppc hardware. This seems to be a myApp/Tiger
issue which does not occur when I compile with gcc3 against the 10.3
SDK. I do not know yet what triggers it)
So, I want to make sure that the app
- exits with a warning when run in rosetta on 10.4.6
- exits with a warning when run natively on 10.4.4-10.4.6 (assuming
that 10.4.7 will be OK again and I have good reason to hope so)
The snippet of code I posted was meant to find out the HW architecture,
but that does not work, while kernel version does work. I was not so
far as to look for rosetta yet.
Basically, there is a point to detect arch at runtime. Because 10.4.6
on intel is problematic, while 10.4.6 on ppc is not. And this is a
runtime call, I cannot detect that at compile time, obviously.
G
On May 26, 2006, at 19:09, Finlay Dobbie wrote:
On 26/05/06, Gerben Wierda <email@hidden> wrote:
I still want to keep my app from running on some versions of the OS or
some situations because there are known OS bugs there. E.g. my app on
10.4.6 under Rosetta is one of the apps (like MatLab) triggering the
OS
bug. So I started looking for ways to determine the way the app is
run.
I tried doing some stuff through sysctl, but failed. Below is an
example. The CTL_KERN/KERN_VERSION works, but CTL_HW/HW_MACHINE_ARG
does not.
What are you attempting to do?
For detecting Rosetta, use sysctl.proc_native (as directed in the
entry in the UBPG I linked originally).
For detecting the OS X version, use Gestalt.
There is no point in detecting arch at runtime, it's known at compile
time. Use #ifdefs.
-- Finlay
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden