Skip to content

Commit e597556

Browse files
authored
Add compiler-rt check for FMV Linux tests. (#99)
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.
1 parent 868d57c commit e597556

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

SingleSource/UnitTests/AArch64/CMakeLists.txt

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
if(CMAKE_C_COMPILER_ID STREQUAL "Clang")
22
if(TARGET_OS STREQUAL "Linux")
3-
list(APPEND CFLAGS --rtlib=compiler-rt)
4-
list(APPEND LDFLAGS --rtlib=compiler-rt)
3+
find_compiler_rt_library(RTLIB)
4+
if (RTLIB)
5+
list(APPEND CFLAGS --rtlib=compiler-rt)
6+
list(APPEND LDFLAGS --rtlib=compiler-rt)
7+
endif()
58
endif()
69
if(ARCH STREQUAL "AArch64")
710
llvm_singlesource(PREFIX "aarch64-")

cmake/modules/HandleCompilerRT.cmake

+3-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function(find_compiler_rt_library variable)
3232
string(STRIP "${library_file}" library_file)
3333
file(TO_CMAKE_PATH "${library_file}" library_file)
3434
get_filename_component(basename ${library_file} NAME)
35-
if(basename MATCHES ".*clang_rt\.([a-z0-9_\-]+)\.(a|lib)")
35+
if(basename MATCHES ".*clang_rt\.([a-z0-9_\-]+)\.(a|lib)" AND EXISTS ${library_file})
3636
message(STATUS "Found compiler-rt builtin library: ${basename}")
3737
set(COMPILER_RT_LIBRARY_builtins_${target} "${basename}" CACHE INTERNAL
3838
"compiler-rt library for ${target}")
@@ -47,4 +47,5 @@ function(find_compiler_rt_library variable)
4747
else()
4848
set(${variable} "" PARENT_SCOPE)
4949
endif()
50-
endfunction()
50+
endfunction()
51+

0 commit comments

Comments
 (0)