Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiler-rt/cmake: Align compiler-rt/Make.defs and fix clang cmake can't find libgcc #67

Merged
merged 2 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 25 additions & 8 deletions arch/arm/src/cmake/clang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -238,14 +238,31 @@ set(PREPROCESS ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} -E -P -x c)
set(NUTTX_FIND_TOOLCHAIN_LIB_DEFINED true)

if(CONFIG_BUILTIN_TOOLCHAIN)
function(nuttx_find_toolchain_lib)
execute_process(
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} ${NUTTX_EXTRA_FLAGS}
--print-file-name
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE extra_lib_path)
nuttx_add_extra_library(${extra_lib_path})
endfunction()
if(ARGN)
function(nuttx_find_toolchain_lib)
execute_process(
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} ${NUTTX_EXTRA_FLAGS}
--print-file-name=${ARGN}
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE extra_lib_path)
nuttx_add_extra_library(${extra_lib_path})
endfunction()
else()
function(nuttx_find_toolchain_lib)
execute_process(
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} ${NUTTX_EXTRA_FLAGS}
--print-libgcc-file-name
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE libgcc_path)
get_filename_component(libgcc_name ${libgcc_path} NAME)
execute_process(
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} ${NUTTX_EXTRA_FLAGS}
--print-file-name=${libgcc_name}
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE libgcc)
nuttx_add_extra_library(${libgcc})
endfunction()
endif()
else()
function(nuttx_find_toolchain_lib)
if(ARGN)
Expand Down
Loading
Loading