From 2465b67c84eb5e37f2d6db76cbf8a12e574bc7c5 Mon Sep 17 00:00:00 2001 From: chao an Date: Tue, 3 Sep 2024 12:32:09 +0800 Subject: [PATCH] cmake/tricore: filter out nostdlib in linker phase to avoid build break Regression by: | commit b64fb09e6c688fcb94877048e99dbc2173d24c3b | Author: xuxin19 | 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 Signed-off-by: chao an --- arch/tricore/src/cmake/platform.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/tricore/src/cmake/platform.cmake b/arch/tricore/src/cmake/platform.cmake index 6e5ae1e983..ce367e09cf 100644 --- a/arch/tricore/src/cmake/platform.cmake +++ b/arch/tricore/src/cmake/platform.cmake @@ -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 "\\$<\\$:(.*)>" matched ${FLAG}) if(matched)