Skip to content

Commit

Permalink
Correctly handle the x32 ABI
Browse files Browse the repository at this point in the history
__x86_64__ && _ILP32 => don't forcibly define _LP64

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Ryan Moeller <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes openzfs#10357
Closes openzfs#844
  • Loading branch information
nabijaczleweli authored and jsai20 committed Mar 30, 2021
1 parent 9f2f7af commit 7199f1e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion include/os/linux/spl/sys/isa_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,13 @@
#define __x86
#endif

#if defined(_ILP32)
/* x32-specific defines; careful to *not* define _LP64 here */
#else
#if !defined(_LP64)
#define _LP64
#endif
#endif

#define _ALIGNMENT_REQUIRED 1

Expand Down Expand Up @@ -216,7 +220,7 @@
#else
/*
* Currently supported:
* x86_64, i386, arm, powerpc, s390, sparc, mips, and RV64G
* x86_64, x32, i386, arm, powerpc, s390, sparc, mips, and RV64G
*/
#error "Unsupported ISA type"
#endif
Expand Down
6 changes: 5 additions & 1 deletion lib/libspl/include/sys/isa_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,13 @@ extern "C" {
#define __x86
#endif

#if defined(_ILP32)
/* x32-specific defines; careful to *not* define _LP64 here */
#else
#if !defined(_LP64)
#define _LP64
#endif
#endif

#if !defined(_LITTLE_ENDIAN)
#define _LITTLE_ENDIAN
Expand Down Expand Up @@ -214,7 +218,7 @@ extern "C" {
#else
/*
* Currently supported:
* x86_64, i386, arm, powerpc, s390, sparc, mips, and RV64G
* x86_64, x32, i386, arm, powerpc, s390, sparc, mips, and RV64G
*/
#error "Unsupported ISA type"
#endif
Expand Down

0 comments on commit 7199f1e

Please sign in to comment.