Results 1 to 6 of 6
Discuss GNU ARM Toolchain for OSX ? at the General - Hackint0sh.org; So I know this is probably another one of those, "Hey hackers have you tried ...
  1. #1
    Newbie Array

    Join Date
    Jul 2007
    Posts
    6
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default GNU ARM Toolchain for OSX ?

    So I know this is probably another one of those, "Hey hackers have you tried this really obvious thing?" But just in case it's not:

    http://www.gnuarm.com/
    Last edited by sam; 07-12-2007 at 02:16 AM. Reason: Admin notice: edited topic to help people to find information better :)



  2. #2
    Senior Professional Array

    Join Date
    Jul 2007
    Posts
    199
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    18

    Default

    There are plenty of toolchains which support ARM.

    However, there are two requirements for an iPhone toolchain:

    1) Ability to generate ARM assembly
    2) Ability to create Mach-O executables

    No toolchain investigated so far has both capabilities. This one appears to be based off the GNU toolchain, which doesn't have Mach-O support.

  3. #3
    Newbie Array

    Join Date
    Jul 2007
    Posts
    3
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Have you considered maybe using a utility that would convert between ELF and Mach-O?

    http://www.agner.org/optimize/

    Is such a utility, but it's for x86 stuff only.

  4. #4
    Senior Professional Array

    Join Date
    Jul 2007
    Posts
    199
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    18

    Default

    Quote Originally Posted by blarf View Post
    Have you considered maybe using a utility that would convert between ELF and Mach-O?

    http://www.agner.org/optimize/

    Is such a utility, but it's for x86 stuff only.
    Yeah, if it can only convert to mach-o/x86 executables, then it's not very useful. Though the source for converting from ELF to mach-o may be of interest to the people who are trying to put mach-o and ARM together in existing toolchains.

  5. #5
    Newbie Array

    Join Date
    Jul 2007
    Posts
    3
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Quote Originally Posted by The Operator View Post
    Yeah, if it can only convert to mach-o/x86 executables, then it's not very useful. Though the source for converting from ELF to mach-o may be of interest to the people who are trying to put mach-o and ARM together in existing toolchains.
    Not very useful? Depends on how you look at it.

    To get applications running on the iPhone, you'll either need to produce Mach-O binaries for ARM, or produce a loader for other types of binaries (ELF would certainly be a good choice).

    As neat as Mach-O is, what currently available products use it? OS X and the iPhone. Even Hurd runs ELF binaries now. Mach-O support has been dropped from the GNU binutils, presumably because it's too difficult to maintain. So to get a Mach-O/ARM toolchain, you've gotta add Mach-O support to a toolchain that already does ARM or ARM support to something that already does Mach-O.

    I suspect the x86 ELF to Mach-O tool is far simpler than the GNU binutils mess. From what I can tell, the reason it's x86 only is primarily due to the differences in how ELF and Mach-O handle relocatable code. This should be pretty darn easy to hack to get working with ARM.

    Of course, it looks like those actively working on this have already discovered LLVM, which Apple is contributing to apparently.

    Me, I think that hacking up cctools is a good bet. From the looks of it, the Darwin guys have succeeded in getting a usable x86/Mach-O toolchain.

    Yay for armchair hacking.


  6. #6
    Senior Professional Array

    Join Date
    Jul 2007
    Posts
    199
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    18

    Default

    Quote Originally Posted by blarf View Post
    Not very useful? Depends on how you look at it. To get applications running on the iPhone, you'll either need to produce Mach-O binaries for ARM, or produce a loader for other types of binaries (ELF would certainly be a good choice).
    Right, but it's a bit of a chicken & egg dilemma. In order to get ELF binaries to load, you need a Mach-O/ARM based loader to do it (since that is the only binary type we know runs on the iPhone). So how do you build the loader?
    As neat as Mach-O is, what currently available products use it? OS X and the iPhone.
    But the iPhone is what we're working on. You can argue how obscure that binary format is all you like (which is likely exactly why Apple used it), but it won't change the fact that, if we want to run programs on the iPhone, we need to find a way to create binaries in it.
    So to get a Mach-O/ARM toolchain, you've gotta add Mach-O support to a toolchain that already does ARM or ARM support to something that already does Mach-O.
    Which is exactly what everyone is looking into.
    I suspect the x86 ELF to Mach-O tool is far simpler than the GNU binutils mess. From what I can tell, the reason it's x86 only is primarily due to the differences in how ELF and Mach-O handle relocatable code. This should be pretty darn easy to hack to get working with ARM.
    Not necessarily. I haven't looked into it, but I'm pretty sure the way code is loaded into memory on ARM is much different than x86. If it were simply a matter of taking the x86 assembly out and plugging in the ARM assembly with a similar Mach-O header, I'm sure we'd have a toolchain already (since the old version of GAS did support Mach-O/x86).
    Of course, it looks like those actively working on this have already discovered LLVM, which Apple is contributing to apparently.
    Yes, looked into that. You still need a native linker to assemble it's output into a working program (see step 7):

    http://llvm.org/docs/GettingStarted.html#tutorial

    Even with the -mtriple=arm-apple-darwin option given to llc (llc will produce the ARM assembly, but you still need the Mach-O header).
    Yay for armchair hacking.
    I'm just waiting for my iPhone and then I'll be back in the game.

 

 

Similar Threads

  1. Toolchain for ATV 2G
    By RobertR3d in forum AppleTV 2 (iOS based)
    Replies: 3
    Last Post: 04-20-2012, 08:34 PM
  2. [Toolchain Question] Unable to compile UI App in toolchain
    By sireko in forum Free Toolchain Software (Cydia App's)
    Replies: 1
    Last Post: 06-26-2009, 10:31 PM
  3. (Toolchain) New VMWare Community Toolchain (2.0)
    By Shade.sh in forum Free Toolchain Software (Cydia App's)
    Replies: 2
    Last Post: 10-20-2008, 10:14 PM
  4. Replies: 0
    Last Post: 09-18-2007, 08:51 PM
  5. Toolchain
    By Joe.lipinski in forum General
    Replies: 11
    Last Post: 07-20-2007, 07:24 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 09:28 AM.
twitter, follow us!