Welcome to MacBoardz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Telling which platforms an app is compiled for

 
   Macintosh computer (Home) -> Programmer Help RSS
Next:  Setting x86_64 architecture in Xcode  
Author Message
Simon Slavin1

External


Since: May 16, 2004
Posts: 543



(Msg. 1) Posted: Fri Jan 25, 2008 9:48 pm
Post subject: Telling which platforms an app is compiled for
Archived from groups: comp>sys>mac>programmer>help (more info?)

I know that OS X 10.5 is very good at cross-platform support but I'm
trying to support or refute some claims by software publishers.

Given a bunch of applications (proper GUI app, not command-line) how do I
tell whether they're PPC, Intel, Universal, 64-bit, ARM (!), etc. ? I
looked at 'otool' but I can't figure out if it helps.

Simon.
--
http://www.hearsay.demon.co.uk

 >> Stay informed about: Telling which platforms an app is compiled for 
Back to top
Login to vote
Dave Seaman

External


Since: Jun 25, 2003
Posts: 451



(Msg. 2) Posted: Fri Jan 25, 2008 11:53 pm
Post subject: Re: Telling which platforms an app is compiled for [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Fri, 25 Jan 2008 21:48:17 +0000, Simon Slavin wrote:
> I know that OS X 10.5 is very good at cross-platform support but I'm
> trying to support or refute some claims by software publishers.

> Given a bunch of applications (proper GUI app, not command-line) how do I
> tell whether they're PPC, Intel, Universal, 64-bit, ARM (!), etc. ? I
> looked at 'otool' but I can't figure out if it helps.

You can use the "file" command on the executable file. If an app is in
/Applications/Foo.app, then the executable file is probably
/Applications/Foo.app/Contents/MacOS/Foo, and "file Foo" may say
something like:

Foo: Mach-O universal binary with 2 architectures
Foo (for architecture ppc): Mach-O executable ppc
Foo (for architecture i386): Mach-O executable i386

If 64-bit binaries are present, "file" will also tell you about those.




--
Dave Seaman
Oral Arguments in Mumia Abu-Jamal Case heard May 17
U.S. Court of Appeals, Third Circuit
<http://www.abu-jamal-news.com/>

 >> Stay informed about: Telling which platforms an app is compiled for 
Back to top
Login to vote
noreply

External


Since: Dec 02, 2004
Posts: 191



(Msg. 3) Posted: Sat Jan 26, 2008 12:51 am
Post subject: Re: Telling which platforms an app is compiled for [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Simon Slavin
wrote:

> Given a bunch of applications (proper GUI app, not command-line) how do I
> tell whether they're PPC, Intel, Universal, 64-bit, ARM (!), etc. ? I
> looked at 'otool' but I can't figure out if it helps.

the 'file' command will list the architectures for which your binary is
compiled.

patrick
 >> Stay informed about: Telling which platforms an app is compiled for 
Back to top
Login to vote
Simon Slavin1

External


Since: May 16, 2004
Posts: 543



(Msg. 4) Posted: Mon Jan 28, 2008 9:42 pm
Post subject: Re: Telling which platforms an app is compiled for [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 26/01/2008, Patrick Machielse wrote in message
:

> the 'file' command will list the architectures for which your binary is
> compiled.

Excellent:

SimonsMBP:MacOS simon$ file []Preview
Preview: Mach-O universal binary with 2 architectures
Preview (for architecture i386): Mach-O executable i386
Preview (for architecture ppc7400): Mach-O executable ppc

SimonsMBP:MacOS simon$ file []Gunnar
Gunnar: Mach-O executable ppc

SimonsMBP:DemoApp.app simon$ file []DemoApp
DemoApp: Mach-O executable arm

Okay. So there's some variation depending on whether it has multiple
architecture. I wonder what would happen if one supported three
architectures: would it call it 'universal trinary' ?

Many thanks for the help to both you and Dave Seaman.

Simon.
--
http://www.hearsay.demon.co.uk
 >> Stay informed about: Telling which platforms an app is compiled for 
Back to top
Login to vote
Chris McDonald

External


Since: Apr 15, 2004
Posts: 83



(Msg. 5) Posted: Mon Jan 28, 2008 11:02 pm
Post subject: Re: Telling which platforms an app is compiled for [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Simon Slavin writes:

>..... I wonder what would happen if one supported three
>architectures: would it call it 'universal trinary' ?

For those indecisive bits?

--
Chris.
 >> Stay informed about: Telling which platforms an app is compiled for 
Back to top
Login to vote
noreply

External


Since: Dec 02, 2004
Posts: 191



(Msg. 6) Posted: Tue Jan 29, 2008 11:15 am
Post subject: Re: Telling which platforms an app is compiled for [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Simon Slavin
wrote:

> Okay. So there's some variation depending on whether it has multiple
> architecture. I wonder what would happen if one supported three
> architectures: would it call it 'universal trinary' ?

Out of the box it is trivial to build a '5-way' UB with Xcode. If you
add arm to the mix who knows how crazy you can go? I don't know what the
theoretical upper limit for the number of supported architectures is, or
if one exists...

patrick
 >> Stay informed about: Telling which platforms an app is compiled for 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Developing for other platforms - Hello, I have just some general questions... I'm curious about developing Microsoft Windows or Linux applications using a Mac. I currently have access to a Mac only (poor penniless student here...) and I'm wondering if it's possible, or rather,..

telling a bundle where to find a dependent dylib? - I've used the install_name_tool to tell a Mach-O app where to find a dylib nested in its Frameworks folder. Now I have a bundle with similar requirements. The bundle is loaded by a plugin in a CFM app. I'd like to include the dylib (which the bundle..

How to run compiled AppleScript script from C - Apple RunScript.c show how to run script from script text but how to run an already compiled script ?

Does Xcode compiled shell tool work in Jaguar ? - Does Xcode compiled shell tool work in Jaguar ? I got a zerolink error message when running this shell tool in Jaguar.

memory leaking in 10.2.8? - Hi groups, I have a question concerning the memory management in the OS X (10.2.8 to be exact). Either I don't understand the way it works or there is something like major memory leak in the version I referred to (I haven't noticed it with previous..
   Macintosh computer (Home) -> Programmer Help All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]