[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
host-cpu-c-abi: detect ILP32 ABI on IA-64
From: |
Bruno Haible |
Subject: |
host-cpu-c-abi: detect ILP32 ABI on IA-64 |
Date: |
Sun, 30 Jul 2017 12:41:54 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-83-generic; KDE/5.18.0; x86_64; ; ) |
The ILP32 ABI on IA-64 is like the x32 ABI on x86_64, or the n32 ABI on mips64.
It exists only on HP-UX.
2017-07-30 Bruno Haible <address@hidden>
host-cpu-c-abi: Detect ILP32 ABI on IA-64 HP-UX.
* m4/host-cpu-c-abi.m4 (gl_HOST_CPU_C_ABI): Distinguish ia64-ilp32
from ia64. For arm64, test only __aarch64__, as __ARM_64BIT_STATE and
__ARM_PCS_AAPCS64 are not reliable indicators: they are not defined on
Ubuntu 14.04 (gcc 4.8.4) and Debian 8 (gcc 4.9.2).
diff --git a/m4/host-cpu-c-abi.m4 b/m4/host-cpu-c-abi.m4
index 3017f6c..01c5a66 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 5
+# host-cpu-c-abi.m4 serial 6
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,
@@ -95,7 +95,7 @@ changequote([,])dnl
# - 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)
+ [#if defined __aarch64__
yes
#endif],
[AC_EGREP_CPP([yes],
@@ -106,13 +106,13 @@ changequote([,])dnl
[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
+ # since the user can distinguish them through the preprocessor
# defines __ARMEL__ vs. __ARMEB__.
# But distinguish arm which passes floating-point arguments and
# return values in integer registers (r0, r1, ...) - this is
# gcc -mfloat-abi=soft or gcc -mfloat-abi=softfp - from arm which
# passes them in float registers (s0, s1, ...) and double registers
- # (d0, d1, ...) - rhis is gcc -mfloat-abi=hard. GCC 4.6 or newer
+ # (d0, d1, ...) - this is gcc -mfloat-abi=hard. GCC 4.6 or newer
# sets the preprocessor defines __ARM_PCS (for the first case) and
# __ARM_PCS_VFP (for the second case), but older GCC does not.
echo 'double ddd; void func (double dd) { ddd = dd; }' > conftest.c
@@ -138,6 +138,17 @@ changequote([,])dnl
[gl_cv_host_cpu_c_abi=hppa])
;;
+ ia64* )
+ # On ia64 on HP-UX, the C compiler may be generating 64-bit code or
+ # 32-bit code. In the latter case, it defines _ILP32.
+ AC_EGREP_CPP([yes],
+ [#if defined _ILP32
+ yes
+ #endif],
+ [gl_cv_host_cpu_c_abi=ia64-ilp32],
+ [gl_cv_host_cpu_c_abi=ia64])
+ ;;
+
mips* )
# We should also check for (_MIPS_SZPTR == 64), but gcc keeps this
# at 32.
@@ -262,6 +273,9 @@ EOF
#ifndef __hppa64__
#undef __hppa64__
#endif
+#ifndef __ia64_ilp32__
+#undef __ia64_ilp32__
+#endif
#ifndef __ia64__
#undef __ia64__
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- host-cpu-c-abi: detect ILP32 ABI on IA-64,
Bruno Haible <=