From dd8b630b0dfe38935749f0ac3d89e11a9843e4d1 Mon Sep 17 00:00:00 2001 From: guoshichao Date: Thu, 20 Jun 2024 14:58:19 +0800 Subject: [PATCH] nuttx: add GREENHILLS compiler config option Signed-off-by: guoshichao --- arch/Kconfig | 4 ++++ arch/arm/Kconfig | 4 ++++ tools/incdir.c | 11 +++++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index 074067a333..522a5efae2 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -286,6 +286,10 @@ config ARCH_TOOLCHAIN_TASKING bool default n +config ARCH_TOOLCHAIN_GHS + bool + default n + config ARCH_GNU_NO_WEAKFUNCTIONS bool depends on ARCH_TOOLCHAIN_GNU diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index bc3fd6a066..a81ce59bc9 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -47,6 +47,10 @@ config ARM_TOOLCHAIN_ARMCLANG bool "ARM Compiler Clang toolchain" select ARCH_TOOLCHAIN_CLANG +config ARM_TOOLCHAIN_GHS + bool "ARM Compiler Green Hills Software toolchain" + select ARCH_TOOLCHAIN_GHS + endchoice # ARM Toolchain Selection choice diff --git a/tools/incdir.c b/tools/incdir.c index 8d9e338329..15d9b91cd6 100644 --- a/tools/incdir.c +++ b/tools/incdir.c @@ -68,7 +68,8 @@ enum compiler_e COMPILER_MINGW, COMPILER_SDCC, COMPILER_ZDSII, - COMPILER_TASKING + COMPILER_TASKING, + COMPILER_GHS }; /**************************************************************************** @@ -191,6 +192,11 @@ static enum compiler_e get_compiler(char *ccname) { return COMPILER_SDCC; } + else if (strstr(ccname, "ccarm") != NULL || + strstr(ccname, "cxarm") != NULL) + { + return COMPILER_GHS; + } else if (strstr(ccname, "mingw") != NULL) { return COMPILER_MINGW; @@ -352,7 +358,8 @@ int main(int argc, char **argv, char **envp) wintool = true; #endif } - else if (compiler == COMPILER_SDCC || compiler == COMPILER_TASKING) + else if (compiler == COMPILER_SDCC || compiler == COMPILER_TASKING || + compiler == COMPILER_GHS) { cmdarg = "-I"; }