Skip to content

Add compiler-rt check for FMV Linux tests. #99

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

Merged
merged 1 commit into from
Feb 25, 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
7 changes: 5 additions & 2 deletions SingleSource/UnitTests/AArch64/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
if(TARGET_OS STREQUAL "Linux")
list(APPEND CFLAGS --rtlib=compiler-rt)
list(APPEND LDFLAGS --rtlib=compiler-rt)
find_compiler_rt_library(RTLIB)
if (RTLIB)
list(APPEND CFLAGS --rtlib=compiler-rt)
list(APPEND LDFLAGS --rtlib=compiler-rt)
endif()
endif()
if(ARCH STREQUAL "AArch64")
llvm_singlesource(PREFIX "aarch64-")
Expand Down
5 changes: 3 additions & 2 deletions cmake/modules/HandleCompilerRT.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function(find_compiler_rt_library variable)
string(STRIP "${library_file}" library_file)
file(TO_CMAKE_PATH "${library_file}" library_file)
get_filename_component(basename ${library_file} NAME)
if(basename MATCHES ".*clang_rt\.([a-z0-9_\-]+)\.(a|lib)")
if(basename MATCHES ".*clang_rt\.([a-z0-9_\-]+)\.(a|lib)" AND EXISTS ${library_file})
message(STATUS "Found compiler-rt builtin library: ${basename}")
set(COMPILER_RT_LIBRARY_builtins_${target} "${basename}" CACHE INTERNAL
"compiler-rt library for ${target}")
Expand All @@ -47,4 +47,5 @@ function(find_compiler_rt_library variable)
else()
set(${variable} "" PARENT_SCOPE)
endif()
endfunction()
endfunction()