This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit 59b47cf3f4c22cbeb402180c063f093336aa5d18
Author: Marco Casaroli <[email protected]>
AuthorDate: Sun Jul 26 17:24:57 2026 +0200

    arch/x86_64: define the missing CONFIG_ARCH_HAVE_SYSCALL.
    
    794c325947 ("arch/x64:Syscall support is enabled by default", 2025-05-27)
    changed nine guards from CONFIG_LIB_SYSCALL to CONFIG_ARCH_HAVE_SYSCALL but
    never added the Kconfig symbol.  Only ARCH_HAVE_SYSCALL_HOOKS exists in 
tree;
    ARCH_HAVE_SYSCALL itself is defined nowhere, so it is always unset and since
    that commit x86_64 has had no x86_64_syscall_entry(), no x86_64_syscall(), 
no
    IA32_LSTAR/IA32_STAR programming and no syscall stub layer in any
    configuration:
    
      arch/x86_64/src/common/Make.defs:37     x86_64_syscall.c not compiled
      arch/x86_64/src/common/CMakeLists.txt:41           likewise
      arch/x86_64/include/irq.h:86
      arch/x86_64/src/intel64/intel64_cpu.c:247, :386
      arch/x86_64/src/intel64/intel64_head.S:83, :351, :538
      arch/x86_64/src/intel64/intel64_saveusercontext.S:108
    
    qemu-intel64:knsh_romfs and qemu-intel64:knsh_romfs_pci are the two
    CONFIG_BUILD_KERNEL configurations in tree, and neither can have worked in
    that time.  They still link -- nothing references the missing pieces, so
    libstubs.a is simply never pulled in -- and then die the first time user 
code
    executes SYSCALL.
    
    Define the symbol with the condition the code had before that commit, which
    is LIB_SYSCALL:  every protected and every kernel build needs the interface,
    and a flat build is left exactly as it is today.
    
    Impact: restores the system call interface for CONFIG_BUILD_KERNEL and
    CONFIG_BUILD_PROTECTED on x86_64.  CONFIG_BUILD_FLAT is unaffected --
    qemu-intel64:nsh still builds with ARCH_HAVE_SYSCALL unset.
    
    Assisted-by: Claude:claude-opus-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 arch/Kconfig | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/Kconfig b/arch/Kconfig
index 0085b50d1ad..ab0a0c066c7 100644
--- a/arch/Kconfig
+++ b/arch/Kconfig
@@ -151,6 +151,7 @@ config ARCH_X86_64
        select ARCH_HAVE_SETJMP
        select ARCH_HAVE_PERF_EVENTS
        select ARCH_HAVE_POWEROFF
+       select ARCH_HAVE_SYSCALL if LIB_SYSCALL
        ---help---
                x86-64 architectures.
 
@@ -611,6 +612,12 @@ config ARCH_HAVE_RTC_SUBSECONDS
        bool
        default n
 
+config ARCH_HAVE_SYSCALL
+       bool
+       default n
+       ---help---
+               Indicates that the architecture provides the system call 
interface.
+
 config ARCH_HAVE_SYSCALL_HOOKS
        bool
        default n

Reply via email to