[all-commits] [llvm/llvm-project] 3fec6d: Reapply: [clang-cl] Always interpret the LIB env v...

Martin Storsjö via All-commits all-commits at lists.llvm.org
Tue Sep 22 00:51:46 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 3fec6ddc276a595e4409f04dabdd50c84f5f2a2d
      https://github.com/llvm/llvm-project/commit/3fec6ddc276a595e4409f04dabdd50c84f5f2a2d
  Author: Martin Storsjö <martin at martin.st>
  Date:   2020-09-22 (Tue, 22 Sep 2020)

  Changed paths:
    M clang/lib/Driver/Driver.cpp
    M clang/test/Driver/cl-inputs.c
    M llvm/include/llvm/Support/Process.h
    M llvm/include/llvm/Support/Program.h
    M llvm/lib/Support/Process.cpp

  Log Message:
  -----------
  Reapply: [clang-cl] Always interpret the LIB env var as separated with semicolons

When cross compiling with clang-cl, clang splits the INCLUDE env
variable around semicolons (clang/lib/Driver/ToolChains/MSVC.cpp,
MSVCToolChain::AddClangSystemIncludeArgs) and lld splits the
LIB variable similarly (lld/COFF/Driver.cpp,
LinkerDriver::addLibSearchPaths). Therefore, the consensus for
cross compilation with clang-cl and lld-link seems to be to use
semicolons, despite path lists normally being separated by colons
on unix and EnvPathSeparator being set to that.

Therefore, handle the LIB variable similarly in Clang, when
handling lib file arguments when driving linking via Clang.

This fixes commands like "clang-cl test.c -Fetest.exe kernel32.lib" in
a cross compilation setting. Normally, most users call (lld-)link
directly, but meson happens to use this command syntax for
has_function() tests.

Reapply: Change Program.h to define procid_t as ::pid_t. When included
in lldb/unittests/Host/NativeProcessProtocolTest.cpp, it is included
after an lldb namespace containing an lldb::pid_t typedef, followed
later by a "using namespace lldb;". Previously, Program.h wasn't
included in this translation unit, but now it ends up included
transitively from Process.h.

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




More information about the All-commits mailing list