On Mon, 15 Aug 2022, Richard Purdie via Gcc wrote:

> Currently it works well for absolute paths but if a file uses a
> relative path or a path with a symlink in, or a non-absolute path, it
> will miss those cases. For relative paths in particular it is
> problematic as you can't easily construct a compiler commandline that
> would cover all relative path options.

I'd expect a relative path to be naturally relocatable without needing to 
be remapped.  (For example, DW_AT_comp_dir would be relocated in debug 
info, but there would be no need to relocate the paths to individual files 
that are relative to DW_AT_comp_dir.)

Is the issue that you're using relative paths between two directories that 
don't have a fixed relative path between them, such as between the build 
and source directories, as opposed to relative paths within the source 
directory or within the build directory?

> which address a realpath() call into the prefix mapping code. I did

That would run the risk of breaking relocation for anyone who has 
deliberately used the paths they pass to the compiler (possibly involving 
symlinks, for example) in their remapping options - not expecting a 
further level of processing to be applied to those paths before remapping.

-- 
Joseph S. Myers
jos...@codesourcery.com

Reply via email to