From c0a35998143e216136945d889c78357f1934633c Mon Sep 17 00:00:00 2001 From: yanghuatao Date: Wed, 24 Apr 2024 00:55:19 +0800 Subject: [PATCH] toolchain/ghs: Fix green hills toolchain build Vela "no storage class or type specifier" error "libcxxmini/libxx_cxa_guard.cxx", line 47: error #77-D: this declaration has no storage class or type specifier __extension__ typedef int __guard __attribute__((mode(__DI__))); ^ "libcxxmini/libxx_cxa_guard.cxx", line 47: error #65: expected a ";" __extension__ typedef int __guard __attribute__((mode(__DI__))); ^ "libcxxmini/libxx_cxa_guard.cxx", line 64: error #20: identifier "__guard" is undefined int __cxa_guard_acquire(FAR __guard *g) ^ "libcxxmini/libxx_cxa_guard.cxx", line 64: error #20: identifier "g" is undefined int __cxa_guard_acquire(FAR __guard *g) ^ "libcxxmini/libxx_cxa_guard.cxx", line 65: error #65: expected a ";" { ^ "libcxxmini/libxx_cxa_guard.cxx", line 93: warning #12-D: parsing restarts here after previous syntax error } Signed-off-by: yanghuatao --- include/nuttx/compiler.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/nuttx/compiler.h b/include/nuttx/compiler.h index c5610df5972cd..5f287297d465e 100644 --- a/include/nuttx/compiler.h +++ b/include/nuttx/compiler.h @@ -1110,6 +1110,14 @@ #endif +/* Green Hills Software definitions *****************************************/ + +#if defined(__ghs__) + +# define __extension__ + +#endif + #ifndef CONFIG_HAVE_LONG_LONG # undef CONFIG_FS_LARGEFILE #endif