Prefix/Darwin
From Gentoo Wiki
< Prefix
Jump to:navigation
Jump to:search
Prefix/Darwin brings the power of Gentoo to Darwin (macOS/OS X) based systems, similar to pkgsrc, macports, and homebrew.
General
- macOS follows the normal bootstrap procedure
- Bootstraps currently done via GCC (
DARWIN_USE_GCC=1
is set by default)- host/Apple Clang from xcode tools is used then GCC is built as soon as possible
- Using GCC as the "system" compiler within Prefix has problems
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90709 (general tracker for macOS header/frameworks issues with GCC)
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78352 (Blocks support)
- As a result, can't build things using e.g. Aqua (nice GUI) integrations or other Frameworks (e.g. git keychain integration).
- We use the system (host) linker because we can't build Apple's linker independently within our prefix without Clang, because it uses Blocks
- Possibility of bootstrapping via Clang (
DARWIN_USE_GCC=0
)- It's possible but doesn't work yet!
- Needs some work to get sysroot, SDK paths right. See what e.g. macports does for hints.
- bug #758167 is the meta bug for this work.
- Help very much welcome!
- To attempt a full bootstrap using Clang (this won't work yet, but it'll do something):
DARWIN_USE_GCC=0 ./bootstrap-prefix.sh
- Suggestion: start with trying to build Clang, LLVM, and friends within a fully-built working GCC-bootstrapped Prefix and go from there
- Suggestion: look at macports patches
- To attempt a full bootstrap using Clang (this won't work yet, but it'll do something):
Platforms
arm64-macos
M1 macs, etc.
Cannot currently be bootstrapped:
- Waiting for GCC support to be merged upstream and in a release (GCC 12?)
- See https://github.com/iains/gcc-darwin-arm64
- We currently use a snapshot in our scripts but it doesn't get to the end, see below.
- With a snapshot of the GCC fork/branch, we can get a bit further, but bootstrapping doesn't complete.
- bug #778014 - Prefix: Big Sur ARM (M1 MacBook Pro MYD82LL/A) build failure due to missing symbols
- bug #792780 - sys-devel/binutils-apple fails to build during prefix bootstrap on M1 (Big Sur 11.4)
x64-macos
Works okay!
ppc-macos
Still somewhat supported as the supported OS versions age.
Non-platforms
x86-macos
Support was dropped recently due to lack of interest, but could be restored with a sponsor/cheerleader.