[PATCH] D37602: Properly hook debuginfo-tests up to lit and CMake

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 7 17:20:43 PDT 2017


zturner added inline comments.


================
Comment at: debuginfo-tests/CMakeLists.txt:22
+  clang
+  lld
+  llvm-config
----------------
zturner wrote:
> aprantl wrote:
> > probinson wrote:
> > > zturner wrote:
> > > > rnk wrote:
> > > > > aprantl wrote:
> > > > > > why does it need lld? Shouldn't the system linker be good enough?
> > > > > Don't make this unconditional, do it like ASan does: add the dependency iff LLD is checked out. See how compiler-rt tests for it. We can feed lld's existence as a variable into the test suite. Besides, LLD doesn't have a functioning MachO port today. We need to disable any LLD-depending tests on Darwin.
> > > > No, lld is a hard requirement.  Part of what we're trying to do is test that we emit PDBs that can work with Microsoft tools.  If we use the system linker, that defeats the entire purpose.
> > > > 
> > > > As an aside, "system linker" on Windows isn't really a thing, since systems don't really //have// linkers unless you install them. Which in this case would be MSVC's linker, which we already know works for obvious reasons
> > > Don't see why lld is a "hard requirement."  Surely you want clang's concept of CodeView output to work with the MSVC linker as well as with lld.  Or is clang-cl no longer viewed as a drop-in replacement for cl?
> > The bots on green dragon, for example, run the debuginfo-tests and don't even check out the lld repository. It may be a hard requirement for windows, but certainly not on every platform.
> Definitely we want that.  For example, if you look back in the thread on llvm-dev, I posted this as an "example":
> 
> ```
> // RUN: %clangcl /Z7 %i /c /Fo%t.obj
> // RUN: %lld-link /DEBUG %t.obj /out:%t.lld.exe
> // RUN: %run_windbg %t.lld.exe %s
> // RUN: %ms-link /DEBUG:FASTLINK %t.obj /out:%t.fastlink.exe
> // RUN: %run_windbg %t.fastlink.exe %s
> // DEBUGGER: bp 22
> // DEBUGGER: g
> // DEBUGGER: dt v
> // CHECK: Local var {{.*}} Type SVal
> // CHECK:  +0x000 Data : (null) 
> // CHECK: +0x004 Kind : 0x85e
> ```
> 
> In this hypothetical example, I am testing clang-cl's codeview with MSVC's linker, but I'm *also* testing clang-cl's codeview with lld.  In all honesty, CodeView is not that complicated.  PDB is, and because of that it is actually the primary motivating factor behind getting debuginfo-tests working on Windows.  Without LLD, it's impossible to test that LLVM's PDBs are valid.
> 
> So again, yes we want to test clang-cl's CodeView with MS's linker, but it's still a hard requirement that we need to test LLD's PDBs against MS's tools.
That's a fair point.  Reid's suggestion of making the lld dependency conditional on whether it's checked out seems like it would address that.


https://reviews.llvm.org/D37602





More information about the llvm-commits mailing list