Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98e5272f authored by H.J. Lu's avatar H.J. Lu Committed by H. Peter Anvin
Browse files

x32: Check __ILP32__ instead of __LP64__ for x32

Check __LP64__ isn't a reliable way to tell if we are compiling for x32
since __LP64__ isnn't specified by x86-64 psABI.  Not all x86-64
compilers define __LP64__, which was added to GCC 3.3. The updated x32
psABI:

https://sites.google.com/site/x32abi/documents



definse _ILP32 and __ILP32__ for x32.  GCC trunk and 4.7 branch have
been updated to define _ILP32 and __ILP32__ for x32.  This patch
replaces __LP64__ check with __ILP32__.

Signed-off-by: default avatarH.J. Lu <hjl.tools@gmail.com>
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
parent cd74257b
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -7,9 +7,9 @@
#else
#else
# ifdef __i386__
# ifdef __i386__
#  include "posix_types_32.h"
#  include "posix_types_32.h"
# elif defined(__LP64__)
# elif defined(__ILP32__)
#  include "posix_types_64.h"
# else
#  include "posix_types_x32.h"
#  include "posix_types_x32.h"
# else
#  include "posix_types_64.h"
# endif
# endif
#endif
#endif
+1 −1
Original line number Original line Diff line number Diff line
@@ -257,7 +257,7 @@ struct sigcontext {
	__u64 oldmask;
	__u64 oldmask;
	__u64 cr2;
	__u64 cr2;
	struct _fpstate __user *fpstate;	/* zero when no FPU context */
	struct _fpstate __user *fpstate;	/* zero when no FPU context */
#ifndef __LP64__
#ifdef __ILP32__
	__u32 __fpstate_pad;
	__u32 __fpstate_pad;
#endif
#endif
	__u64 reserved1[8];
	__u64 reserved1[8];
+3 −3
Original line number Original line Diff line number Diff line
@@ -63,10 +63,10 @@
#else
#else
# ifdef __i386__
# ifdef __i386__
#  include <asm/unistd_32.h>
#  include <asm/unistd_32.h>
# elif defined(__LP64__)
# elif defined(__ILP32__)
#  include <asm/unistd_64.h>
# else
#  include <asm/unistd_x32.h>
#  include <asm/unistd_x32.h>
# else
#  include <asm/unistd_64.h>
# endif
# endif
#endif
#endif