Building gcc on macOS 10.15 Catalina is stage 1 only

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As an old retired compiler-writer, I build gcc every few weeks for fun, and I like to benchmark the builds, examine generated code, etc.

   ->  http://dkallen.org/BuildingGCC.htm

This all ended a few months ago, as Apple’s Xcode 11 world on macOS 10.15 Catalina no longer has a /usr/include.  With Xcode 11 one could in 10.14 Mojave install /usr/include, but this no longer works in Catalina.  Apple moved lib and include into a new developer location.  You can determine where /usr is via their xcrun tool, e.g.,

[~] 14:04:01 % xcrun --show-sdk-path
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

[~] 14:06:14 % ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr
bin/		include/	lib/		libexec/	share/

You cannot create /usr anything, except within /usr/local, due to new read-only file systems around the OS and its folders.  It is supposed to be more secure, but it is really a gigantic pain.

So, with that background, building gcc works, but just for stage-1.  This is because clang (used for the first build) knows all about the new developer tool path.  Once a stage-1 gcc is built, gcc looks for /usr/include and dies, even with using -sysroot, or -isysroot, or a variety of other flags that I have tried.

So gcc gurus, how does one fix this?  I have tried bootstrap-building the latest snapshots of gcc 7, 8, 9, and 10, all with the same result: failure.

Thanks,

Dan Allen











[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux