1 |
ryao 12/06/05 02:03:46 |
2 |
|
3 |
Added: clang-3.1-gentoo-runtime-gcc-detection-v2.patch |
4 |
Log: |
5 |
Generalize GCC version check, which fixes bug #417913 and bug #418141 |
6 |
|
7 |
(Portage version: 2.1.10.49/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 sys-devel/clang/files/clang-3.1-gentoo-runtime-gcc-detection-v2.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/clang/files/clang-3.1-gentoo-runtime-gcc-detection-v2.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sys-devel/clang/files/clang-3.1-gentoo-runtime-gcc-detection-v2.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: clang-3.1-gentoo-runtime-gcc-detection-v2.patch |
16 |
=================================================================== |
17 |
diff -upNr a/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp b/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp |
18 |
--- a/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp 2012-05-24 03:32:31.593191000 -0400 |
19 |
+++ b/llvm-3.1.src/tools/clang/lib/Driver/ToolChains.cpp 2012-05-24 03:38:31.733163513 -0400 |
20 |
@@ -1145,6 +1145,24 @@ Generic_GCC::GCCInstallationDetector::GC |
21 |
Prefixes.push_back(D.InstalledDir + "/.."); |
22 |
} |
23 |
|
24 |
+ llvm::OwningPtr<llvm::MemoryBuffer> File; |
25 |
+ for (unsigned k = 0, ke = CandidateTripleAliases.size(); k < ke; ++k) { |
26 |
+ if (!llvm::MemoryBuffer::getFile(D.SysRoot + "/etc/env.d/gcc/config-" + CandidateTripleAliases[k].str(), File)) |
27 |
+ { |
28 |
+ bool Exists; |
29 |
+ const std::string VersionText = File.get()->getBuffer().rsplit('-').second.substr(0,5).str(); |
30 |
+ const std::string GentooPath = D.SysRoot + "/usr/lib/gcc/" + CandidateTripleAliases[k].str() + "/" + VersionText; |
31 |
+ if (!llvm::sys::fs::exists(GentooPath + "/crtbegin.o", Exists) && Exists) |
32 |
+ { |
33 |
+ Version = GCCVersion::Parse(VersionText); |
34 |
+ GCCInstallPath = GentooPath; |
35 |
+ GCCParentLibPath = GCCInstallPath + "/../../.."; |
36 |
+ IsValid = true; |
37 |
+ return; |
38 |
+ } |
39 |
+ } |
40 |
+ } |
41 |
+ |
42 |
// Loop over the various components which exist and select the best GCC |
43 |
// installation available. GCC installs are ranked by version number. |
44 |
Version = GCCVersion::Parse("0.0.0"); |