Skip to content

Commit

Permalink
x32: Check __ILP32__ instead of __LP64__ for x32
Browse files Browse the repository at this point in the history
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: H.J. Lu <hjl.tools@gmail.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
  • Loading branch information
H.J. Lu authored and H. Peter Anvin committed Apr 23, 2012
1 parent cd74257 commit 98e5272
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions arch/x86/include/asm/posix_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#else
# ifdef __i386__
# include "posix_types_32.h"
# elif defined(__LP64__)
# include "posix_types_64.h"
# else
# elif defined(__ILP32__)
# include "posix_types_x32.h"
# else
# include "posix_types_64.h"
# endif
#endif
2 changes: 1 addition & 1 deletion arch/x86/include/asm/sigcontext.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ struct sigcontext {
__u64 oldmask;
__u64 cr2;
struct _fpstate __user *fpstate; /* zero when no FPU context */
#ifndef __LP64__
#ifdef __ILP32__
__u32 __fpstate_pad;
#endif
__u64 reserved1[8];
Expand Down
6 changes: 3 additions & 3 deletions arch/x86/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@
#else
# ifdef __i386__
# include <asm/unistd_32.h>
# elif defined(__LP64__)
# include <asm/unistd_64.h>
# else
# elif defined(__ILP32__)
# include <asm/unistd_x32.h>
# else
# include <asm/unistd_64.h>
# endif
#endif

Expand Down

0 comments on commit 98e5272

Please sign in to comment.