Prefix/Darwin

From Gentoo Wiki
< Prefix
Jump to:navigation Jump to:search

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
    • 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

Platforms

arm64-macos

M1 macs, etc.

Cannot currently be bootstrapped:

  • Waiting for GCC support to be merged upstream and in a release (GCC 12?)
  • With a snapshot of the GCC fork/branch, we can get a bit further, but bootstrapping doesn't complete.

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.