Skip to content

Commit

Permalink
application: -fno-tree-tail-merge is only for gcc not for clang
Browse files Browse the repository at this point in the history
Signed-off-by: Huaqi Fang <[email protected]>
  • Loading branch information
fanghuaqi committed Nov 21, 2024
1 parent f2591fc commit 7def32d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions application/threadx/demo/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ TARGET = threadx_demo
RTOS = ThreadX

# define TX_INCLUDE_USER_DEFINE_FILE to include user defines in tx_user.h
# -fno-tree-tail-merge option is required with >O1 for ThreadX source code correct compiling
COMMON_FLAGS := -O2 -DTX_INCLUDE_USER_DEFINE_FILE

# -fno-tree-tail-merge option is required with >O1 for ThreadX source code correct compiling for gcc
# eg. OS/ThreadX/common/src/tx_mutex_delete.c
COMMON_FLAGS := -O2 -fno-tree-tail-merge -DTX_INCLUDE_USER_DEFINE_FILE
-include toolchain_$(TOOLCHAIN).mk

NUCLEI_SDK_ROOT = ../../..

Expand Down
6 changes: 5 additions & 1 deletion application/threadx/demo/npk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies:
## Package Configurations
configuration:
app_commonflags:
value: -O2 -fno-tree-tail-merge -DTX_INCLUDE_USER_DEFINE_FILE
value: -O2 -DTX_INCLUDE_USER_DEFINE_FILE
type: text
description: Application Compile Flags

Expand All @@ -44,3 +44,7 @@ buildconfig:
- type: common
common_flags: # flags need to be combined together across all packages
- flags: ${app_commonflags}
- type: gcc
common_flags:
# -fno-tree-tail-merge is required > O1 optimization level case
- flags: -fno-tree-tail-merge

0 comments on commit 7def32d

Please sign in to comment.