From 5bb805b22992a36bafdc16b113085bcfe208d26c Mon Sep 17 00:00:00 2001 From: yanghuatao Date: Wed, 24 Apr 2024 00:13:06 +0800 Subject: [PATCH] toolchain/ghs: Fix green hills toolchain build Vela asarm errors common/gnu/fork.S 29: unknown instruction .syntax unified --^ [asarm] (error #2230) common/gnu/fork.S 81: bad directive .type up_fork , function ------------------^ [asarm] (error #2067) armv7-m/arm_saveusercontext.S 31: unknown instruction .syntax unified --^ [asarm] (error #2230) armv7-m/arm_saveusercontext.S 55: bad directive .type up_saveusercontext , % function --^ [asarm] (error #2004) armv7-m/arm_saveusercontext.S 65: not within valid register range str r12 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 4 ) ) ] ------^ [asarm] (error #2004) armv7-m/arm_saveusercontext.S 66: not within valid register range str r14 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 5 ) ) ] ------^ [asarm] (error #2004) armv7-m/arm_saveusercontext.S 67: not within valid register range str r14 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 6 ) ) ] ------^ [asarm] (error #2014) armv7-m/arm_saveusercontext.S 72: expected a register str r1 , [ r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 7 ) ) ] ------------------^ [asarm] (error #2004) armv7-m/arm_saveusercontext.S 75: not within valid register range add r1 , r0 , ( 4 * ( ( ( 12 ) + ( 16 ) ) + 8 ) ) -----------^ [asarm] (error #2071) armv7-m/arm_saveusercontext.S 89: bad parameter stmia r0 ! , { r2 - r11 } --------^ [asarm] (error #2014) armv7-m/arm_saveusercontext.S 93: expected a register mov r1 , - 1 -----------^ Signed-off-by: yanghuatao --- arch/arm/src/armv7-m/arm_exception.S | 9 ++++++++- arch/arm/src/armv7-m/arm_saveusercontext.S | 8 ++++++++ arch/arm/src/common/gnu/fork.S | 5 ++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/armv7-m/arm_exception.S b/arch/arm/src/armv7-m/arm_exception.S index d2478aadd2..4f057ae113 100644 --- a/arch/arm/src/armv7-m/arm_exception.S +++ b/arch/arm/src/armv7-m/arm_exception.S @@ -87,9 +87,12 @@ ****************************************************************************/ .globl exception_common - +#ifdef __ghs__ + .thumb2 +#else .syntax unified .thumb +#endif .file "arm_exception.S" /**************************************************************************** @@ -119,8 +122,12 @@ .text .section .text.exception_common +#ifdef __ghs__ + .type exception_common, $function +#else .thumb_func .type exception_common, function +#endif exception_common: mrs r0, ipsr /* R0=exception number */ diff --git a/arch/arm/src/armv7-m/arm_saveusercontext.S b/arch/arm/src/armv7-m/arm_saveusercontext.S index 58d02f575f..5e67be0e6c 100644 --- a/arch/arm/src/armv7-m/arm_saveusercontext.S +++ b/arch/arm/src/armv7-m/arm_saveusercontext.S @@ -28,8 +28,12 @@ .file "arm_saveusercontext.S" .text +#ifdef __ghs__ + .thumb2 +#else .syntax unified .thumb +#endif /**************************************************************************** * Public Functions @@ -52,7 +56,11 @@ .globl up_saveusercontext .globl up_saveusercontext +#ifdef __ghs__ + .type up_saveusercontext, $function +#else .type up_saveusercontext, %function +#endif up_saveusercontext: diff --git a/arch/arm/src/common/gnu/fork.S b/arch/arm/src/common/gnu/fork.S index 7697561a27..d98003d4da 100644 --- a/arch/arm/src/common/gnu/fork.S +++ b/arch/arm/src/common/gnu/fork.S @@ -26,7 +26,6 @@ #include "arm_fork.h" - .syntax unified .file "fork.S" /**************************************************************************** @@ -78,7 +77,11 @@ ****************************************************************************/ .globl up_fork +#ifdef __ghs__ + .type up_fork, $function +#else .type up_fork, function +#endif up_fork: /* Create a stack frame */