Updating the way we build `compiler-rt` in `build-script`

Good morning everyone,
We are changing build-script to use the LLVM-recommended way to build compiler-rt, since the current way will be removed in LLVM-21 1 2 3 -- we are planning for this transition to be as seamless as possible, but regardless we want to share how we are planning to carry this out:

  1. add the new logic but keep it disabled for now
  2. test the enablement with PR testing and toolchain builds
  3. enable the new logic by default, and assess any fallout in CI
    • we are keeping the old logic, so that affected configurations can temporarily revert to that using --llvm-build-compiler-rt-with-use-runtimes=0 while we fix the underlying issues
  4. after all regressions are tackled, remove the old logic together with the flag

We are currently aiming at landing the new logic disabled in the next week or two to allow time for feedback; shortly after this, we will start testing the enablement; we will then schedule the enablement by default depending on how many fixes the new logic needs.

2 Likes

We just merged https://github.com/swiftlang/swift/pull/80174 to main -- now we are starting testing the enablement by default in Use LLVM_USE_RUNTIMES to build compiler-rt by default by edymtt · Pull Request #80253 · swiftlang/swift · GitHub.

Testing did not show any regression, so we merged the enablement of the new logic.

If you notice any issue, feel free to reply to this thread; or alternatively file a new issue, assign that to me and add the build-script label

1 Like

The adoption of the new logic to build compiler-rt using LLVM_ENABLE_RUNTIMES has been relatively smooth so far -- there have been a few issues that popped up and that I promptly addressed, namely

I will keep monitoring for any unforeseen regression -- if none happens, then I will plan the removal of the old logic to build compiler-rt.

1 Like

We did not experience any issue in builds in the past month (aside for a minor adjustment of tests) --
so we have now removed the old logic to build compiler-rt with build-script: Remove support for legacy way of building compiler-rt by edymtt · Pull Request #82124 · swiftlang/swift · GitHub
(in particular the --llvm-build-compiler-rt-with-use-runtimes flag, which now causes an error).

We made sure this did not regress configurations used in CI -- If you experience any issue, feel free to reply to this thread; or alternatively file a new issue, assign that to me and add the build-script label