diff options
author | Brian Behlendorf <[email protected]> | 2015-12-09 14:46:59 -0800 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2015-12-10 11:53:29 -0800 |
commit | 225c110675631ddb0673323ee33818586c25cd67 (patch) | |
tree | d6cedcace2fb983792ec922a561bcfe13fa83d6e | |
parent | c5a8b1e163179cadcf2c5f81b000bf7f86f41369 (diff) |
Either _ILP32 or _LP64 must be defined
For some arm, powerpc, and sparc platforms it was possible that
neither _ILP32 of _LP64 would be defined. Update the isa_defs.h
header to explicitly set these macros and generate a compile error
in the case neither are defined.
Signed-off-by: Brian Behlendorf <[email protected]>
Signed-off-by: tuxoko <[email protected]>
Issue zfsonlinux/zfs#4048
-rw-r--r-- | include/sys/isa_defs.h | 42 |
1 files changed, 31 insertions, 11 deletions
diff --git a/include/sys/isa_defs.h b/include/sys/isa_defs.h index aa5ae43c2..49fe773d4 100644 --- a/include/sys/isa_defs.h +++ b/include/sys/isa_defs.h @@ -60,7 +60,7 @@ #endif /* powerpc (ppc64) arch specific defines */ -#elif defined(__powerpc) || defined(__powerpc__) +#elif defined(__powerpc) || defined(__powerpc__) || defined(__powerpc64__) #if !defined(__powerpc) #define __powerpc @@ -70,9 +70,15 @@ #define __powerpc__ #endif +#if defined(__powerpc64__) #if !defined(_LP64) #define _LP64 #endif +#else +#if !defined(_ILP32) +#define _ILP32 +#endif +#endif /* arm arch specific defines */ #elif defined(__arm) || defined(__arm__) || defined(__aarch64__) @@ -85,6 +91,16 @@ #define __arm__ #endif +#if defined(__aarch64__) +#if !defined(_LP64) +#define _LP64 +#endif +#else +#if !defined(_ILP32) +#define _ILP32 +#endif +#endif + #if defined(__ARMEL__) || defined(__AARCH64EL__) #define _LITTLE_ENDIAN #else @@ -102,18 +118,18 @@ #define __sparc__ #endif -#define _BIG_ENDIAN -#define _SUNOS_VTOC_16 - -/* sparc64 arch specific defines */ -#elif defined(__sparc64) || defined(__sparc64__) - -#if !defined(__sparc64) -#define __sparc64 +#if !defined(_ILP32) +#define _ILP32 #endif -#if !defined(__sparc64__) -#define __sparc64__ +#if defined(__arch64__) +#if !defined(_LP64) +#define _LP64 +#endif +#else +#if !defined(_ILP32) +#define _ILP32 +#endif #endif #define _BIG_ENDIAN @@ -127,6 +143,10 @@ #error "Both _ILP32 and _LP64 are defined" #endif +#if !defined(_ILP32) && !defined(_LP64) +#error "Neither _ILP32 or _LP64 are defined" +#endif + #include <sys/byteorder.h> #if defined(__LITTLE_ENDIAN) && !defined(_LITTLE_ENDIAN) |