[Driver] Support g++ headers in include/g++

ray's gcc installation puts C++ headers in PREFIX/include/g++ without
indicating a gcc version at all. Typically this is because the version
is encoded somewhere in PREFIX.

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

llvm-svn: 346802
This commit is contained in:
David Greene 2018-11-13 21:38:45 +00:00
parent 3dfcb848e3
commit c03328a7c0
6 changed files with 15 additions and 0 deletions

View File

@ -930,6 +930,9 @@ void Linux::addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
// Freescale SDK C++ headers are directly in <sysroot>/usr/include/c++,
// without a subdirectory corresponding to the gcc version.
LibDir.str() + "/../include/c++",
// Cray's gcc installation puts headers under "g++" without a
// version suffix.
LibDir.str() + "/../include/g++",
};
for (const auto &IncludePath : LibStdCXXIncludePathCandidates) {

View File

@ -517,3 +517,15 @@
// CHECK-OE-AARCH64: "-isysroot" "[[SYSROOT:[^"]+]]"
// CHECK-OE-AARCH64: "-internal-isystem" "[[SYSROOT]]/usr/lib64/aarch64-oe-linux/6.3.0/../../../include/c++/6.3.0"
// CHECK-OE-AARCH64: "-internal-isystem" "[[SYSROOT]]/usr/lib64/aarch64-oe-linux/6.3.0/../../../include/c++/6.3.0/backward"
// Check header search with Cray's gcc package.
// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
// RUN: -target x86_64-unknown-linux-gnu -stdlib=libstdc++ \
// RUN: --sysroot=%S/Inputs/cray_suse_gcc_tree \
// RUN: --gcc-toolchain="%S/Inputs/cray_suse_gcc_tree/opt/gcc/8.2.0/snos" \
// RUN: | FileCheck --check-prefix=CHECK-CRAY-X86 %s
// CHECK-CRAY-X86: "{{[^"]*}}clang{{[^"]*}}" "-cc1"
// CHECK-CRAY-X86: "-isysroot" "[[SYSROOT:[^"]+]]"
// CHECK-CRAY-X86: "-internal-isystem" "[[SYSROOT]]/opt/gcc/8.2.0/snos/lib/gcc/x86_64-suse-linux/8.2.0/../../../../include/g++"
// CHECK-CRAY-X86: "-internal-isystem" "[[SYSROOT]]/opt/gcc/8.2.0/snos/lib/gcc/x86_64-suse-linux/8.2.0/../../../../include/g++/backward"