Skip to content

Commit

Permalink
libm: Do not link the toolchain's libm unless explicitly selected
Browse files Browse the repository at this point in the history
Fix CMake-based build system to include the toolchain's libm only
when `CONFIG_LIBM_TOOLCHAIN` is selected. Before this commit, if
the user selected `CONFIG_LIBM_NEWLIB`, for instance, the build
system would still link the toolchain's libm functions instead of
the ones provided by newlib.
  • Loading branch information
tmedicci authored and xiaoxiang781216 committed Dec 3, 2024
1 parent d5fba17 commit 80dd961
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/risc-v/src/cmake/platform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ execute_process(

list(APPEND EXTRA_LIB ${extra_library})

if(NOT CONFIG_LIBM)
if(CONFIG_LIBM_TOOLCHAIN)
execute_process(
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} ${NUTTX_EXTRA_FLAGS}
--print-file-name=libm.a
Expand Down
2 changes: 1 addition & 1 deletion arch/tricore/src/cmake/platform.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ if(CONFIG_TRICORE_TOOLCHAIN_GNU)
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE extra_library)
list(APPEND EXTRA_LIB ${extra_library})
if(NOT CONFIG_LIBM)
if(CONFIG_LIBM_TOOLCHAIN)
execute_process(
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} ${NUTTX_EXTRA_FLAGS}
--print-file-name=libm.a
Expand Down

0 comments on commit 80dd961

Please sign in to comment.