aboutsummaryrefslogtreecommitdiff
path: root/clang/runtime
diff options
context:
space:
mode:
authorDan Liew <dliew@apple.com>2021-03-09 13:59:46 -0800
committerDan Liew <dliew@apple.com>2021-03-10 09:42:24 -0800
commita159f91c8d068cae660a200868b7fc28fcbcd3ff (patch)
tree8b659cadd60aeae8e8c50aef0ba1fce6109f7a82 /clang/runtime
parent40e261803bd40099ee2f322670157b0b57d7bf3e (diff)
downloadllvm-a159f91c8d068cae660a200868b7fc28fcbcd3ff.zip
llvm-a159f91c8d068cae660a200868b7fc28fcbcd3ff.tar.gz
llvm-a159f91c8d068cae660a200868b7fc28fcbcd3ff.tar.bz2
[compiler-rt] Fix stale incremental builds when using `LLVM_BUILD_EXTERNAL_COMPILER_RT=ON`.
When building with `LLVM_BUILD_EXTERNAL_COMPILER_RT=ON` (e.g. Swift does this) we do an "external" build of compiler-rt where we build compiler-rt with the just built clang. Unfortunately building in this mode had a bug where compiler-rt would not get rebuilt if compiler-rt sources changed. This is problematic for incremental builds because it meant that the compiler-rt binaries were stale. The fix is to use the `BUILD_ALWAYS` ExternalProject_Add option which means the build command for compiler-rt is always run. In principle if all of the following are true: * compiler-rt has already been built. * there are no compiler-rt source changes. * the compiler hasn't changed. * ninja is being used as the generator for the compiler-rt build. then the overhead for always running the build command for incremental builds is negligible. However, in practice clang gets rebuilt everytime the HEAD commit changes (due to commit hash being embedded in the output of `--version`) which means all of compiler-rt will be rebuilt everytime this happens. While this is annoying it's better to do the slow but correct thing rather than the fast but incorrect thing. rdar://75150660 Differential Revision: https://reviews.llvm.org/D98291
Diffstat (limited to 'clang/runtime')
-rw-r--r--clang/runtime/CMakeLists.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/runtime/CMakeLists.txt b/clang/runtime/CMakeLists.txt
index 61bbbf8..1716c53 100644
--- a/clang/runtime/CMakeLists.txt
+++ b/clang/runtime/CMakeLists.txt
@@ -95,6 +95,8 @@ if(LLVM_BUILD_EXTERNAL_COMPILER_RT AND EXISTS ${COMPILER_RT_SRC_ROOT}/)
USES_TERMINAL_CONFIGURE 1
USES_TERMINAL_BUILD 1
USES_TERMINAL_INSTALL 1
+ # Always run the build command so that incremental builds are correct.
+ BUILD_ALWAYS 1
)
get_ext_project_build_command(run_clean_compiler_rt clean)