[PATCH] D76018: [CMake] Use -ffile-prefix-map instead of -fdebug-prefix-map

Leonard Chan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 11 12:29:36 PDT 2020


leonardchan accepted this revision.
leonardchan added a comment.
This revision is now accepted and ready to land.

I also tried this but am still finding some paths embedded in libunwind and libclang_rt for some reason.

  leonardchan at 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.



================
Comment at: llvm/cmake/modules/HandleLLVMOptions.cmake:1018
 
 option(LLVM_USE_RELATIVE_PATHS_IN_DEBUG_INFO "Use relative paths in debug info" OFF)
 set(LLVM_SOURCE_PREFIX "" CACHE STRING "Use prefix for sources in debug info")
----------------
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`.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76018/new/

https://reviews.llvm.org/D76018





More information about the llvm-commits mailing list