summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-devel/llvm/files/clang-3.8-gcc4.9-search-path.patch')
-rw-r--r--sys-devel/llvm/files/clang-3.8-gcc4.9-search-path.patch70
1 files changed, 70 insertions, 0 deletions
diff --git a/sys-devel/llvm/files/clang-3.8-gcc4.9-search-path.patch b/sys-devel/llvm/files/clang-3.8-gcc4.9-search-path.patch
new file mode 100644
index 00000000000..bafe218ceba
--- /dev/null
+++ b/sys-devel/llvm/files/clang-3.8-gcc4.9-search-path.patch
@@ -0,0 +1,70 @@
+From af4db76e059c1a3f4a7f437001051ccebc8a50fe Mon Sep 17 00:00:00 2001
+From: Chandler Carruth <chandlerc@gmail.com>
+Date: Sun, 8 May 2016 07:59:56 +0000
+Subject: [PATCH] Teach header search about GCC 4.9 header search paths in
+ Gentoo, they now use the full GCC version in their weird suffix.
+
+git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@268874 91177308-0d34-0410-b5e6-96231b3b80d8
+---
+ lib/Driver/ToolChains.cpp | 1 +
+ .../Inputs/gentoo_linux_gcc_4.9.3_tree/usr/include/.keep | 0
+ .../usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/crtbegin.o | 0
+ .../x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/.keep | 0
+ .../usr/x86_64-pc-linux-gnu/lib/.keep | 0
+ test/Driver/linux-header-search.cpp | 15 +++++++++++++++
+ 6 files changed, 16 insertions(+)
+ create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/include/.keep
+ create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/crtbegin.o
+ create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/.keep
+ create mode 100644 test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/x86_64-pc-linux-gnu/lib/.keep
+
+diff --git a/tools/clang/lib/Driver/ToolChains.cpp b/tools/clang/lib/Driver/ToolChains.cpp
+index f905b5d..1bf17e4 100644
+--- a/tools/clang/lib/Driver/ToolChains.cpp
++++ b/tools/clang/lib/Driver/ToolChains.cpp
+@@ -4134,6 +4134,7 @@ void Linux::AddClangCXXStdlibIncludeArgs(const ArgList &DriverArgs,
+ const std::string LibStdCXXIncludePathCandidates[] = {
+ // Gentoo is weird and places its headers inside the GCC install,
+ // so if the first attempt to find the headers fails, try these patterns.
++ InstallDir.str() + "/include/g++-v" + Version.Text,
+ InstallDir.str() + "/include/g++-v" + Version.MajorStr + "." +
+ Version.MinorStr,
+ InstallDir.str() + "/include/g++-v" + Version.MajorStr,
+diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/include/.keep b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/include/.keep
+new file mode 100644
+index 0000000..e69de29
+diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/crtbegin.o b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/crtbegin.o
+new file mode 100644
+index 0000000..e69de29
+diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/.keep b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/.keep
+new file mode 100644
+index 0000000..e69de29
+diff --git a/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/x86_64-pc-linux-gnu/lib/.keep b/tools/clang/test/Driver/Inputs/gentoo_linux_gcc_4.9.3_tree/usr/x86_64-pc-linux-gnu/lib/.keep
+new file mode 100644
+index 0000000..e69de29
+diff --git a/tools/clang/test/Driver/linux-header-search.cpp b/tools/clang/test/Driver/linux-header-search.cpp
+index 9568bde..5f6ac50 100644
+--- a/tools/clang/test/Driver/linux-header-search.cpp
++++ b/tools/clang/test/Driver/linux-header-search.cpp
+@@ -285,6 +285,21 @@
+ // CHECK-GENTOO-4-6-4: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
+ // CHECK-GENTOO-4-6-4: "-internal-externc-isystem" "[[SYSROOT]]/include"
+ // CHECK-GENTOO-4-6-4: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
++// RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \
++// RUN: -target x86_64-unknown-linux-gnu -stdlib=libstdc++ \
++// RUN: --sysroot=%S/Inputs/gentoo_linux_gcc_4.9.3_tree \
++// RUN: --gcc-toolchain="" \
++// RUN: | FileCheck --check-prefix=CHECK-GENTOO-4-9-3 %s
++// CHECK-GENTOO-4-9-3: "{{.*}}clang{{.*}}" "-cc1"
++// CHECK-GENTOO-4-9-3: "-resource-dir" "[[RESOURCE_DIR:[^"]+]]"
++// CHECK-GENTOO-4-9-3: "-isysroot" "[[SYSROOT:[^"]+]]"
++// CHECK-GENTOO-4-9-3: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3"
++// CHECK-GENTOO-4-9-3: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/x86_64-pc-linux-gnu"
++// CHECK-GENTOO-4-9-3: "-internal-isystem" "[[SYSROOT]]/usr/lib/gcc/x86_64-pc-linux-gnu/4.9.3/include/g++-v4.9.3/backward"
++// CHECK-GENTOO-4-9-3: "-internal-isystem" "[[SYSROOT]]/usr/local/include"
++// CHECK-GENTOO-4-9-3: "-internal-isystem" "[[RESOURCE_DIR]]{{/|\\\\}}include"
++// CHECK-GENTOO-4-9-3: "-internal-externc-isystem" "[[SYSROOT]]/include"
++// CHECK-GENTOO-4-9-3: "-internal-externc-isystem" "[[SYSROOT]]/usr/include"
+ //
+ // Check header search on Debian 6 / MIPS64
+ // RUN: %clang -no-canonical-prefixes %s -### -fsyntax-only 2>&1 \