This patch changes relative path for source files in obj files to absolute path in PDB when linking with added flag.
I will make obj file generated by clang-cl independent from build directory for chromium build. But I don't want to confuse visual studio debugger or require additional configuration. To attain this goal, I added flag to convert relative source file path in obj to absolute path when emitting PDB.
By removing absolute path from obj files, we can share build cache between chromium developers even when they are doing debug build.
That will make build time faster.
More context:
https://bugs.chromium.org/p/chromium/issues/detail?id=712796
https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/5HXSVX-7fPc
I don't think it's correct to force Windows path style here. I think we should just use the default native style.
If you are doing a cross-compilation, then the code here will emit a path into the object file that doesn't make any sense or correspond to the actual machine that the file was generated on, which seems wrong.
This doesn't matter too much for MSVC since you will never run it on Linux anyway, but one could imagine that someday some other debugger (LLDB, GDB, etc) will be taught how to natively parse PDB files, and maybe on Linux it would be able to debug code running under WINE while the debug info and sources are on a native Linux partition. So it doesn't seem correct to lock PDBs to a Windows host at the file format level.