dmantipov created this revision.
dmantipov added reviewers: manojgupta, sthibaul, dlj.
Herald added subscribers: cfe-commits, fedor.sergeev.
Herald added a project: clang.
dmantipov requested review of this revision.

For the regular (system-wide) installation it's OK to assume that Clang is 
installed alongside with GCC, probably with the same prefix (usually /usr on 
most Linux systems). But this is not so for standalone installations with 
custom prefix, where the number of VFS lookups for the suitable GCC 
installation may be substantially reduced by filtering out <libdir>/gcc and 
(Debian-specific) <libdir>/gcc-cross early, before trying 
<libdir>/gcc/<cpu-vendor-os> and <libdir>/gcc-cross/<cpu-vendor-os>, 
respectively.

For my installation configured with 
-DCMAKE_INSTALL_PREFIX=/home/antipov/.local/llvm-12.0.0, it's possible to 
filter out 80 of 200 VFS lookups, from:

  stat("/home/antipov/.local/llvm-12.0.0/bin/..", {st_mode=S_IFDIR|0755, 
st_size=73, ...}) = 0
  stat("/home/antipov/.local/llvm-12.0.0/bin/../lib64", {st_mode=S_IFDIR|0755, 
st_size=8192, ...}) = 0
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc-cross/x86_64-unknown-linux-gnu",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-unknown-linux-gnu/gcc/x86_64-unknown-linux-gnu",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc-cross/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-linux-gnu/gcc/x86_64-linux-gnu",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc-cross/x86_64-unknown-linux-gnu",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-unknown-linux-gnu/gcc/x86_64-unknown-linux-gnu",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc/x86_64-pc-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc-cross/x86_64-pc-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-pc-linux-gnu/gcc/x86_64-pc-linux-gnu",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc/x86_64-redhat-linux6E", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc-cross/x86_64-redhat-linux6E",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-redhat-linux6E/gcc/x86_64-redhat-linux6E",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc/x86_64-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc-cross/x86_64-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-redhat-linux/gcc/x86_64-redhat-linux",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc/x86_64-suse-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc-cross/x86_64-suse-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-suse-linux/gcc/x86_64-suse-linux",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc/x86_64-manbo-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc-cross/x86_64-manbo-linux-gnu",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-manbo-linux-gnu/gcc/x86_64-manbo-linux-gnu",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc-cross/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-linux-gnu/gcc/x86_64-linux-gnu",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc/x86_64-slackware-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc-cross/x86_64-slackware-linux",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-slackware-linux/gcc/x86_64-slackware-linux",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc/x86_64-unknown-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc-cross/x86_64-unknown-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-unknown-linux/gcc/x86_64-unknown-linux",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc/x86_64-amazon-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc-cross/x86_64-amazon-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-amazon-linux/gcc/x86_64-amazon-linux",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc/x86_64-linux-android", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc-cross/x86_64-linux-android", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-linux-android/gcc/x86_64-linux-android",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc-cross/x86_64-unknown-linux-gnu",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-unknown-linux-gnu/gcc/x86_64-unknown-linux-gnu",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  stat("/home/antipov/.local/llvm-12.0.0/bin/../lib", 0x7fff61cc4e00) = -1 
ENOENT (No such file or directory)
  stat("/home/antipov/.local/llvm-12.0.0/bin/../lib32", 0x7fff61cc4e00) = -1 
ENOENT (No such file or directory)
  stat("/home/antipov/.local/llvm-12.0.0/bin/../lib", 0x7fff61cc4e00) = -1 
ENOENT (No such file or directory)
  stat("/opt/rh/devtoolset-9/root/usr", 0x7fff61cc4e00) = -1 ENOENT (No such 
file or directory)
  stat("/opt/rh/devtoolset-8/root/usr", 0x7fff61cc4e00) = -1 ENOENT (No such 
file or directory)
  stat("/opt/rh/devtoolset-7/root/usr", 0x7fff61cc4e00) = -1 ENOENT (No such 
file or directory)
  stat("/opt/rh/devtoolset-6/root/usr", 0x7fff61cc4e00) = -1 ENOENT (No such 
file or directory)
  stat("/opt/rh/devtoolset-4/root/usr", 0x7fff61cc4e00) = -1 ENOENT (No such 
file or directory)
  stat("/opt/rh/devtoolset-3/root/usr", 0x7fff61cc4e00) = -1 ENOENT (No such 
file or directory)
  stat("/opt/rh/devtoolset-2/root/usr", 0x7fff61cc4e00) = -1 ENOENT (No such 
file or directory)
  stat("/usr", {st_mode=S_IFDIR|0755, st_size=155, ...}) = 0
  stat("/usr/lib64", {st_mode=S_IFDIR|0555, st_size=167936, ...}) = 0
  openat(AT_FDCWD, "/usr/lib64/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc-cross/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib64/x86_64-unknown-linux-gnu/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc-cross/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/x86_64-linux-gnu/gcc/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc-cross/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib64/x86_64-unknown-linux-gnu/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc/x86_64-pc-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc-cross/x86_64-pc-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/x86_64-pc-linux-gnu/gcc/x86_64-pc-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc/x86_64-redhat-linux6E", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc-cross/x86_64-redhat-linux6E", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib64/x86_64-redhat-linux6E/gcc/x86_64-redhat-linux6E", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc/x86_64-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc-cross/x86_64-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/x86_64-redhat-linux/gcc/x86_64-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc/x86_64-suse-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc-cross/x86_64-suse-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/x86_64-suse-linux/gcc/x86_64-suse-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc/x86_64-manbo-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc-cross/x86_64-manbo-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib64/x86_64-manbo-linux-gnu/gcc/x86_64-manbo-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc-cross/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/x86_64-linux-gnu/gcc/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc/x86_64-slackware-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc-cross/x86_64-slackware-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib64/x86_64-slackware-linux/gcc/x86_64-slackware-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc/x86_64-unknown-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc-cross/x86_64-unknown-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/x86_64-unknown-linux/gcc/x86_64-unknown-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc/x86_64-amazon-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc-cross/x86_64-amazon-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/x86_64-amazon-linux/gcc/x86_64-amazon-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc/x86_64-linux-android", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc-cross/x86_64-linux-android", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/x86_64-linux-android/gcc/x86_64-linux-android", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/gcc-cross/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib64/x86_64-unknown-linux-gnu/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  stat("/usr/lib", {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib/x86_64-unknown-linux-gnu/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib/x86_64-unknown-linux-gnu/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-pc-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/x86_64-pc-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/x86_64-pc-linux-gnu/gcc/x86_64-pc-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-redhat-linux6E", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/x86_64-redhat-linux6E", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/x86_64-redhat-linux6E/gcc/x86_64-redhat-linux6E", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
  stat("/usr/lib/gcc/x86_64-redhat-linux/10/64/crtbegin.o", 0x7fff61cc3e70) = 
-1 ENOENT (No such file or directory)
  stat("/usr/lib/gcc/x86_64-redhat-linux/10/crtbegin.o", {st_mode=S_IFREG|0644, 
st_size=2960, ...}) = 0
  stat("/usr/lib/gcc/x86_64-redhat-linux/10/64/crtbegin.o", 0x7fff61cc3c60) = 
-1 ENOENT (No such file or directory)
  stat("/usr/lib/gcc/x86_64-redhat-linux/10/32/crtbegin.o", 
{st_mode=S_IFREG|0644, st_size=2056, ...}) = 0
  stat("/usr/lib/gcc/x86_64-redhat-linux/10/x32/crtbegin.o", 0x7fff61cc3cd0) = 
-1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/x86_64-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/x86_64-redhat-linux/gcc/x86_64-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-suse-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/x86_64-suse-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/x86_64-suse-linux/gcc/x86_64-suse-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-manbo-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/x86_64-manbo-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib/x86_64-manbo-linux-gnu/gcc/x86_64-manbo-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-slackware-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/x86_64-slackware-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib/x86_64-slackware-linux/gcc/x86_64-slackware-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-unknown-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/x86_64-unknown-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/x86_64-unknown-linux/gcc/x86_64-unknown-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-amazon-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/x86_64-amazon-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/x86_64-amazon-linux/gcc/x86_64-amazon-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-linux-android", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/x86_64-linux-android", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/x86_64-linux-android/gcc/x86_64-linux-android", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib/x86_64-unknown-linux-gnu/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  stat("/usr/lib32", 0x7fff61cc4e00)      = -1 ENOENT (No such file or 
directory)
  stat("/usr/lib", {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0
  openat(AT_FDCWD, "/usr/lib/gcc/i686-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/i686-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i686-linux-gnu/gcc/i686-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i686-pc-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/i686-pc-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i686-pc-linux-gnu/gcc/i686-pc-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i486-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/i486-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i486-linux-gnu/gcc/i486-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i386-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/i386-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i386-linux-gnu/gcc/i386-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i386-redhat-linux6E", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/i386-redhat-linux6E", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i386-redhat-linux6E/gcc/i386-redhat-linux6E", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i686-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/i686-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i686-redhat-linux/gcc/i686-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i586-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/i586-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i586-redhat-linux/gcc/i586-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i386-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/i386-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i386-redhat-linux/gcc/i386-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i586-suse-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/i586-suse-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i586-suse-linux/gcc/i586-suse-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i486-slackware-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/i486-slackware-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i486-slackware-linux/gcc/i486-slackware-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i686-montavista-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/i686-montavista-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i686-montavista-linux/gcc/i686-montavista-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i586-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/i586-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i586-linux-gnu/gcc/i586-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i686-linux-android", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/i686-linux-android", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i686-linux-android/gcc/i686-linux-android", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i386-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/i386-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i386-gnu/gcc/i386-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i486-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/i486-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i486-gnu/gcc/i486-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i586-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/i586-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i586-gnu/gcc/i586-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i686-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/i686-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i686-gnu/gcc/i686-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i386-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc-cross/i386-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib/i386-unknown-linux-gnu/gcc/i386-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)

to:

  stat("/home/antipov/.local/llvm-12.0.0/bin/..", {st_mode=S_IFDIR|0755, 
st_size=73, ...}) = 0
  stat("/home/antipov/.local/llvm-12.0.0/bin/../lib64", {st_mode=S_IFDIR|0755, 
st_size=8192, ...}) = 0
  stat("/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc", 0x7ffe4ed007d0) = 
-1 ENOENT (No such file or directory)
  stat("/home/antipov/.local/llvm-12.0.0/bin/../lib64/gcc-cross", 
0x7ffe4ed007d0) = -1 ENOENT (No such file or directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-unknown-linux-gnu/gcc/x86_64-unknown-linux-gnu",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-linux-gnu/gcc/x86_64-linux-gnu",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-unknown-linux-gnu/gcc/x86_64-unknown-linux-gnu",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-pc-linux-gnu/gcc/x86_64-pc-linux-gnu",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-redhat-linux6E/gcc/x86_64-redhat-linux6E",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-redhat-linux/gcc/x86_64-redhat-linux",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-suse-linux/gcc/x86_64-suse-linux",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-manbo-linux-gnu/gcc/x86_64-manbo-linux-gnu",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-linux-gnu/gcc/x86_64-linux-gnu",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-slackware-linux/gcc/x86_64-slackware-linux",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-unknown-linux/gcc/x86_64-unknown-linux",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-amazon-linux/gcc/x86_64-amazon-linux",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-linux-android/gcc/x86_64-linux-android",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/home/antipov/.local/llvm-12.0.0/bin/../lib64/x86_64-unknown-linux-gnu/gcc/x86_64-unknown-linux-gnu",
 O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  stat("/home/antipov/.local/llvm-12.0.0/bin/../lib", 0x7ffe4ed007d0) = -1 
ENOENT (No such file or directory)
  stat("/home/antipov/.local/llvm-12.0.0/bin/../lib32", 0x7ffe4ed007d0) = -1 
ENOENT (No such file or directory)
  stat("/home/antipov/.local/llvm-12.0.0/bin/../lib", 0x7ffe4ed007d0) = -1 
ENOENT (No such file or directory)
  stat("/opt/rh/devtoolset-9/root/usr", 0x7ffe4ed007d0) = -1 ENOENT (No such 
file or directory)
  stat("/opt/rh/devtoolset-8/root/usr", 0x7ffe4ed007d0) = -1 ENOENT (No such 
file or directory)
  stat("/opt/rh/devtoolset-7/root/usr", 0x7ffe4ed007d0) = -1 ENOENT (No such 
file or directory)
  stat("/opt/rh/devtoolset-6/root/usr", 0x7ffe4ed007d0) = -1 ENOENT (No such 
file or directory)
  stat("/opt/rh/devtoolset-4/root/usr", 0x7ffe4ed007d0) = -1 ENOENT (No such 
file or directory)
  stat("/opt/rh/devtoolset-3/root/usr", 0x7ffe4ed007d0) = -1 ENOENT (No such 
file or directory)
  stat("/opt/rh/devtoolset-2/root/usr", 0x7ffe4ed007d0) = -1 ENOENT (No such 
file or directory)
  stat("/usr", {st_mode=S_IFDIR|0755, st_size=155, ...}) = 0
  stat("/usr/lib64", {st_mode=S_IFDIR|0555, st_size=167936, ...}) = 0
  stat("/usr/lib64/gcc", 0x7ffe4ed007d0)  = -1 ENOENT (No such file or 
directory)
  stat("/usr/lib64/gcc-cross", 0x7ffe4ed007d0) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib64/x86_64-unknown-linux-gnu/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/x86_64-linux-gnu/gcc/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib64/x86_64-unknown-linux-gnu/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/x86_64-pc-linux-gnu/gcc/x86_64-pc-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib64/x86_64-redhat-linux6E/gcc/x86_64-redhat-linux6E", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/x86_64-redhat-linux/gcc/x86_64-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/x86_64-suse-linux/gcc/x86_64-suse-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib64/x86_64-manbo-linux-gnu/gcc/x86_64-manbo-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/x86_64-linux-gnu/gcc/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib64/x86_64-slackware-linux/gcc/x86_64-slackware-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/x86_64-unknown-linux/gcc/x86_64-unknown-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/x86_64-amazon-linux/gcc/x86_64-amazon-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib64/x86_64-linux-android/gcc/x86_64-linux-android", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib64/x86_64-unknown-linux-gnu/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  stat("/usr/lib", {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0
  stat("/usr/lib/gcc", {st_mode=S_IFDIR|0755, st_size=33, ...}) = 0
  stat("/usr/lib/gcc-cross", 0x7ffe4ed007d0) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib/x86_64-unknown-linux-gnu/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib/x86_64-unknown-linux-gnu/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-pc-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/x86_64-pc-linux-gnu/gcc/x86_64-pc-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-redhat-linux6E", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/x86_64-redhat-linux6E/gcc/x86_64-redhat-linux6E", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
  stat("/usr/lib/gcc/x86_64-redhat-linux/10/64/crtbegin.o", 0x7ffe4ecff840) = 
-1 ENOENT (No such file or directory)
  stat("/usr/lib/gcc/x86_64-redhat-linux/10/crtbegin.o", {st_mode=S_IFREG|0644, 
st_size=2960, ...}) = 0
  stat("/usr/lib/gcc/x86_64-redhat-linux/10/64/crtbegin.o", 0x7ffe4ecff630) = 
-1 ENOENT (No such file or directory)
  stat("/usr/lib/gcc/x86_64-redhat-linux/10/32/crtbegin.o", 
{st_mode=S_IFREG|0644, st_size=2056, ...}) = 0
  stat("/usr/lib/gcc/x86_64-redhat-linux/10/x32/crtbegin.o", 0x7ffe4ecff6a0) = 
-1 ENOENT (No such file or directory)
  openat(AT_FDCWD, "/usr/lib/x86_64-redhat-linux/gcc/x86_64-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-suse-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/x86_64-suse-linux/gcc/x86_64-suse-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-manbo-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib/x86_64-manbo-linux-gnu/gcc/x86_64-manbo-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-slackware-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib/x86_64-slackware-linux/gcc/x86_64-slackware-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-unknown-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/x86_64-unknown-linux/gcc/x86_64-unknown-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-amazon-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/x86_64-amazon-linux/gcc/x86_64-amazon-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-linux-android", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/x86_64-linux-android/gcc/x86_64-linux-android", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib/x86_64-unknown-linux-gnu/gcc/x86_64-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  stat("/usr/lib32", 0x7ffe4ed007d0)      = -1 ENOENT (No such file or 
directory)
  stat("/usr/lib", {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0
  openat(AT_FDCWD, "/usr/lib/gcc/i686-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i686-linux-gnu/gcc/i686-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i686-pc-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i686-pc-linux-gnu/gcc/i686-pc-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i486-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i486-linux-gnu/gcc/i486-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i386-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i386-linux-gnu/gcc/i386-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i386-redhat-linux6E", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i386-redhat-linux6E/gcc/i386-redhat-linux6E", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i686-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i686-redhat-linux/gcc/i686-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i586-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i586-redhat-linux/gcc/i586-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i386-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i386-redhat-linux/gcc/i386-redhat-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i586-suse-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i586-suse-linux/gcc/i586-suse-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i486-slackware-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i486-slackware-linux/gcc/i486-slackware-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i686-montavista-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i686-montavista-linux/gcc/i686-montavista-linux", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i586-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i586-linux-gnu/gcc/i586-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i686-linux-android", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i686-linux-android/gcc/i686-linux-android", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i386-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i386-gnu/gcc/i386-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i486-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i486-gnu/gcc/i486-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i586-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i586-gnu/gcc/i586-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i686-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/i686-gnu/gcc/i686-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, "/usr/lib/gcc/i386-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)
  openat(AT_FDCWD, 
"/usr/lib/i386-unknown-linux-gnu/gcc/i386-unknown-linux-gnu", 
O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or 
directory)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D87901

Files:
  clang/lib/Driver/ToolChains/Gnu.cpp
  clang/lib/Driver/ToolChains/Gnu.h


Index: clang/lib/Driver/ToolChains/Gnu.h
===================================================================
--- clang/lib/Driver/ToolChains/Gnu.h
+++ clang/lib/Driver/ToolChains/Gnu.h
@@ -212,6 +212,10 @@
     /// The set of multilibs that the detected installation supports.
     MultilibSet Multilibs;
 
+    // Internal flags used to filter out <libdir>/gcc and <libdir>/gcc-cross.
+    bool HasGCCDir;
+    bool HasGCCCrossDir;
+
   public:
     explicit GCCInstallationDetector(const Driver &D) : IsValid(false), D(D) {}
     void init(const llvm::Triple &TargetTriple, const llvm::opt::ArgList &Args,
Index: clang/lib/Driver/ToolChains/Gnu.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Gnu.cpp
+++ clang/lib/Driver/ToolChains/Gnu.cpp
@@ -1945,6 +1945,9 @@
       const std::string LibDir = Prefix + Suffix.str();
       if (!D.getVFS().exists(LibDir))
         continue;
+      // Maybe filter out <libdir>/gcc and <libdir>/gcc-cross.
+      HasGCCDir = D.getVFS().exists(LibDir + "/gcc");
+      HasGCCCrossDir = D.getVFS().exists(LibDir + "/gcc-cross");
       // Try to match the exact target triple first.
       ScanLibDirForGCCTriple(TargetTriple, Args, LibDir, TargetTriple.str());
       // Try rest of possible triples.
@@ -2463,12 +2466,13 @@
     // Whether this library suffix is relevant for the triple.
     bool Active;
   } Suffixes[] = {
-      // This is the normal place.
-      {"gcc/" + CandidateTriple.str(), "../..", true},
+      // This is the normal place if Clang is installed alongside with GCC,
+      // probably with the same prefix. But it's likely does not exists in
+      // case of standalone Clang install.
+      {"gcc/" + CandidateTriple.str(), "../..", HasGCCDir},
 
       // Debian puts cross-compilers in gcc-cross.
-      {"gcc-cross/" + CandidateTriple.str(), "../..",
-       TargetTriple.getOS() != llvm::Triple::Solaris},
+      {"gcc-cross/" + CandidateTriple.str(), "../..", HasGCCCrossDir},
 
       // The Freescale PPC SDK has the gcc libraries in
       // <sysroot>/usr/lib/<triple>/x.y.z so have a look there as well. Only do


Index: clang/lib/Driver/ToolChains/Gnu.h
===================================================================
--- clang/lib/Driver/ToolChains/Gnu.h
+++ clang/lib/Driver/ToolChains/Gnu.h
@@ -212,6 +212,10 @@
     /// The set of multilibs that the detected installation supports.
     MultilibSet Multilibs;
 
+    // Internal flags used to filter out <libdir>/gcc and <libdir>/gcc-cross.
+    bool HasGCCDir;
+    bool HasGCCCrossDir;
+
   public:
     explicit GCCInstallationDetector(const Driver &D) : IsValid(false), D(D) {}
     void init(const llvm::Triple &TargetTriple, const llvm::opt::ArgList &Args,
Index: clang/lib/Driver/ToolChains/Gnu.cpp
===================================================================
--- clang/lib/Driver/ToolChains/Gnu.cpp
+++ clang/lib/Driver/ToolChains/Gnu.cpp
@@ -1945,6 +1945,9 @@
       const std::string LibDir = Prefix + Suffix.str();
       if (!D.getVFS().exists(LibDir))
         continue;
+      // Maybe filter out <libdir>/gcc and <libdir>/gcc-cross.
+      HasGCCDir = D.getVFS().exists(LibDir + "/gcc");
+      HasGCCCrossDir = D.getVFS().exists(LibDir + "/gcc-cross");
       // Try to match the exact target triple first.
       ScanLibDirForGCCTriple(TargetTriple, Args, LibDir, TargetTriple.str());
       // Try rest of possible triples.
@@ -2463,12 +2466,13 @@
     // Whether this library suffix is relevant for the triple.
     bool Active;
   } Suffixes[] = {
-      // This is the normal place.
-      {"gcc/" + CandidateTriple.str(), "../..", true},
+      // This is the normal place if Clang is installed alongside with GCC,
+      // probably with the same prefix. But it's likely does not exists in
+      // case of standalone Clang install.
+      {"gcc/" + CandidateTriple.str(), "../..", HasGCCDir},
 
       // Debian puts cross-compilers in gcc-cross.
-      {"gcc-cross/" + CandidateTriple.str(), "../..",
-       TargetTriple.getOS() != llvm::Triple::Solaris},
+      {"gcc-cross/" + CandidateTriple.str(), "../..", HasGCCCrossDir},
 
       // The Freescale PPC SDK has the gcc libraries in
       // <sysroot>/usr/lib/<triple>/x.y.z so have a look there as well. Only do
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to