I tried to build libgcrypt on macOS for ARM64 ("Apple Silicon"), using clang (the default compiler shipped with XCode). I cross-compile on x86_64 for arm using --host=aarch64-apple-darwin
The build fails with the following error:
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I.. -I../src -I../src -I/Users/patrick/gnupg22/distarm64/include -Ofast -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -arch arm64 -Ofast -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -MT mpih-add1-asm.lo -MD -MP -MF .deps/mpih-add1-asm.Tpo -c -o mpih-add1-asm.lo mpih-add1-asm.S libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.. -I../src -I../src -I/Users/patrick/gnupg22/distarm64/include -Ofast -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -arch arm64 -Ofast -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.0.sdk -MT mpih-add1-asm.lo -MD -MP -MF .deps/mpih-add1-asm.Tpo -c mpih-add1-asm.S -fno-common -DPIC -o .libs/mpih-add1-asm.o mpih-add1-asm.S:37:1: error: unknown directive .type _gcry_mpih_add_n,%function ^ mpih-add1-asm.S:71:1: error: unknown directive .size _gcry_mpih_add_n,.-_gcry_mpih_add_n; ^ make[2]: *** [mpih-add1-asm.lo] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2
The build succeeds using --disable-adm but I'm not sure about the negative performance impact.