[llvm] [MC][DWARF] Use target (non-native) path separators when building DWARF directory-tables (PR #115888)

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 27 01:53:27 PST 2024


jmorse wrote:

(Blurgh, I'm having a bad time keeping up even with the patches I upload,)

I think we're in agreement about the idea of having a separator defined by the target, and as you say make it the consumers problem to transform that into the consumers environment if it's different to the target too.

> Alternatively, I guess since DWARF contains absolute paths (well, can - you can avoid that with -fdebug-compilation-dir=. etc) - how could those paths be portable to another machine, let alone one with a different path separator/file system?

Right now we've got a big bag of `-fdebug-prefix-map` options that maps local paths into the canonical Windows environment for our SDK; I suspect there's no graceful solution,

However: while digging into this further I've encountered a bunch of places within clangs header-handling which govern what path separators enter into debug-info. how DIFiles are segmented into filenames and directories, and so forth. It's beginning to look like having totally-identical-debug-info based on the target, that doesn't depend on the compiler-host environment, would be really invasive. Thus I'm going to back off from this until we know it's actually worth it.

https://github.com/llvm/llvm-project/pull/115888


More information about the llvm-commits mailing list