This will match the behavior of GCC.
Patch does not change remapping logic itself, so adding one simple smoke test should be enough.
I can push it on your behalf, I want to wait a bit for more comments.
(You need to provide name/email so that you can get the proper attribution git commit --amend --author='...')
Looks like a good candidate for release/13.x for build reproducibility.
absl has a macro saying whether __builtin_FILE can be used.
I can find a few other places where people do something like -D__builtin_FILE()="file.cc" probably to work around Clang.
Great! My commit author string is Pavel Asyutchenko <firstname.lastname@example.org>.
I have an even uglier hack to work around this: to offset the value of __builtin_FILE() by compile-time calculated location of some known substring like src or include.