From 6059f3a1f6950bd2aa9724ab917f2bc01343a076 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=D0=BD=D0=B0=D0=B1?= Date: Mon, 18 May 2020 00:00:49 +0200 Subject: [PATCH] Correctly handle the x32 ABI MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit __x86_64__ && _ILP32 => don't forcibly define _LP64 Reviewed-by: Brian Behlendorf Reviewed-by: Ryan Moeller Signed-off-by: Ahelenia Ziemiańska Closes #10357 Closes #844 --- include/os/linux/spl/sys/isa_defs.h | 6 +++++- lib/libspl/include/sys/isa_defs.h | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/include/os/linux/spl/sys/isa_defs.h b/include/os/linux/spl/sys/isa_defs.h index e36afef314e..c19943b8524 100644 --- a/include/os/linux/spl/sys/isa_defs.h +++ b/include/os/linux/spl/sys/isa_defs.h @@ -40,9 +40,13 @@ #define __x86 #endif +#if defined(_ILP32) +/* x32-specific defines; careful to *not* define _LP64 here */ +#else #if !defined(_LP64) #define _LP64 #endif +#endif #define _ALIGNMENT_REQUIRED 1 @@ -216,7 +220,7 @@ #else /* * Currently supported: - * x86_64, i386, arm, powerpc, s390, sparc, mips, and RV64G + * x86_64, x32, i386, arm, powerpc, s390, sparc, mips, and RV64G */ #error "Unsupported ISA type" #endif diff --git a/lib/libspl/include/sys/isa_defs.h b/lib/libspl/include/sys/isa_defs.h index 18a41fef98f..4d2d909f3e8 100644 --- a/lib/libspl/include/sys/isa_defs.h +++ b/lib/libspl/include/sys/isa_defs.h @@ -46,9 +46,13 @@ extern "C" { #define __x86 #endif +#if defined(_ILP32) +/* x32-specific defines; careful to *not* define _LP64 here */ +#else #if !defined(_LP64) #define _LP64 #endif +#endif #if !defined(_LITTLE_ENDIAN) #define _LITTLE_ENDIAN @@ -214,7 +218,7 @@ extern "C" { #else /* * Currently supported: - * x86_64, i386, arm, powerpc, s390, sparc, mips, and RV64G + * x86_64, x32, i386, arm, powerpc, s390, sparc, mips, and RV64G */ #error "Unsupported ISA type" #endif -- 2.45.0