1 |
commit: 2b1e59aeb9e8d2fae5e602b67a8aba95536a006e |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Sep 26 08:19:04 2016 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Sep 26 08:27:06 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b1e59ae |
7 |
|
8 |
sys-devel/clang: Fix the gcc-config patch not to break --gcc-toolchain |
9 |
|
10 |
...ort-obtaining-active-toolchain-from-gcc-c.patch | 50 ++++++++++++---------- |
11 |
1 file changed, 28 insertions(+), 22 deletions(-) |
12 |
|
13 |
diff --git a/sys-devel/clang/files/9999/0002-driver-Support-obtaining-active-toolchain-from-gcc-c.patch b/sys-devel/clang/files/9999/0002-driver-Support-obtaining-active-toolchain-from-gcc-c.patch |
14 |
index 6128cb9..00bf280 100644 |
15 |
--- a/sys-devel/clang/files/9999/0002-driver-Support-obtaining-active-toolchain-from-gcc-c.patch |
16 |
+++ b/sys-devel/clang/files/9999/0002-driver-Support-obtaining-active-toolchain-from-gcc-c.patch |
17 |
@@ -1,39 +1,45 @@ |
18 |
-From 67025453e6c2373c8d761f6435e7fa4ddaacd8fa Mon Sep 17 00:00:00 2001 |
19 |
+From 0384060d2de35ee56aa252cc18eccf773d674d56 Mon Sep 17 00:00:00 2001 |
20 |
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o> |
21 |
Date: Fri, 5 Sep 2014 16:49:35 +0200 |
22 |
-Subject: [PATCH 2/7] driver: Support obtaining active toolchain from |
23 |
- gcc-config on Gentoo |
24 |
+Subject: [PATCH] driver: Support obtaining active toolchain from gcc-config on |
25 |
+ Gentoo |
26 |
|
27 |
Author: Richard Yao <ryao@g.o> |
28 |
Bug: https://bugs.gentoo.org/406163 |
29 |
Bug: https://bugs.gentoo.org/417913 |
30 |
--- |
31 |
- lib/Driver/ToolChains.cpp | 19 +++++++++++++++++++ |
32 |
- 1 file changed, 19 insertions(+) |
33 |
+ lib/Driver/ToolChains.cpp | 25 +++++++++++++++++++++++++ |
34 |
+ 1 file changed, 25 insertions(+) |
35 |
|
36 |
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp |
37 |
-index 68d5214..7689f86 100644 |
38 |
+index 67f165c..0f0d786 100644 |
39 |
--- a/lib/Driver/ToolChains.cpp |
40 |
+++ b/lib/Driver/ToolChains.cpp |
41 |
-@@ -1418,6 +1418,25 @@ void Generic_GCC::GCCInstallationDetector::init( |
42 |
+@@ -1430,6 +1430,31 @@ void Generic_GCC::GCCInstallationDetector::init( |
43 |
} |
44 |
} |
45 |
|
46 |
-+ for (unsigned k = 0, ke = CandidateTripleAliases.size(); k < ke; ++k) { |
47 |
-+ llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File = |
48 |
-+ llvm::MemoryBuffer::getFile(D.SysRoot + "/etc/env.d/gcc/config-" + CandidateTripleAliases[k].str()); |
49 |
-+ if (File) |
50 |
-+ { |
51 |
-+ const std::string VersionText = File.get()->getBuffer().rsplit('-').second.substr(0,5).str(); |
52 |
-+ const std::string GentooPath = D.SysRoot + "/usr/lib/gcc/" + CandidateTripleAliases[k].str() + "/" + VersionText; |
53 |
-+ if (llvm::sys::fs::exists(GentooPath + "/crtbegin.o")) |
54 |
++ // Try to respect gcc-config on Gentoo. However, do that only |
55 |
++ // if --gcc-toolchain is not provided or equal to the Gentoo default. |
56 |
++ // This avoids accidentally enforcing system GCC version when using |
57 |
++ // a custom toolchain. |
58 |
++ if (GCCToolchainDir == "" || GCCToolchainDir == D.SysRoot + "/usr") { |
59 |
++ for (unsigned k = 0, ke = CandidateTripleAliases.size(); k < ke; ++k) { |
60 |
++ llvm::ErrorOr<std::unique_ptr<llvm::MemoryBuffer>> File = |
61 |
++ llvm::MemoryBuffer::getFile(D.SysRoot + "/etc/env.d/gcc/config-" + CandidateTripleAliases[k].str()); |
62 |
++ if (File) |
63 |
+ { |
64 |
-+ Version = GCCVersion::Parse(VersionText); |
65 |
-+ GCCInstallPath = GentooPath; |
66 |
-+ GCCParentLibPath = GCCInstallPath + "/../../.."; |
67 |
-+ GCCTriple.setTriple(CandidateTripleAliases[k]); |
68 |
-+ IsValid = true; |
69 |
-+ return; |
70 |
++ const std::string VersionText = File.get()->getBuffer().rsplit('-').second.substr(0,5).str(); |
71 |
++ const std::string GentooPath = D.SysRoot + "/usr/lib/gcc/" + CandidateTripleAliases[k].str() + "/" + VersionText; |
72 |
++ if (llvm::sys::fs::exists(GentooPath + "/crtbegin.o")) |
73 |
++ { |
74 |
++ Version = GCCVersion::Parse(VersionText); |
75 |
++ GCCInstallPath = GentooPath; |
76 |
++ GCCParentLibPath = GCCInstallPath + "/../../.."; |
77 |
++ GCCTriple.setTriple(CandidateTripleAliases[k]); |
78 |
++ IsValid = true; |
79 |
++ return; |
80 |
++ } |
81 |
+ } |
82 |
+ } |
83 |
+ } |
84 |
@@ -42,5 +48,5 @@ index 68d5214..7689f86 100644 |
85 |
// installation available. GCC installs are ranked by version number. |
86 |
Version = GCCVersion::Parse("0.0.0"); |
87 |
-- |
88 |
-2.9.3 |
89 |
+2.10.0 |