[Compiler-rt] Emit error if builtins library cannot be found

Since setting COMPILER_RT_USE_BUILTINS_LIBRARY would remove -z,defs
flag, missing builtins library would continue to build unnoticed.
Explicitly emit an error in such case.

Differential Revision: https://reviews.llvm.org/D79470
This commit is contained in:
Yi Kong 2020-05-16 11:59:21 +08:00
parent 3735505e4f
commit 2fe66bdb2e
1 changed files with 3 additions and 0 deletions

View File

@ -237,6 +237,9 @@ function(add_compiler_rt_runtime name type)
if(COMPILER_RT_USE_BUILTINS_LIBRARY AND NOT type STREQUAL "OBJECT") if(COMPILER_RT_USE_BUILTINS_LIBRARY AND NOT type STREQUAL "OBJECT")
get_compiler_rt_target(${arch} target) get_compiler_rt_target(${arch} target)
find_compiler_rt_library(builtins ${target} builtins_${libname}) find_compiler_rt_library(builtins ${target} builtins_${libname})
if(builtins_${libname} STREQUAL "NOTFOUND")
message(FATAL_ERROR "Cannot find builtins library for the target architecture")
endif()
endif() endif()
set(sources_${libname} ${LIB_SOURCES}) set(sources_${libname} ${LIB_SOURCES})
format_object_libs(sources_${libname} ${arch} ${LIB_OBJECT_LIBS}) format_object_libs(sources_${libname} ${arch} ${LIB_OBJECT_LIBS})