OSDN Git Service

[CMake] Provide an option to use relative paths in debug info
authorPetr Hosek <phosek@chromium.org>
Fri, 31 May 2019 01:34:51 +0000 (01:34 +0000)
committerPetr Hosek <phosek@chromium.org>
Fri, 31 May 2019 01:34:51 +0000 (01:34 +0000)
commit6a3f589fca384b16a35d5fd1c4ec38e752aa8fef
tree9332d3764f206355341dd6ab89dac331c70d592f
parent15927a9c4b16f266da23f9d85c90d2c3faea8c1b
[CMake] Provide an option to use relative paths in debug info

CMake always uses absolute file paths in the generated compiler
invocation which results in absolute file paths being embedded in debug
info. This is undesirable when building a toolchain e.g. on bots as the
debug info may embed the bot source checkout path which is meaningless
anywhere else.

This change introduces the LLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO which uses
-fdebug-prefix-map (where supported) options to rewrite paths embedded
into debug info with relative ones. Additionally, LLVM_SOURCE_PREFIX can
be used to override the path to source directory with a different one.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362185 91177308-0d34-0410-b5e6-96231b3b80d8
cmake/modules/HandleLLVMOptions.cmake
cmake/modules/LLVMExternalProjectUtils.cmake
runtimes/CMakeLists.txt