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

Cannot compile on latest Mac M1 OS #126

Closed sjk7 closed 5 months ago

sjk7 commented 7 months ago

Hello,

I could paste a wall of text here, but I wonder if this is enough to be able to make sense of the problem?

checking whether printf() supports POSIX/XSI format strings... (cached) yes checking for dvips... /Users/stevekerr/gcc-darwin-arm64/gettext/build-aux/missing dvips checking for texi2pdf... /Users/stevekerr/gcc-darwin-arm64/gettext/build-aux/missing texi2pdf checking for perl... (cached) /opt/homebrew/bin/perl configure: updating cache .././config.cache checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating Makefile config.status: creating gnulib-lib/Makefile config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands make[1]: [stage1-bubble] Error 2 make: [all] Error 2

commands used: ./configure --enable-languages=c,c++ --enable-multiarch --enable-shared --enable-threads=posix --without-included-gettext --with-system-zlib --with-tune=generic make -j6 BOOT_CFLAGS="-O2 -g -Wno-error=deprecated-declarations"

HTH,

Steve

iains commented 7 months ago

perhaps just attach the build log - that snippet tells me there's a problem, but not what it is.

commands used:
./configure --enable-languages=c,c++ --enable-multiarch --enable-shared --enable-threads=posix --without-included-gettext --with-system-zlib --with-tune=generic
  1. you are missing a sysroot to point to the macOS SDK so that (even without other issues) the build will fail

  2. why have you put --enable-multiarch ? what do you expect it to achieve?

--enable-shared is the default.

--enable-threads=posix is the default

--with-tune=generic- I'd think ti would be more useful to configure --with-cpu=apple-m1

one other thing: please ensure you are not trying to build in the source directory, that is not supported.

my configure looks more like:

/src-local/gcc-master-patched/configure --prefix=/opt/iains/aarch64-apple-darwin21/gcc-14-0-1 --build=aarch64-apple-darwin21 --with-sysroot=/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk --enable-languages=c,c++,fortran, etc --with-cpu=apple-m1 

edit: of course, you are on darwin23 (macOS 14) so it would be --build=aarch64-apple-darwin23 and the sysroot would need similar adjustment (assuming you are using the Command Line Tools installed in their default position)

if you only have Xcode installed then you have to fish out the SDK path from that which you can do in a number of ways: e.g.

--with-sysroot=`xcrun --show-sdk-path`
iains commented 7 months ago

have you managed to resolve this, or please could you add some more detail so that we can try to fix any problems.

iains commented 5 months ago

No other reports of issues with dawin23/macOS 14 - so closing (if something stil is not working, please re-open and provide more details).