Go to file
Nico Weber 4764bb2cb1 lld-link: Use /pdbsourcepath: for more places when present.
/pdbsourcepath: was added in https://reviews.llvm.org/D48882 to make it
possible to have relative paths in the debug info that clang-cl writes.
lld-link then makes the paths absolute at link time, which debuggers require.
This way, clang-cl's output is independent of the absolute path of the build
directory, which is useful for cacheability in distcc-like systems.

This patch extends /pdbsourcepath: (if passed) to also be used for:

1. The "cwd" stored in the env block in the pdb is /pdbsourcepath: if present
2. The "exe" stored in the env block in the pdb is made absolute relative
   to /pdbsourcepath: instead of the cwd
3. The "pdb" stored in the env block in the pdb is made absolute relative
   to /pdbsourcepath: instead of the cwd
4. For making absolute paths to .obj files referenced from the pdb

/pdbsourcepath: is now useful in three scenarios (the first one already working
before this change):

1. When building with full debug info, passing the real build dir to
   /pdbsourcepath: allows having clang-cl's output to be independent
   of the build directory path. This patch effectively doesn't change
   behavior for this use case (assuming the cwd is the build dir).

2. When building without compile-time debug info but linking with /debug,
   a fake fixed /pdbsourcepath: can be passed to get symbolized stacks
   while making the pdb and exe independent of the current build dir.
   For this two work, lld-link needs to be invoked with relative paths for
   the lld-link invocation itself (for "exe"), for the pdb output name, the exe
   output name (for "pdb"), and the obj input files, and no absolute path
   must appear on the link command (for "cmd" in the pdb's env block).
   Since no full debug info is present, it doesn't matter that the absolute
   path doesn't exist on disk -- we only get symbols in stacks.

3. When building production builds with full debug info that don't have
   local changes, and that get source indexed and their pdbs get uploaded
   to a symbol server. /pdbsourcepath: again makes the build output independent
   of the current directory, and the fixed path passed to /pdbsourcepath: can
   be given the source indexing transform so that it gets mapped to a
   repository path. This has the same requirements as 2.

This patch also makes it possible to create PDB files containing Windows-style
absolute paths when cross-compiling on a POSIX system.

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

llvm-svn: 344061
2018-10-09 17:52:25 +00:00
clang [CUDA][HIP] Fix ShouldDeleteSpecialMember for inherited constructors 2018-10-09 15:53:14 +00:00
clang-tools-extra [clang-tidy] Fix handling of parens around new expressions in make_<smartptr> checks. 2018-10-09 15:58:18 +00:00
compiler-rt Mark intercept-rethrow-exception.cc as XFAIL on NetBSD 2018-10-09 13:32:52 +00:00
debuginfo-tests Revert "(Retry) Add a basic integration test for C++ smart pointers" 2018-08-20 19:53:33 +00:00
libclc configure: Rework support for gfx9+ devices that were added post LLVM 3.9 2018-09-15 22:02:01 +00:00
libcxx [libcxx] Mark std::async race condition test as unsupported on Darwin 2018-10-09 14:57:40 +00:00
libcxxabi [NFC][unwind] Improve error message when a type has more than one RTTIs 2018-10-09 14:55:15 +00:00
libunwind [CMake] Link to compiler-rt if LIBUNWIND_USE_COMPILER_RT is ON. 2018-10-08 18:35:00 +00:00
lld lld-link: Use /pdbsourcepath: for more places when present. 2018-10-09 17:52:25 +00:00
lldb Add support for artificial tail call frames 2018-10-05 23:23:15 +00:00
llgo Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
llvm [X86] Autogenerate complete checks. NFC 2018-10-09 17:52:07 +00:00
openmp [OpenMP] Convert KMP_DYNAMIC_LIB to a 0 or 1 guard everywhere 2018-10-05 17:59:39 +00:00
parallel-libs Update copyright year to 2018. 2018-06-18 12:22:17 +00:00
polly [IslAst] Fix InParallelFor nesting. 2018-09-27 13:39:37 +00:00
README.md

README.md

Low Level Virtual Machine (LLVM)

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.