Skip to content

Commit 67bccc2

Browse files
tmlemanlgirdwood
authored andcommitted
test: ztest: Remove explicit math library linking for native_sim
Remove explicit linking of math library (-lm) from advanced math function tests to fix native_sim build failures. The explicit target_link_libraries(app PRIVATE m) caused linker errors with __x86.get_pc_thunk.bx symbols in Zephyr's native_sim builds. This occurs because native_sim's build system already handles math library linkage, and explicitly adding it creates conflicting symbol references during the final native simulator linking stage. The math library functions (exp, pow, log2, etc.) used in tests are still available as Zephyr automatically links libm for native_sim targets. Error example: `__x86.get_pc_thunk.bx' referenced in section `.text' of zephyr.elf.loc_cpusw.o: defined in discarded section `.text.__x86.get_pc_thunk.bx[__x86.get_pc_thunk.bx]' Related: zephyrproject-rtos/zephyr#97999 Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
1 parent 1c56e1a commit 67bccc2

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

test/ztest/unit/math/advanced/functions/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,3 @@ target_sources(app PRIVATE
3636

3737
# Apply SOF relative path definitions for proper compilation
3838
sof_append_relative_path_definitions(app)
39-
40-
# Link math library for advanced math functions
41-
target_link_libraries(app PRIVATE m)

0 commit comments

Comments
 (0)