https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109805
--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> --- Created attachment 55064 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55064&action=edit prototype This works for me. The consistency check is not fully implemented and instead of passing down no -fdebug-prefix-map the patch passes the first but warns: > ./xgcc -B. t.o t2.o -o t lto-wrapper: warning: option -fdebug-prefix-map=/home/rguenther/obj-trunk-g/gcc=/bbb with different values, using /home/rguenther/obj-trunk-g/gcc=/aaa to make consistency checking work we need to record -fcanon-prefix-map and the full set of -f{file,debug}-prefix-map options in order (I think file and debug variants can be considered the same) of the first TU and compare that to each of the following TUs. As implemented we only diagnose mismatches of options that are actually given (because we don't stream the option when not given). We could also emit a hard error when there's a mismatch. Note a link-time specified option will simply ignore all options from the compile-time (but only for the link-time unit, the compile-time debug info has already been generated with the originally specified options). Not sure what the best behavior is here, any input appreciated.