iains / gcc-darwin-arm64

GCC master branch for Darwin with experimental support for Arm64. Currently GCC-15.0.0 [September 2024]
GNU General Public License v2.0
268 stars 33 forks source link

Error building without bootstrap #103

Closed kumom closed 1 year ago

kumom commented 1 year ago

With the following configuration

$HOME/dropbox/projects/gcc-darwin-arm64/configure --disable-bootstrap --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk --prefix=$PWD

I encountered the error

Adding multilib support to Makefile in /Users/kumom/dropbox/projects/gcc-darwin-arm64/libgcc
multidirs=
with_multisubdir=
make: *** [all] Error 2

But building with bootstrapping works fine on my machine (Apple M2, macOS Ventura 13.0).

iains commented 1 year ago

You are encountering at least one problem which is not to do with GCC, but to do with Xcode clang.... (1 and 2 below).

Also, I recommend adding --build=aarch64-apple-darwin22 to the configuration line (for darwin22 / ventura) so that the resulting compiler will have names like aarch64-apple-darwin22-gcc. [ that is helpful if you then want to use that compiler as the build one, since the name is then easier to remember].


We have three issues here:

  1. When you use clang as the bootstrap compiler, it pretends to be GCC

  2. so it claims "gcc" and "g++" .. it does this even if you place a newer GCC first in the PATH.

  1. https://github.com/iains/gcc-12-branch/issues/18

I will try to produce a fix for (3) during this week.


You can use a bootstrapped GCC as the build compiler for a non-bootstrap build (so that you first make a compiler using bootstrap, and then use that in a --disable-bootstrap build (I do this quite often for debugging).. That then means you then have an up-to-date GCC as the bootstrap compiler, and it has all the flags and builtins as expected.

NOTE: because of (2) you should add CC=aarch64-apple-darwin22-gcc CXX=aarch64-apple-darwin22-g++ to the configuration to make sure of using the correct build compiler.

iains commented 1 year ago

this issue should be fixed in the latest sources;

however the advice remains: non-bootstrap builds starting from a non-GCC or old-GCC compiler are not intended or recommended and will not necessarily be reliable.