From b98a0ba804f388f531106ff9602eb22ee66fe751 Mon Sep 17 00:00:00 2001 From: Bernard Xiong Date: Sun, 23 Sep 2018 12:08:44 +0800 Subject: [Kernel] Add ARMCC 6.x support. --- components/finsh/shell.c | 8 +++----- components/libc/compilers/armlibc/mem_std.c | 3 +++ components/libc/compilers/armlibc/stubs.c | 4 ++++ components/net/lwip-2.0.2/src/arch/include/arch/cc.h | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) (limited to 'components') diff --git a/components/finsh/shell.c b/components/finsh/shell.c index ccd5b97306..441f6c3241 100644 --- a/components/finsh/shell.c +++ b/components/finsh/shell.c @@ -55,7 +55,9 @@ static struct rt_thread finsh_thread; ALIGN(RT_ALIGN_SIZE) static char finsh_thread_stack[FINSH_THREAD_STACK_SIZE]; +struct finsh_shell _shell; #endif + struct finsh_shell *shell; static char *finsh_prompt_custom = RT_NULL; @@ -473,9 +475,6 @@ static void shell_push_history(struct finsh_shell *shell) } #endif -#ifndef RT_USING_HEAP -struct finsh_shell _shell; -#endif void finsh_thread_entry(void *parameter) { char ch; @@ -792,7 +791,7 @@ int finsh_system_init(void) rt_thread_t tid; #ifdef FINSH_USING_SYMTAB -#ifdef __CC_ARM /* ARM C Compiler */ +#if defined(__CC_ARM) || defined(__CLANG_ARM) /* ARM C Compiler */ extern const int FSymTab$$Base; extern const int FSymTab$$Limit; extern const int VSymTab$$Base; @@ -867,4 +866,3 @@ int finsh_system_init(void) return 0; } INIT_APP_EXPORT(finsh_system_init); - diff --git a/components/libc/compilers/armlibc/mem_std.c b/components/libc/compilers/armlibc/mem_std.c index 138ebe9773..4393b5f2af 100644 --- a/components/libc/compilers/armlibc/mem_std.c +++ b/components/libc/compilers/armlibc/mem_std.c @@ -16,8 +16,11 @@ #include "rtthread.h" #ifdef RT_USING_HEAP + +#ifdef __CC_ARM /* avoid the heap and heap-using library functions supplied by arm */ #pragma import(__use_no_heap) +#endif void *malloc(size_t n) { diff --git a/components/libc/compilers/armlibc/stubs.c b/components/libc/compilers/armlibc/stubs.c index b292cd7629..c826c8a0ec 100644 --- a/components/libc/compilers/armlibc/stubs.c +++ b/components/libc/compilers/armlibc/stubs.c @@ -37,7 +37,11 @@ #include "dfs_posix.h" #endif +#ifdef __CLANG_ARM +__asm(".global __use_no_semihosting\n\t"); +#else #pragma import(__use_no_semihosting_swi) +#endif /* Standard IO device handles. */ #define STDIN 0 diff --git a/components/net/lwip-2.0.2/src/arch/include/arch/cc.h b/components/net/lwip-2.0.2/src/arch/include/arch/cc.h index 1875d9ab00..77a589276a 100644 --- a/components/net/lwip-2.0.2/src/arch/include/arch/cc.h +++ b/components/net/lwip-2.0.2/src/arch/include/arch/cc.h @@ -46,7 +46,7 @@ #define X32_F "lx" #ifdef RT_USING_LIBC -#if defined(__CC_ARM) || defined(__IAR_SYSTEMS_ICC__) +#if defined(__CC_ARM) || defined(__CLANG_ARM) || defined(__IAR_SYSTEMS_ICC__) #include #else #include -- cgit v1.3.1