Skip to content

Commit d25bf15

Browse files
committed
[LLVM] Remove explicit dependency on builtins build
Summary: The LLVM runtimes build internally uses `ExternalProject_Add`. This then uses `BUILD_ALWAYS` to force the targets to be up-to-date when needed. One problem with this is that we have the builtins step and the runtimes step, which depends on the former. This means that when we build, we always touch the builtins, which then makes the runtimes stale. This patch tries to weaken that relationship by just getting rid of the explicit dependency. Because these targets are already `BUILD_ALWAYS` the compiler-rt target will always be built before the runtimes. This means it will always be available in-order when doing a normal build. What this patch changes is that now if someone makes a significant change to the `compiler-rt` runtime implementation it now may not trigger a rebuild of every single source file. I'm not sure if this behavior was here previously in the first place either, since it was just using a stale dependency and never did any extra work. I'm pretty sure most of the uses of the library are implicit through `clang` so it probably wouldn't track that dependency right anyway. I cold be wrong, but I'm hoping this resolves an issue I've had for a long time which makes it prohibitively difficult to use the runtimes interface with compiler-rt enabled as a runtime. Fixes: #98897
1 parent 580860e commit d25bf15

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

llvm/runtimes/CMakeLists.txt

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -568,15 +568,15 @@ if(build_runtimes)
568568

569569
if(NOT LLVM_RUNTIME_TARGETS)
570570
runtime_default_target(
571-
DEPENDS ${builtins_dep} ${extra_deps}
571+
DEPENDS ${extra_deps}
572572
CMAKE_ARGS ${extra_cmake_args}
573573
PREFIXES ${prefixes}
574574
EXTRA_ARGS ${extra_args})
575575
set(test_targets check-runtimes)
576576
else()
577577
if("default" IN_LIST LLVM_RUNTIME_TARGETS)
578578
runtime_default_target(
579-
DEPENDS ${builtins_dep} ${extra_deps}
579+
DEPENDS ${extra_deps}
580580
CMAKE_ARGS ${extra_cmake_args}
581581
PREFIXES ${prefixes}
582582
EXTRA_ARGS ${extra_args})
@@ -613,18 +613,10 @@ if(build_runtimes)
613613
endif()
614614

615615
foreach(name ${LLVM_RUNTIME_TARGETS})
616-
if(builtins_dep)
617-
if (LLVM_BUILTIN_TARGETS)
618-
set(builtins_dep_name "${builtins_dep}-${name}")
619-
else()
620-
set(builtins_dep_name ${builtins_dep})
621-
endif()
622-
endif()
623-
624616
check_apple_target(${name} runtime)
625617

626618
runtime_register_target(${name}
627-
DEPENDS ${builtins_dep_name} ${extra_deps}
619+
DEPENDS ${extra_deps}
628620
CMAKE_ARGS -DLLVM_DEFAULT_TARGET_TRIPLE=${name} ${extra_cmake_args}
629621
EXTRA_ARGS TARGET_TRIPLE ${name} ${extra_args})
630622
endforeach()

0 commit comments

Comments
 (0)