From 684882d90b01b28ec0c0091316aaf13b65e5784e 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/nuttx/compiler.h b/include/nuttx/compiler.h index c5610df5972cd..7ff4e25d33a33 100644 --- a/include/nuttx/compiler.h +++ b/include/nuttx/compiler.h @@ -1036,6 +1036,12 @@ # define no_builtin(n) +/* Green Hills Software definitions *****************************************/ + +#elif defined(__ghs__) + +# define __extension__ + /* Unknown compiler *********************************************************/ #else