This handles not paths embedded in debug info, but also in sources.
Since the use of this flag is controlled by an option, rather than
replacing the new option, we add a new option.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I also tried this but am still finding some paths embedded in libunwind and libclang_rt for some reason.
leonardchan@cp-snakewater:~/llvm-monorepo/llvm-build-1-master-fuchsia-toolchain$ strings ./install/lib/aarch64-unknown-fuchsia/c++/asan/libunwind.so.1.0 |& less ... 3 32 624 9 cursor:93 784 528 5 uc:94 1440 72 7 info:95 /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/libunwind/src/libunwind.cpp libunwind: %s - %s _Unwind_Resume _Unwind_Resume() can't return unwind_phase2 during phase1 personality function said it would stop here, but now in phase2 it did not stop here /usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/libunwind/src/UnwindLevel1.c libunwind: %s - %s _Unwind_Resume_or_Rethrow ...
I can assert from comparing an unstripped to the stripped binary that the __FILE__ path that we see in _LIBUNWIND_ABORT is stripped and resolved to just libunwind/src/UnwindLevel1.c, but there seems to be a separate instance of this absolute path (/usr/local/google/home/leonardchan/llvm-monorepo/llvm-project-1/libunwind/src/UnwindLevel1.c) that I can see in the stripped binary that includes the full path.
I suppose it would be ok to submit this still since it saves space from some trimmed paths. I was hesitant to submit it yet since I haven't found a complete solution yet or figured out where this absolute path I'm finding came from.
llvm/cmake/modules/HandleLLVMOptions.cmake | ||
---|---|---|
1024 | nit: update the name + description since it doesn't just affect debug info only now (perhaps just LLVM_USE_RELATIVE_PATHS) I also think it would be good to add a section for this flag in llvm/docs/CMake.rst. |
This change only covers LLVM, not the runtimes. I'll make a follow up change to do the same for runtimes which should cover the cases you mentioned.
Oh, I think you'll need to add it to llvm/cmake/modules/LLVMExternalProjectUtils.cmake also:
--- a/llvm/cmake/modules/LLVMExternalProjectUtils.cmake +++ b/llvm/cmake/modules/LLVMExternalProjectUtils.cmake @@ -221,6 +221,9 @@ function(llvm_ExternalProject_Add name source_dir) set(cmake_args ${ARG_CMAKE_ARGS}) endif() ExternalProject_Add(${name} DEPENDS ${ARG_DEPENDS} llvm-config ${name}-clobber @@ -239,6 +242,7 @@ function(llvm_ExternalProject_Add name source_dir) -DLLVM_HOST_TRIPLE=${LLVM_HOST_TRIPLE} -DLLVM_HAVE_LINK_VERSION_SCRIPT=${LLVM_HAVE_LINK_VERSION_SCRIPT} -DLLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO=${LLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO} + -DLLVM_USE_RELATIVE_PATHS_IN_FILES=${LLVM_USE_RELATIVE_PATHS_IN_FILES} -DLLVM_SOURCE_PREFIX=${LLVM_SOURCE_PREFIX} -DPACKAGE_VERSION=${PACKAGE_VERSION} -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
nit: update the name + description since it doesn't just affect debug info only now (perhaps just LLVM_USE_RELATIVE_PATHS)
I also think it would be good to add a section for this flag in llvm/docs/CMake.rst.