Skip to content

Commit

Permalink
Add compiler-rt check for FMV Linux tests. (#99)
Browse files Browse the repository at this point in the history
The patch fixes buildbot failures discovered in
#98 by checking for
compiler-rt availability. Existence of compiler-rt builtin check
was added to find_compiler_rt_library function.
  • Loading branch information
ilinpv authored Feb 25, 2024
1 parent 868d57c commit e597556
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
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()

0 comments on commit e597556

Please sign in to comment.