Gentoo Archives: gentoo-embedded

From: Andrew Udvare <audvare@×××××.com>
To: Mike Frysinger <vapier@g.o>
Cc: "gentoo-embedded@l.g.o" <gentoo-embedded@l.g.o>
Subject: [gentoo-embedded] Re: GCC/LLVM-GCC targeting Darwin/OS X/iOS
Date: Fri, 14 Oct 2011 00:12:10
In Reply to: Re: [gentoo-embedded] GCC/LLVM-GCC targeting Darwin/OS X/iOS by Mike Frysinger
I did create some ebuilds of my own because the sys-devel/gcc-apple and
sys-devel/binutils-apple are very specifically for use with Gentoo Prefix on
OS X. They are just not what I call ready yet because they rely upon
EXTRA_ECONF to get the --target triple.

Project is here:

Complete (arm targetting iOS, i686 and x86_64 targeting OS X):
- Build Apple's cctools but only with older ld64; equivalent to binutils and
100% not the GNU versions
- Build Apple's GCC but only with precompiled libstdcxx and Libc
- Build Apple's LLVM and LLVM-GCC but again with precompiled libs

The main issues are:
- How to get the developer libraries from Apple (restricted source, have
user get the DMG and put it in /usr/distfiles, extract DMG reliably)
  - If we do this, there's not much point to compiling Libc or libstdcxx
since it's included with this
- How to build Apple's Libc (mainly for
- How to build Apple's libstdcxx (mainly for
- Build latest ld64 from Apple (currently I am using a patched older
version); everything in this toolchain at this point must link with ld64 and
not what Apple calls 'classic ld'

The patch for Apple's version of binutils (same package as
sys-devel/binutils-apple) that I made is quite large and may not be entirely
necessary (it patches back in what they used to have, autotools). However
Apple developers rely upon OS X's nearly automatic memset'ing which is why
somes patches are definitely necessary (or compiling stage will get

I am maintaining an overlay What I
am planning to do is just add separate ebuilds for each target since only
these are supported: i686, x86_64, arm (armv6, armv7 but I don't know how to
differentiate these yet; default is armv6), and maybe powerpc and powerpc64.


On Thursday, 13 October 2011, Mike Frysinger wrote:

> On Wednesday 07 September 2011 02:40:05 Andrew Udvare wrote: > > Most sources come from just like the > > sys-devel/binutils-apple and sys-devel/gcc-apple packages. The version > > of cctools in the project is patched heavily (mainly due to missing > > headers, which we can distribute). One source is derived from > > iphone-dev's version of odcctools, but only for one part of it (ld64). > > It is not the same and needed fixing to compile with GCC 4.5.3. I plan > > to fix the up-to-date ld64 regardless. > > so you have more ebuilds to add to the tree ? or something else ? > > > I'd like to reach the point of being able to type (perhaps with > > prerequisite work done by me like copying the SDK) `crossdev -t > > arm-apple-darwin` and `crossdev -t arm-apple-darwinX` (where X is 9, > > 10, 11). > > i think i'm going to have to open up crossdev to sucking down from overlays > via layman. there's an open request for better msp430 support, and that > requires hacks to some packages. > -mike >