summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconfig.guess9
-rwxr-xr-xconfig.sub2
-rw-r--r--configure.ac12
3 files changed, 20 insertions, 3 deletions
diff --git a/config.guess b/config.guess
index 2d2680315..5893a8c34 100755
--- a/config.guess
+++ b/config.guess
@@ -173,6 +173,15 @@ EOF
;;
arm*-*-* | aarch64-*-*)
+ if [ $((uname -s) 2>/dev/null) = Darwin ]; then
+ case $(system_profiler SPHardwareDataType | grep Chip) in
+ *Apple\ M1)
+ exact_cpu="applem1";;
+ *Apple\ M2)
+ exact_cpu="applem2";;
+ esac
+ fi
+
cpu_code=`sed -n 's/^CPU part.*\(0x.*\)$/\1/p' /proc/cpuinfo 2>/dev/null | sort -r | head -n 1 2>/dev/null`
cpu_implementer=`sed -n 's/^CPU implementer.*\(0x.*\)$/\1/p' /proc/cpuinfo 2>/dev/null | head -n 1 2>/dev/null`
case "${cpu_implementer}_${cpu_code}" in
diff --git a/config.sub b/config.sub
index 8ec227f6a..d1b76f765 100755
--- a/config.sub
+++ b/config.sub
@@ -130,7 +130,7 @@ z900esa | z990esa | z9esa | z10esa | z196esa)
armsa1 | armxscale | arm9tdmi | arm9te | \
arm10* | arm11mpcore | armsa1 | arm1136 | arm1156 | arm1176 | \
armcortex[arm][0-9] | armcortex[arm][0-9][0-9] | \
-arm*neon | armxgene1 | armexynosm1 | armthunderx)
+arm*neon | armxgene1 | armexynosm1 | armthunderx | applem[1-9])
test_cpu="arm";;
*)
diff --git a/configure.ac b/configure.ac
index cafdb3c71..06df1ee10 100644
--- a/configure.ac
+++ b/configure.ac
@@ -612,7 +612,7 @@ case $host in
;;
- arm*-*-* | aarch64*-*-*)
+ arm*-*-* | aarch64*-*-* | [applem[1-9]-*-*])
abilist="32"
gcc_cflags="$gcc_cflags $fomit_frame_pointer"
gcc_cflags_optlist="arch fpmode neon tune"
@@ -778,6 +778,14 @@ case $host in
gcc_cflags_neon="-mfpu=neon"
gcc_cflags_tune=""
;;
+ [applem[1-9]*])
+ abilist="64"
+ path_64="arm64/applem1 arm64"
+ gcc_cflags_arch="-march=armv8-a"
+ gcc_cflags_neon="-mfpu=neon"
+ gcc_cflags_tune=""
+ CALLING_CONVENTIONS_OBJS=""
+ ;;
*)
path="arm"
gcc_cflags_arch="-march=armv4"
@@ -3696,7 +3704,7 @@ if test "$gmp_asm_syntax_testing" != no; then
GMP_ASM_ALIGN_LOG
case $host in
- arm*-*-* | aarch64*-*-*)
+ arm*-*-* | aarch64*-*-* | [applem[1-9]-*-*])
case $ABI in
32)
GMP_INCLUDE_MPN(arm/arm-defs.m4) ;;