Skip to content

Commit 4f7b144

Browse files
committed
arch posix: When building for the native_simulator only link ASAN once
Only request the linker to link ASAN in the final stage, not during the partial linking stage. This fixes a link issue when building with llvm. Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
1 parent b59b21f commit 4f7b144

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎arch/posix/CMakeLists.txt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ list(JOIN LLVM_SANITIZERS "," LLVM_SANITIZERS_ARG)
188188
if(NOT ${LLVM_SANITIZERS_ARG} STREQUAL "")
189189
set(LLVM_SANITIZERS_ARG "-fsanitize=${LLVM_SANITIZERS_ARG}")
190190
zephyr_compile_options("${LLVM_SANITIZERS_ARG}")
191-
zephyr_link_libraries("${LLVM_SANITIZERS_ARG}")
191+
if (CONFIG_NATIVE_APPLICATION)
192+
zephyr_link_libraries("${LLVM_SANITIZERS_ARG}")
193+
endif()
192194

193195
target_link_options(native_simulator INTERFACE ${LLVM_SANITIZERS_ARG})
194196
target_compile_options(native_simulator INTERFACE ${LLVM_SANITIZERS_ARG})

0 commit comments

Comments
 (0)