gnutls compilation on M1 fails both with XCode 13.4.1 and 14
With XCode 13.4.1 I end up with
CCAS macosx/sha1-armv8.lo
CCAS macosx/sha256-armv8.lo
CCAS macosx/sha512-armv8.lo
../../../libtool: line 1760: 12280 Segmentation fault: 11 /Applications/Xcode13.app/Contents/Developer/usr/bin/gcc -Wa,-march=all -O2 -arch arm64 -I/Applications/Xcode13.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -isysroot /Applications/Xcode13.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -c /Users/jhbuild/gtk/source/gnutls-3.7.3/lib/accelerated/aarch64/macosx/sha256-armv8.s -fno-common -DPIC -o macosx/.libs/sha256-armv8.o
../../../libtool: line 1760: 12275 Segmentation fault: 11 /Applications/Xcode13.app/Contents/Developer/usr/bin/gcc -Wa,-march=all -O2 -arch arm64 -I/Applications/Xcode13.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -isysroot /Applications/Xcode13.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -c /Users/jhbuild/gtk/source/gnutls-3.7.3/lib/accelerated/aarch64/macosx/sha1-armv8.s -fno-common -DPIC -o macosx/.libs/sha1-armv8.o
../../../libtool: line 1760: 12279 Segmentation fault: 11 /Applications/Xcode13.app/Contents/Developer/usr/bin/gcc -Wa,-march=all -O2 -arch arm64 -I/Applications/Xcode13.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -isysroot /Applications/Xcode13.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -mmacosx-version-min=10.13 -c /Users/jhbuild/gtk/source/gnutls-3.7.3/lib/accelerated/aarch64/macosx/sha512-armv8.s -fno-common -DPIC -o macosx/.libs/sha512-armv8.o
make[5]: *** [Makefile:2243: macosx/sha256-armv8.lo] Error 1
make[5]: *** Waiting for unfinished jobs....
make[5]: *** [Makefile:2243: macosx/sha512-armv8.lo] Error 1
make[5]: *** [Makefile:2243: macosx/sha1-armv8.lo] Error 1
make[5]: Leaving directory '/Users/jhbuild/.cache/jhbuild/build/gnutls-3.7.3/lib/accelerated/aarch64'
make[4]: *** [Makefile:2236: all-recursive] Error 1
make[4]: Leaving directory '/Users/jhbuild/.cache/jhbuild/build/gnutls-3.7.3/lib/accelerated'
make[3]: *** [Makefile:2881: all-recursive] Error 1
make[3]: Leaving directory '/Users/jhbuild/.cache/jhbuild/build/gnutls-3.7.3/lib'
make[2]: *** [Makefile:2485: all] Error 2
make[2]: Leaving directory '/Users/jhbuild/.cache/jhbuild/build/gnutls-3.7.3/lib'
make[1]: *** [Makefile:2233: all-recursive] Error 1
make[1]: Leaving directory '/Users/jhbuild/.cache/jhbuild/build/gnutls-3.7.3'
make: *** [Makefile:2158: all] Error 2
*** Error during phase build of gnutls: ########## Error running make -j 9 *** [11/59]
I think I saw this reported somewhere (but can't find it now) and the issue was some bug in clang (plus some workaround which hasn't been applied to gtk-osx).
I hoped it would be fixed with XCode 14 but I get a different error this time:
CCAS macosx/sha1-armv8.lo
CCAS macosx/sha512-armv8.lo
CCAS macosx/sha256-armv8.lo
clang: error: the clang compiler does not support '-march=all'
clang: error: the clang compiler does not support '-march=all'
make[5]: *** [Makefile:2243: macosx/sha512-armv8.lo] Error 1
make[5]: *** Waiting for unfinished jobs....
clang: error: the clang compiler does not support '-march=all'
make[5]: *** [Makefile:2243: macosx/sha256-armv8.lo] Error 1
make[5]: *** [Makefile:2243: macosx/sha1-armv8.lo] Error 1
make[5]: Leaving directory '/Users/jhbuild/.cache/jhbuild/build/gnutls-3.7.3/lib/accelerated/aarch64'
make[4]: *** [Makefile:2236: all-recursive] Error 1
make[4]: Leaving directory '/Users/jhbuild/.cache/jhbuild/build/gnutls-3.7.3/lib/accelerated'
make[3]: *** [Makefile:2881: all-recursive] Error 1
make[3]: Leaving directory '/Users/jhbuild/.cache/jhbuild/build/gnutls-3.7.3/lib'
make[2]: *** [Makefile:2485: all] Error 2
make[2]: Leaving directory '/Users/jhbuild/.cache/jhbuild/build/gnutls-3.7.3/lib'
make[1]: *** [Makefile:2233: all-recursive] Error 1
make[1]: Leaving directory '/Users/jhbuild/.cache/jhbuild/build/gnutls-3.7.3'
make: *** [Makefile:2158: all] Error 2
*** Error during phase build of gnutls: ########## Error running make -j 9 *** [11/59]
I haven't tried whether a newer version of gnutls fixes it or not yet.
I found this https://stackoverflow.com/questions/72303819/c-clion-error-the-clang-compiler-does-not-support-march-core2 which could potentially also fix the problem (not sure if it's the right solution or not).