From 4c7c70c7c23c86836bb96e793e76c79f44784c07 Mon Sep 17 00:00:00 2001 From: John Paul Adrian Glaubitz Date: Thu, 2 Mar 2017 01:50:36 +0100 Subject: [PATCH] basic/architecture: Properly set LIB_ARCH_TUPLE for x32 On x86_64, there are two possible ABIs and hence values for LIB_ARCH_TUPLE. The convential 64-bit type and the 32-bit variant, called x32. The latter can be detected by checking whether __ILP32__ is defined. --- src/basic/architecture.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/basic/architecture.h b/src/basic/architecture.h index 46883719d1..d07bc411e5 100644 --- a/src/basic/architecture.h +++ b/src/basic/architecture.h @@ -79,7 +79,11 @@ int uname_architecture(void); #if defined(__x86_64__) # define native_architecture() ARCHITECTURE_X86_64 -# define LIB_ARCH_TUPLE "x86_64-linux-gnu" +# if defined(__ILP32__) +# define LIB_ARCH_TUPLE "x86_64-linux-gnux32" +# else +# define LIB_ARCH_TUPLE "x86_64-linux-gnu" +# endif # define SECONDARY_ARCHITECTURE ARCHITECTURE_X86 #elif defined(__i386__) # define native_architecture() ARCHITECTURE_X86