Skip to content

Commit f5145db

Browse files
Zhiqiang-Hoummahadevan108
authored andcommitted
fsl_common_arm: Fix comment sign issue on different architectures
The comment sign character is '//' on ARMv8 AARCH64, however it's '@' on other ARM architectures. So the current definitions of AT_NONCACHEABLE_SECTION_ALIGN and AT_NONCACHEABLE_SECTION will result in the following error on AARCH64. /tmp/cc96AQ7j.s: Assembler messages: /tmp/cc96AQ7j.s:1020: Error: junk at end of line, first unrecognized character is `@' Signed-off-by: Hou Zhiqiang <[email protected]> Signed-off-by: Stephane Viau <[email protected]> Signed-off-by: Jiafei Pan <[email protected]>
1 parent 2f7652d commit f5145db

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

mcux/mcux-sdk-ng/drivers/common/fsl_common_arm.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,15 +474,21 @@ _Pragma("diag_suppress=Pm120")
474474
#endif
475475

476476
#elif (defined(__GNUC__)) || defined(DOXYGEN_OUTPUT)
477+
#if defined(__ARM_ARCH_8A__) /* This macro is ARMv8-A specific */
478+
#define MCUX_CS "//"
479+
#else
480+
#define MCUX_CS "@"
481+
#endif
482+
477483
/* For GCC, when the non-cacheable section is required, please define "__STARTUP_INITIALIZE_NONCACHEDATA"
478484
* in your projects to make sure the non-cacheable section variables will be initialized in system startup.
479485
*/
480486
#define AT_NONCACHEABLE_SECTION_INIT(var) __attribute__((section("NonCacheable.init"))) var
481487
#define AT_NONCACHEABLE_SECTION_ALIGN_INIT(var, alignbytes) \
482488
__attribute__((section("NonCacheable.init"))) var __attribute__((aligned(alignbytes)))
483-
#define AT_NONCACHEABLE_SECTION(var) __attribute__((section("NonCacheable,\"aw\",%nobits @"))) var
489+
#define AT_NONCACHEABLE_SECTION(var) __attribute__((section("NonCacheable,\"aw\",%nobits " MCUX_CS))) var
484490
#define AT_NONCACHEABLE_SECTION_ALIGN(var, alignbytes) \
485-
__attribute__((section("NonCacheable,\"aw\",%nobits @"))) var __attribute__((aligned(alignbytes)))
491+
__attribute__((section("NonCacheable,\"aw\",%nobits " MCUX_CS))) var __attribute__((aligned(alignbytes)))
486492
#else
487493
#error Toolchain not supported.
488494
#endif

0 commit comments

Comments
 (0)