[all-commits] [llvm/llvm-project] e92d2b: [Driver] Detect libstdc++ include paths for native...

Fangrui Song via All-commits all-commits at lists.llvm.org
Sun Apr 4 10:15:28 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e92d2b80c6c913b5c506df06a913a2ecbf761617
      https://github.com/llvm/llvm-project/commit/e92d2b80c6c913b5c506df06a913a2ecbf761617
  Author: Fangrui Song <i at maskray.me>
  Date:   2021-04-04 (Sun, 04 Apr 2021)

  Changed paths:
    M clang/lib/Driver/ToolChains/Gnu.cpp
    A clang/test/Driver/Inputs/debian_i386_tree/lib/i386-linux-gnu/.keep
    A clang/test/Driver/Inputs/debian_i386_tree/lib/x86_64-linux-gnu/.keep
    A clang/test/Driver/Inputs/debian_i386_tree/lib64/.keep
    A clang/test/Driver/Inputs/debian_i386_tree/usr/include/c++/10/backward/.keep
    A clang/test/Driver/Inputs/debian_i386_tree/usr/include/i386-linux-gnu/c++/10/.keep
    A clang/test/Driver/Inputs/debian_i386_tree/usr/include/i386-linux-gnu/c++/10/64/.keep
    A clang/test/Driver/Inputs/debian_i386_tree/usr/include/x86_64-linux-gnu/.keep
    A clang/test/Driver/Inputs/debian_i386_tree/usr/lib/gcc/i686-linux-gnu/10/64/crtbegin.o
    A clang/test/Driver/Inputs/debian_i386_tree/usr/lib/gcc/i686-linux-gnu/10/crtbegin.o
    A clang/test/Driver/Inputs/debian_i386_tree/usr/lib/gcc/i686-linux-gnu/10/crtend.o
    A clang/test/Driver/Inputs/debian_i386_tree/usr/lib/i386-linux-gnu/crt1.o
    A clang/test/Driver/Inputs/debian_i386_tree/usr/lib/i386-linux-gnu/crti.o
    A clang/test/Driver/Inputs/debian_i386_tree/usr/lib/i386-linux-gnu/crtn.o
    A clang/test/Driver/Inputs/debian_i386_tree/usr/lib/x86_64-linux-gnu/.keep
    A clang/test/Driver/Inputs/debian_i386_tree/usr/lib64/.keep
    A clang/test/Driver/Inputs/debian_i386_tree/usr/lib64/crt1.o
    A clang/test/Driver/Inputs/debian_i386_tree/usr/lib64/crti.o
    A clang/test/Driver/Inputs/debian_i386_tree/usr/lib64/crtn.o
    M clang/test/Driver/linux-cross.cpp

  Log Message:
  -----------
  [Driver] Detect libstdc++ include paths for native gcc (-m32 and -m64) on Debian i386

Take gcc-8 on Debian i386 as an example. The target-specific libstdc++ search
path (`GPLUSPLUS_TOOL_INCLUDE_DIR`) uses the multiarch name `i386-linux-gnu`,
instead of the triple of the GCC installation `i686-linux-gnu` (the directory
under `usr/lib/gcc/`):

```
/usr/include/c++/8
/usr/include/i386-linux-gnu/c++/8
/usr/include/c++/8/backward
```

Clang currently detects `/usr/lib/gcc/i686-linux-gnu/8/../../../include/i686-linux-gnu/c++/8`.
This patch changes the second i686-linux-gnu to i386-linux-gnu so that
`/usr/include/i386-linux-gnu/c++/8` can be found.

Fix PR49827 - this was somehow regressed by my previous libstdc++ include path
cleanups and fixes for gcc-cross, but it seems that the paths were never properly tested before.

Differential Revision: https://reviews.llvm.org/D99852




More information about the All-commits mailing list