[all-commits] [llvm/llvm-project] dfbaf9: [llvm] prefix linker flag on non-MSVC compilers wi...

Ashay Rane via All-commits all-commits at lists.llvm.org
Wed Sep 21 09:19:06 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: dfbaf90043841d18f5871e12b10c674b9b3abf99
      https://github.com/llvm/llvm-project/commit/dfbaf90043841d18f5871e12b10c674b9b3abf99
  Author: Ashay Rane <ashay at users.noreply.github.com>
  Date:   2022-09-21 (Wed, 21 Sep 2022)

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

  Log Message:
  -----------
  [llvm] prefix linker flag on non-MSVC compilers with `-Wl,`

Prior to this patch, a Windows build of llvm-lto using clang failed with
the error: `LTO.def: unknown file type`.  The reason for this failure is
that .DEF files are used by the linker not by the clang compiler.  The
MSVC compiler+linker handles this transparently, but if we're using
clang (or gcc), then we need to tell the compiler to forward this flag
to the linker. This patch adds the necessary `-Wl` flag to fix the
problem.

Reviewed By: rnk, mstorsjo

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




More information about the All-commits mailing list