[all-commits] [llvm/llvm-project] 3d0aed: [CMake] Use compiler-rt location instead of resour...

zero9178 via All-commits all-commits at lists.llvm.org
Thu Mar 18 01:26:44 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 3d0aed79362de001bf010ae027f099a177ed19ed
      https://github.com/llvm/llvm-project/commit/3d0aed79362de001bf010ae027f099a177ed19ed
  Author: Markus Böck <markus.boeck02 at gmail.com>
  Date:   2021-03-18 (Thu, 18 Mar 2021)

  Changed paths:
    M llvm/cmake/modules/HandleLLVMOptions.cmake

  Log Message:
  -----------
  [CMake] Use compiler-rt location instead of resource directory to find clang-cls runtime directory

The current cmake script attempts to add the path containing clangs various runtime systems by getting the resource directory and then appending the hardcoded value /lib/windows to it. This works for a normal clang-cl build but fails for a build of clang using LLVM_ENABLE_PER_TARGET_RUNTIME_DIR, such as the builds from llvm/runtimes.

This patch instead uses -print-libgcc-file-name in conjunction with --rtlib=compiler-rt, and instead adds the containing directory as library path.

For non per-target runtime directory builds, such as the release builds, there is no change. Even if the builtins library were to be deleted or moved it would output the same path as before.
For per-target runtime builds that also have the builtins library, this now finds the correct directory containing all of clang runtime libraries.

Only case still not handled by this change, is if a per-target runtime directory build is used, but the builtins library was not built.
I believe that is the best we can do for now however, without modifying clang.

Differential Revision: https://reviews.llvm.org/D98786




More information about the All-commits mailing list