summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2016-05-11 22:52:13 +0200
committerMichał Górny <mgorny@gentoo.org>2016-05-12 13:48:41 +0200
commit0cb681567736f4f580e0d0a9aae65553566109c1 (patch)
treec83b89a304e06a1443df063b365b3b1398f2d9f1 /sys-devel
parentsys-devel/llvm: Clean up old 3.7 versions (diff)
downloadgentoo-0cb681567736f4f580e0d0a9aae65553566109c1.tar.gz
gentoo-0cb681567736f4f580e0d0a9aae65553566109c1.tar.bz2
gentoo-0cb681567736f4f580e0d0a9aae65553566109c1.zip
sys-devel/llvm: Backport upstream patch for gcc4.9 Gentoo header paths
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/llvm/files/clang-3.8-gcc4.9-search-path.patch70
-rw-r--r--sys-devel/llvm/llvm-3.7.1-r2.ebuild (renamed from sys-devel/llvm/llvm-3.7.1-r1.ebuild)4
-rw-r--r--sys-devel/llvm/llvm-3.8.0-r2.ebuild (renamed from sys-devel/llvm/llvm-3.8.0-r1.ebuild)4
3 files changed, 78 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 000000000000..bafe218ceba6
--- /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 \
diff --git a/sys-devel/llvm/llvm-3.7.1-r1.ebuild b/sys-devel/llvm/llvm-3.7.1-r2.ebuild
index 7bd5432dd533..10e5e160848c 100644
--- a/sys-devel/llvm/llvm-3.7.1-r1.ebuild
+++ b/sys-devel/llvm/llvm-3.7.1-r2.ebuild
@@ -178,6 +178,10 @@ src_prepare() {
# Automatically select active system GCC's libraries, bugs #406163 and #417913
eapply "${FILESDIR}"/clang-3.5-gentoo-runtime-gcc-detection-v3.patch
+ # Support gcc4.9 search paths
+ # https://github.com/llvm-mirror/clang/commit/af4db76e059c1a3
+ eapply "${FILESDIR}"/clang-3.8-gcc4.9-search-path.patch
+
eapply "${FILESDIR}"/clang-3.6-gentoo-install.patch
eapply "${FILESDIR}"/clang-3.4-darwin_prefix-include-paths.patch
diff --git a/sys-devel/llvm/llvm-3.8.0-r1.ebuild b/sys-devel/llvm/llvm-3.8.0-r2.ebuild
index fe8e3e71e25d..71a927fd779f 100644
--- a/sys-devel/llvm/llvm-3.8.0-r1.ebuild
+++ b/sys-devel/llvm/llvm-3.8.0-r2.ebuild
@@ -174,6 +174,10 @@ src_prepare() {
# Automatically select active system GCC's libraries, bugs #406163 and #417913
eapply "${FILESDIR}"/clang-3.5-gentoo-runtime-gcc-detection-v3.patch
+ # Support gcc4.9 search paths
+ # https://github.com/llvm-mirror/clang/commit/af4db76e059c1a3
+ eapply "${FILESDIR}"/clang-3.8-gcc4.9-search-path.patch
+
eapply "${FILESDIR}"/clang-3.4-darwin_prefix-include-paths.patch
eprefixify tools/clang/lib/Frontend/InitHeaderSearch.cpp