]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic/architecture: Properly set LIB_ARCH_TUPLE for x32
authorJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Thu, 2 Mar 2017 00:50:36 +0000 (01:50 +0100)
committerJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Thu, 2 Mar 2017 00:50:36 +0000 (01:50 +0100)
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

index 46883719d16c3314ccb6e4e508a8d25467637951..d07bc411e58b7522291881fd5c36fedbbbb19628 100644 (file)
@@ -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