Skip to contentSkip to conversation

kernel: syscall: Correctly check for x32

PATCH Applied Richard Weinberger 2 participants 2 messages Jun 11, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel: syscall: Correctly check for x32

Since 10.2 gcc it sets __ILP32__ even for i386.
To check for x32 we need to check for __x86_64__ being set too.

---
While x32 is gone in master, 3.x stable still has it. Without this patch it is not possible to build Xenomai for i386 with a recent gcc toolchain.

---
 kernel/cobalt/arch/x86/include/asm/xenomai/uapi/syscall.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/cobalt/arch/x86/include/asm/xenomai/uapi/syscall.h +1 -1
index aa9936dfd..1626430c1 100644
@@ -18,7 +18,7 @@
 #ifndef _COBALT_X86_ASM_UAPI_SYSCALL_H
 #define _COBALT_X86_ASM_UAPI_SYSCALL_H
 
-#ifdef __ILP32__
+#if defined(__x86_64__) && defined(__ILP32__)
 #define __xn_syscall_base  __COBALT_X32_BASE
 #else
 #define __xn_syscall_base  0
Signature · 1 line
2.17.1
Applied
#1 lore raw
Quoted 18 lines · Richard Weinberger via Xenomai

Since 10.2 gcc it sets __ILP32__ even for i386.
To check for x32 we need to check for __x86_64__ being set too.

---
While x32 is gone in master, 3.x stable still has it. Without this patch it is not possible to build Xenomai for i386 with a recent gcc toolchain.

---
 kernel/cobalt/arch/x86/include/asm/xenomai/uapi/syscall.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/cobalt/arch/x86/include/asm/xenomai/uapi/syscall.h +0 -0
index aa9936dfd..1626430c1 100644

kernel/cobalt/arch/x86/include/asm/xenomai/uapi/syscall.h line 24

Quoted 8 lines
kernel/cobalt/arch/x86/include/asm/xenomai/uapi/syscall.h +1 -1
@@ -18,7 +18,7 @@
 #ifndef _COBALT_X86_ASM_UAPI_SYSCALL_H
 #define _COBALT_X86_ASM_UAPI_SYSCALL_H
 
-#ifdef __ILP32__
+#if defined(__x86_64__) && defined(__ILP32__)
 #define __xn_syscall_base  __COBALT_X32_BASE
 #else
 #define __xn_syscall_base  0

Thanks, applied to stable/v3.1.x. No one should be doing gcc-10 with v3.0.x anymore...

Jan

Signature · 2 lines
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux