[all-commits] [llvm/llvm-project] ad4ab8: [clang][cmake] Force CMAKE_LINKER for multistage b...

chbessonova via All-commits all-commits at lists.llvm.org
Tue Jul 28 01:13:38 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: ad4ab81dccaa72d9b5137433a0923d325ff76135
      https://github.com/llvm/llvm-project/commit/ad4ab81dccaa72d9b5137433a0923d325ff76135
  Author: Kristina Bessonova <kbessonova at accesssoftek.com>
  Date:   2020-07-28 (Tue, 28 Jul 2020)

  Changed paths:
    M clang/CMakeLists.txt
    M llvm/cmake/modules/HandleLLVMOptions.cmake

  Log Message:
  -----------
  [clang][cmake] Force CMAKE_LINKER for multistage build in case of BOOTSTRAP_LLVM_ENABLE_LLD and MSVC

The issue with LLVM_ENABLE_LLD is that it just passes -fuse-ld=lld
to compiler/linker options which makes sense only for those platforms
where cmake invokes a compiler driver for linking. On Windows (MSVC) cmake
invokes the linker directly and requires CMAKE_LINKER to be specified
otherwise it defaults CMAKE_LINKER to be link.exe.

This patch allows BOOTSTRAP_LLVM_ENABLE_LLD to set CMAKE_LINKER in two cases:
* if building for host Windows,
* if crosscompiling for target Windows.

It also skips adding '-fuse-ld=lld' to make lld-link not warning
about 'unknown argument'.

This fixes build with `clang/cmake/caches/DistributionExample.cmake`
on Windows.

Reviewed By: phosek

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




More information about the All-commits mailing list