[PATCH 1/2] gcc/file-prefix-map: Allow remapping of relative paths

Jakub Jelinek jakub@redhat.com
Thu Jan 19 13:06:49 GMT 2023


On Tue, Nov 01, 2022 at 01:46:20PM -0600, Jeff Law via Gcc-patches wrote:
> 
> On 8/17/22 06:15, Richard Purdie via Gcc-patches wrote:
> > Relative paths currently aren't remapped by -ffile-prefix-map and friends.
> > When cross compiling with separate 'source' and 'build' directories, the same
> > relative paths between directories may not be available on target as compared
> > to build time.
> > 
> > In order to be able to remap these relative build paths to paths that would
> > work on target, resolve paths within the file-prefix-map function using
> > realpath().
> 
> Understood.
> 
> 
> > 
> > This does cause a change of behaviour if users were previously relying upon
> > symlinks or absolute paths not being resolved.
> 
> I'm not too worried about this scenario.

This breaks ccache testsuite and -fdebug-prefix-map behavior in directories
which are symlinks, see PR108464/  I can't see how the new behavior would be
correct in that case, user is asking to remap say /home/jakub/foobar2 to
some other path, but exactly /home/jakub/foobar2 appears in the debug info,
rather than the other path.

	Jakub



More information about the Gcc-patches mailing list