https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70268
--- Comment #13 from Boris Kolpackov <boris at kolpackov dot net> --- No, I was not aware, thanks for the pointer. I skimmed through it and I agree, the environment variable is a bad idea. In fact, if you look at the patch that I've proposed, it has a unified option (-ffile-prefix-map) that I believe does exactly what you want (remap any references to matching paths in the result of the compilation) while still allowing you to do more fine-grained mapping (e.g., only for __FILE__). And it has a provision for future extensions.