From 50549d90ab79eb0d2a5e9bebe633314d7ad54434 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 9 Jun 2017 01:26:28 +0200 Subject: [PATCH] host-cpu-c-abi: Support for aarch64 ILP32 ABI. * m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI): Recognize the aarch64 ILP32 ABI. Set HOST_CPU_C_ABI=arm64-ilp32 and define __arm64_ilp32__ in this case. --- ChangeLog | 7 +++++++ m4/host-cpu-c-abi.m4 | 19 +++++++++++++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 77ef3bfef7..19fa986e47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2017-06-08 Bruno Haible + + host-cpu-c-abi: Support for aarch64 ILP32 ABI. + * m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI): Recognize the aarch64 ILP32 + ABI. Set HOST_CPU_C_ABI=arm64-ilp32 and define __arm64_ilp32__ in this + case. + 2017-06-08 Paul Eggert doc: remove robots, add prereqs diff --git a/m4/host-cpu-c-abi.m4 b/m4/host-cpu-c-abi.m4 index 1ec2f74637..a3a3d431a4 100644 --- a/m4/host-cpu-c-abi.m4 +++ b/m4/host-cpu-c-abi.m4 @@ -1,4 +1,4 @@ -# host-cpu-c-abi.m4 serial 3 +# host-cpu-c-abi.m4 serial 4 dnl Copyright (C) 2002-2017 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -89,13 +89,21 @@ changequote([,])dnl arm* | aarch64 ) # Assume arm with EABI. - # On arm64, the C compiler may be generating 64-bit (= aarch64) code - # or 32-bit (= arm) code. + # On arm64 systems, the C compiler may be generating code in one of + # these ABIs: + # - aarch64 instruction set, 64-bit pointers, 64-bit 'long': arm64. + # - aarch64 instruction set, 32-bit pointers, 32-bit 'long': arm64-ilp32. + # - 32-bit instruction set, 32-bit pointers, 32-bit 'long': arm or armhf. AC_EGREP_CPP([yes], [#if defined(__aarch64__) || defined(__ARM_64BIT_STATE) || defined(__ARM_PCS_AAPCS64) yes #endif], - [gl_cv_host_cpu_c_abi=arm64], + [AC_EGREP_CPP([yes], + [#if defined __ILP32__ || defined _ILP32 + yes + #endif], + [gl_cv_host_cpu_c_abi=arm64-ilp32], + [gl_cv_host_cpu_c_abi=arm64])], [# Don't distinguish little-endian and big-endian arm, since they # don't require different machine code for simple operations and # since the user can distinguish them through the preprocessot @@ -242,6 +250,9 @@ EOF #ifndef __armhf__ #undef __armhf__ #endif +#ifndef __arm64_ilp32__ +#undef __arm64_ilp32__ +#endif #ifndef __arm64__ #undef __arm64__ #endif -- 2.39.5