OSDN Git Service

[compiler-rt] Don't error out on missing builtins when builting builtins themselves
authorMartin Storsjö <martin@martin.st>
Mon, 18 May 2020 08:04:42 +0000 (11:04 +0300)
committerMartin Storsjö <martin@martin.st>
Mon, 18 May 2020 08:28:44 +0000 (11:28 +0300)
This fixes bootstrapping the builtins when no previous version of
them exists after 2fe66bdb2e5fb556e15d4a07158e89ec007c587b.

Also fix a whitespace issue in that commit.

compiler-rt/cmake/Modules/AddCompilerRT.cmake

index 1dde396..dab5570 100644 (file)
@@ -234,10 +234,11 @@ function(add_compiler_rt_runtime name type)
           set_output_name(output_name_${libname} ${name} ${arch})
         endif()
       endif()
-      if(COMPILER_RT_USE_BUILTINS_LIBRARY AND NOT type STREQUAL "OBJECT")
+      if(COMPILER_RT_USE_BUILTINS_LIBRARY AND NOT type STREQUAL "OBJECT" AND
+         NOT name STREQUAL "clang_rt.builtins")
         get_compiler_rt_target(${arch} target)
         find_compiler_rt_library(builtins ${target} builtins_${libname})
-                               if(builtins_${libname} STREQUAL "NOTFOUND")
+        if(builtins_${libname} STREQUAL "NOTFOUND")
           message(FATAL_ERROR "Cannot find builtins library for the target architecture")
         endif()
       endif()