From cd6a978ba95c86e7dda99dc38ea8bbf059843396 Mon Sep 17 00:00:00 2001 From: guoshichao Date: Mon, 17 Nov 2025 19:52:36 +0800 Subject: [PATCH] arm64_head.S: fix the asm code build error Add __ASSEMBLY__ protection in stddef.h and stdint.h to prevent assembly files from attempting to parse C typedef statements, which causes "unknown mnemonic" errors when assembly source includes these headers. the following are the detailed build error: /home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:167: Error: unknown mnemonic `typedef' -- `typedef _int8_t int8_t' /home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:168: Error: unknown mnemonic `typedef' -- `typedef _uint8_t uint8_t' /home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:170: Error: unknown mnemonic `typedef' -- `typedef _int16_t int16_t' /home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:171: Error: unknown mnemonic `typedef' -- `typedef _uint16_t uint16_t' /home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:178: Error: unknown mnemonic `typedef' -- `typedef _int32_t int32_t' /home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:179: Error: unknown mnemonic `typedef' -- `typedef _uint32_t uint32_t' /home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:193: Error: unknown mnemonic `typedef' -- `typedef _int8_t int_least8_t' /home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:194: Error: unknown mnemonic `typedef' -- `typedef _uint8_t uint_least8_t' /home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:196: Error: unknown mnemonic `typedef' -- `typedef _int16_t int_least16_t' /home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:197: Error: unknown mnemonic `typedef' -- `typedef _uint16_t uint_least16_t' /home/guoshichao/work_profile/vela_os/vela_open_source_trunk4/nuttx/include/stdint.h:203: Error: unknown mnemonic `typedef' -- `typedef _int32_t int_least24_t' Signed-off-by: guoshichao --- include/stddef.h | 4 ++++ include/stdint.h | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/include/stddef.h b/include/stddef.h index 85d5da51bd4..afe88c6d7f1 100644 --- a/include/stddef.h +++ b/include/stddef.h @@ -37,6 +37,8 @@ * Type Definitions ****************************************************************************/ +#ifndef __ASSEMBLY__ + /* The header shall define the following types: * * ptrdiff_t @@ -84,4 +86,6 @@ typedef struct #endif } max_align_t; +#endif /* __ASSEMBLY__ */ + #endif /* __INCLUDE_STDDEF_H */ diff --git a/include/stdint.h b/include/stdint.h index e14610ea146..0feaf403da6 100644 --- a/include/stdint.h +++ b/include/stdint.h @@ -156,6 +156,8 @@ * Public Types ****************************************************************************/ +#ifndef __ASSEMBLY__ + /* Exact-width integer types. NOTE that these types are defined in * architecture-specific logic with leading underscore character. This file * typedef's these to the final name without the underscore character. This @@ -254,5 +256,7 @@ typedef _uint_farptr_t uint_farptr_t; typedef _intmax_t intmax_t; typedef _uintmax_t uintmax_t; +#endif /* __ASSEMBLY__ */ + #endif /* CONFIG_ARCH_STDINT_H */ #endif /* __INCLUDE_STDINT_H */