Skip to content

Commit

Permalink
cmake/tricore: filter out nostdlib in linker phase to avoid build break
Browse files Browse the repository at this point in the history
Regression by:

| commit b64fb09
| Author: xuxin19 <[email protected]>
| Date:   Tue Jul 16 15:50:13 2024 +0800
|
|     cmake:bugfix fix CMake LTO build block
|
|     it was wrong in https://github.com/apache/nuttx/pull/12423/files#r1618852245
|     EXTRA_FLAGS is useful in LTO for pass option tu lto linker
|
|     Signed-off-by: xuxin19 <[email protected]>

Signed-off-by: chao an <[email protected]>
  • Loading branch information
anchao committed Sep 3, 2024
1 parent ccb20fe commit ce5c51a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion arch/tricore/src/cmake/platform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ get_directory_property(TOOLCHAIN_DIR_FLAGS DIRECTORY ${CMAKE_SOURCE_DIR}
set(NUTTX_EXTRA_FLAGS "")
foreach(FLAG ${TOOLCHAIN_DIR_FLAGS})
if(NOT FLAG MATCHES "^\\$<.*>$")
list(APPEND NUTTX_EXTRA_FLAGS ${FLAG})
if(NOT FLAG MATCHES "-nostdlib")
list(APPEND NUTTX_EXTRA_FLAGS ${FLAG})
endif()
else()
string(REGEX MATCH "\\$<\\$<COMPILE_LANGUAGE:C>:(.*)>" matched ${FLAG})
if(matched)
Expand Down

0 comments on commit ce5c51a

Please sign in to comment.