On Wed, Aug 12, 2020 at 01:08:53PM +0100, Jonathan Wakely via Gcc wrote:
> > Oddly, I looked through the gnulib library and didn't find any
> > appropriate module for this.  It seems like there should be one.
> 
> C++17 provides std::filesystem::weakly_canonical for that. It doesn't
> help GCC or gnulib though.
> 
> POSIX realpath and GNU canonicalize_file_name do the canonicalization,
> but require every path component to exist.
> 
> I think it's worth adding this to bugzilla. Depending on the existence
> of empty directories seems less than ideal.

But canonicalizing the paths without taking the filesystem state into
account will significantly change the behavior in some setups (e.g. in
presence of symlinks) and I'm not sure it is desirable.
The lib paths usually are not empty, the typical installation is together
with other programs/libraries.  And even the PREFIX/lib path should have gcc
subdirectory with it with lots of files in there.

        Jakub

Reply via email to