diff mbox

[RFC,v6,00/17] ILP32 for ARM64

Message ID 20151109160441.GA6451@yury-N73SV (mailing list archive)
State New, archived
Headers show

Commit Message

Yury Norov Nov. 9, 2015, 4:04 p.m. UTC
On Mon, Nov 09, 2015 at 06:50:42PM +0300, Yury Norov wrote:
> On Mon, Nov 09, 2015 at 10:52:32PM +0800, pinskia@gmail.com wrote:
> > 
> > 
> > > On Nov 9, 2015, at 10:36 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> > > 
> > >> On Monday 09 November 2015 15:33:51 Andreas Schwab wrote:
> > >> Arnd Bergmann <arnd@arndb.de> writes:
> > >> 
> > >>>> On Monday 09 November 2015 14:23:59 Andreas Schwab wrote:
> > >>>> Yury Norov <ynorov@caviumnetworks.com> writes:
> > >>>> 
> > >>>>> This is what I run:
> > >>>>> https://github.com/norov/glibc/tree/thunderx-ilp32-32time_toff_t
> > >>>> 
> > >>>> That doesn't work for me:
> > >>>> 
> > >>>> ../sysdeps/unix/sysv/linux/generic/sysdep.h:24:22: error: ‘__NR_llseek’ undeclar
> > >>>> ed (first use in this function)
> > >>>> ../sysdeps/unix/sysv/linux/aarch64/sysdep.h:41:32: error: ‘__NR_fcntl64’ undeclared (first use in this function)
> > >>> 
> > >>> Did you re-export the kernel headers that you use as the base?
> > >> 
> > >> I'm using the patched 4.3 kernel headers.
> > > 
> > > Ok.
> > > 
> > >> Why is <asm/bitsperlong.h> defining __BITS_PER_LONG to 64 unconditionally?
> > > 
> > > It should not, that is a bug. I don't know how Yury built his glibc,
> > > but it can't work if __BITS_PER_LONG is wrong.
> > 
> > 
> > Looks like I had changed the header file manually for building glibc and Yury and myself missed that when  he updated the patches. 
> > 
> > 
> > Thanks,
> > Andrew
> > 
> > > 
> > >    Arnd
> 
> 
> No, it's my fault. I forgot to add a patch that sets __BITS_PER_LONG
> to 32. I'll send it here now.
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
diff mbox

Patch

From 529d30309769b0c9a40d0a4bd78ad54e8faec105 Mon Sep 17 00:00:00 2001
From: Andrew Pinski <apinski@cavium.com>
Date: Tue, 25 Aug 2015 02:26:54 +0300
Subject: [PATCH] arm64:uapi: set __BITS_PER_LONG correctly for ILP32 and LP64

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: 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>
---
 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>
 
-- 
1.9.1