[all-commits] [llvm/llvm-project] 9a19c7: [clang][Driver] Fix libc++ include path on NetBSD ...

Rainer Orth via All-commits all-commits at lists.llvm.org
Sun Aug 2 05:22:24 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9a19c7750f949c979372ba1d2eec8a7a40061aef
      https://github.com/llvm/llvm-project/commit/9a19c7750f949c979372ba1d2eec8a7a40061aef
  Author: Rainer Orth <ro at gcc.gnu.org>
  Date:   2026-08-02 (Sun, 02 Aug 2026)

  Changed paths:
    M clang/lib/Driver/ToolChains/NetBSD.cpp
    M clang/lib/Driver/ToolChains/NetBSD.h
    A clang/test/Driver/Inputs/install_tree_with_libcxx/bin/.keep
    A clang/test/Driver/Inputs/install_tree_with_libcxx/include/c++/v1/.keep
    A clang/test/Driver/Inputs/install_tree_with_libcxx/lib/.keep
    M clang/test/Driver/netbsd.cpp

  Log Message:
  -----------
  [clang][Driver] Fix libc++ include path on NetBSD (#212716)

`clang++` defaults to `-stdlib=libc++` on NetBSD. When building with
both `clang` and `libcxx` included, the freshly built `clang++` fails to
find `<__config_site>`:

```
In file included from /usr/include/strings.h:68:
In file included from bin/../include/c++/v1/string.h:57:
bin/../include/c++/v1/__config:13:10: fatal
error: '__config_site' file not found
   13 | #include <__config_site>
      |          ^~~~~~~~~~~~~~~
```

The file is present in `include/<triplet>/c++/v1`, but that isn't
searched by default. NetBSD has its own version of addLibCxxIncludePaths
which misses that directory.

This patch removes `NetBSD::addLibCxxIncludePaths` in favour of the
generic version in `Gnu.cpp`. The current code also adds
`/usr/include/c++`, although this directory only contains empty
directories in a default installation. It is only used when a bundled
version of LLVM is installed, which is not usually the case, and even
then contains a static version of `__config_site` that only applies to
`libcxxrt`.

Tested on `amd64-pc-netbsd10.1`, `x86_64-pc-solaris2.11`,
`x86_64-pc-linux-gnu`, and `x86_64-pc-freebsd15.1`.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list