This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 06/19] arm64:uapi: set __BITS_PER_LONG correctly for ILP32 and LP64
- From: Yury Norov <ynorov at caviumnetworks dot com>
- To: <arnd at arndb dot de>, <catalin dot marinas at arm dot com>, <linux-arm-kernel at lists dot infradead dot org>, <linux-kernel at vger dot kernel dot org>, <linux-doc at vger dot kernel dot org>, <linux-arch at vger dot kernel dot org>, <libc-alpha at sourceware dot org>
- Cc: <schwidefsky at de dot ibm dot com>, <heiko dot carstens at de dot ibm dot com>, <ynorov at caviumnetworks dot com>, <pinskia at gmail dot com>, <broonie at kernel dot org>, <joseph at codesourcery dot com>, <christoph dot muellner at theobroma-systems dot com>, <bamvor dot zhangjian at huawei dot com>, <szabolcs dot nagy at arm dot com>, <klimov dot linux at gmail dot com>, <Nathan_Lynch at mentor dot com>, <agraf at suse dot de>, <Prasun dot Kapoor at caviumnetworks dot com>, <kilobyte at angband dot pl>, <geert at linux-m68k dot org>, <philipp dot tomsich at theobroma-systems dot com>, <manuel dot montezelo at gmail dot com>, <linyongting at huawei dot com>, <maxim dot kuvyrkov at linaro dot org>, <davem at davemloft dot net>, Andrew Pinski <apinski at cavium dot com>
- Date: Sat, 18 Jun 2016 02:54:15 +0300
- Subject: [PATCH 06/19] arm64:uapi: set __BITS_PER_LONG correctly for ILP32 and LP64
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp dot mailfrom=Yuri dot Norov at caviumnetworks dot com;
- References: <1466207668-10549-1-git-send-email-ynorov at caviumnetworks dot com>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
From: Andrew Pinski <apinski@cavium.com>
Define __BITS_PER_LONG depending on the ABI used (i.e. check whether
__ILP32__ or __LP64__ is defined). This is necessary for glibc to
determine the appropriate type definitions for the system call interface.
Signed-off-by: Andrew Pinski <apinski@cavium.com>
Signed-off-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Signed-off-by: Christoph Muellner <christoph.muellner@theobroma-systems.com>
Signed-off-by: Yury Norov <ynorov@caviumnetworks.com>
Reviewed-by: David Daney <ddaney@caviumnetworks.com>
---
arch/arm64/include/uapi/asm/bitsperlong.h | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/include/uapi/asm/bitsperlong.h b/arch/arm64/include/uapi/asm/bitsperlong.h
index fce9c29..4265243 100644
--- a/arch/arm64/include/uapi/asm/bitsperlong.h
+++ b/arch/arm64/include/uapi/asm/bitsperlong.h
@@ -16,7 +16,14 @@
#ifndef __ASM_BITSPERLONG_H
#define __ASM_BITSPERLONG_H
-#define __BITS_PER_LONG 64
+#if defined(__LP64__)
+/* Assuming __LP64__ will be defined for native ELF64's and not for ILP32. */
+# define __BITS_PER_LONG 64
+#elif defined(__ILP32__)
+# define __BITS_PER_LONG 32
+#else
+# error "Neither LP64 nor ILP32: unsupported ABI in asm/bitsperlong.h"
+#endif
#include <asm-generic/bitsperlong.h>
--
2.7.4