funny pathname lookups from the compiler

Dimitry Andric dim at FreeBSD.org
Tue Aug 20 19:36:07 UTC 2019


On 20 Aug 2019, at 20:24, Mateusz Guzik <mjguzik at gmail.com> wrote:
> 
> Interested parties can collect this on their own:
> 
> dtrace -n 'vfs:namei:lookup:entry /execname == "ld.lld" || execname ==
> "cc"/ { @[stringof(arg1)] = count(); }'
> 
> and cc hello.c or similar elsewhere.
> 
> Full list is here:
> http://dpaste.com/2YM1R41
> 
> Highlights of fishy entries for me:
>  /proc/self/fd                                                     1
>  /etc/SuSE-release                                                 3
>  /etc/alpine-release                                               3
>  /etc/arch-release                                                 3
>  /etc/debian_version                                               3
>  /etc/exherbo-release                                              3
>  /etc/gentoo-release                                               3
>  /etc/lsb-release                                                  3
>  /etc/malloc.conf                                                  3
>  /etc/redhat-release                                               3
> 
> I don't know this code but I strongly suspect most of this can be easily
> ifdef-ed out. The first one perhaps can be disabled with a switch to
> configure.
> 
> None of this is a significant problem of course, but it does look like a
> waste.

Yes, it is an annoying detail of the Distro class in
contrib/llvm/tools/clang/lib/Driver/Distro.cpp, where it is trying to
look up the "distro", since Linux makes that so very very easy. :-)

I would recommend filing an upstream bug report at
https://bugs.llvm.org/, and/or submit a patch at
https://reviews.llvm.org/.

-Dimitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 223 bytes
Desc: Message signed with OpenPGP
URL: <http://lists.freebsd.org/pipermail/freebsd-current/attachments/20190820/88a8a6a1/attachment.sig>


More information about the freebsd-current mailing list