Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用__clang__代替__CLANG_ARM #62

Merged
merged 1 commit into from
Jul 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cm_backtrace/cm_backtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
#error "must be C99 or higher. try to add '-std=c99' to compile parameters"
#endif

#if defined(__CC_ARM) || defined(__CLANG_ARM)
#if defined(__ARMCC_VERSION)
#define SECTION_START(_name_) _name_##$$Base
#define SECTION_END(_name_) _name_##$$Limit
#define IMAGE_SECTION_START(_name_) Image$$##_name_##$$Base
Expand Down Expand Up @@ -145,7 +145,7 @@ void cm_backtrace_init(const char *firmware_name, const char *hardware_ver, cons
strncpy(hw_ver, hardware_ver, CMB_NAME_MAX);
strncpy(sw_ver, software_ver, CMB_NAME_MAX);

#if defined(__CC_ARM) || defined(__CLANG_ARM)
#if defined(__ARMCC_VERSION)
main_stack_start_addr = (uint32_t)&CSTACK_BLOCK_START(CMB_CSTACK_BLOCK_NAME);
main_stack_size = (uint32_t)&CSTACK_BLOCK_END(CMB_CSTACK_BLOCK_NAME) - main_stack_start_addr;
code_start_addr = (uint32_t)&CODE_SECTION_START(CMB_CODE_SECTION_NAME);
Expand Down
6 changes: 3 additions & 3 deletions cm_backtrace/cmb_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#endif


#if defined(__CC_ARM) || defined(__CLANG_ARM)
#if defined(__ARMCC_VERSION)
/* C stack block name, default is STACK */
#ifndef CMB_CSTACK_BLOCK_NAME
#define CMB_CSTACK_BLOCK_NAME STACK
Expand Down Expand Up @@ -301,7 +301,7 @@ if (!(EXPR)) \
}

/* ELF(Executable and Linking Format) file extension name for each compiler */
#if defined(__CC_ARM) || defined(__CLANG_ARM)
#if defined(__ARMCC_VERSION)
#define CMB_ELF_FILE_EXTENSION_NAME ".axf"
#elif defined(__ICCARM__)
#define CMB_ELF_FILE_EXTENSION_NAME ".out"
Expand Down Expand Up @@ -355,7 +355,7 @@ if (!(EXPR)) \
mov r0, sp
bx lr
}
#elif defined(__CLANG_ARM)
#elif defined(__clang__)
__attribute__( (always_inline) ) static __inline uint32_t cmb_get_msp(void) {
uint32_t result;
__asm volatile ("mrs %0, msp" : "=r" (result) );
Expand Down