[all-commits] [llvm/llvm-project] 241c29: Reland [LLD] [COFF] Don't try to detect MSVC insta...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Sat Oct 21 12:54:27 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 241c290ad73f57ee12a6d1c3ee3fe38d79405c3a
      https://github.com/llvm/llvm-project/commit/241c290ad73f57ee12a6d1c3ee3fe38d79405c3a
  Author: Martin Storsjö <martin at martin.st>
  Date:   2023-10-21 (Sat, 21 Oct 2023)

  Changed paths:
    M lld/COFF/Driver.cpp
    M lld/test/COFF/winsysroot.test

  Log Message:
  -----------
  Reland [LLD] [COFF] Don't try to detect MSVC installations in mingw mode

In mingw mode, all linker paths are passed explicitly to the linker
by the compiler driver. Don't try to implicitly add linker paths
from the LIB environment variable or by detecting an MSVC
installation directory.

If the /winsysroot command line parameter is explicitly passed to
lld-link while /lldmingw is specified, it could be considered reasonable
to actually include those paths. However, modifying the code to
handle only the /winsysroot case but not the other ones, when the
mingw mode has been enabled, seems like much more code complexity
for a mostly hypothetical case.

Add a test for this when case when using LIB. (The code paths for
trying to detect an MSVC installation aren't really regression tested.)

Also fix an issue in the existing test for "Check that when /winsysroot
is specified, %LIB% is ignored.", where the LIB variable pointed
to a nonexistent directory, so the test would pass even if /winsysroot
wouldn't be specified.

Reland this after https://github.com/llvm/llvm-project/pull/68077 and
https://github.com/llvm/llvm-project/pull/69781 - the compiler-rt test
that used -lldmingw in MSVC environments has been updated to use a more
specific option.

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




More information about the All-commits mailing list