summaryrefslogtreecommitdiff
path: root/sys-devel/clang/files/clang-3.0-freebsd-runtime-gcc-detection.patch
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2015-05-22 13:34:27 +0300
committerGluzskiy Alexandr <sss123next@list.ru>2015-05-22 13:34:27 +0300
commit607c21be93ef467d9f88a831a84b829c99e6ee1a (patch)
tree3f112917536d7a9d0600afd4210c7722a13973c7 /sys-devel/clang/files/clang-3.0-freebsd-runtime-gcc-detection.patch
parent11c9581a4a381cf91d76eb918e5c8520dc5e7258 (diff)
clang from gentoo repo
Diffstat (limited to 'sys-devel/clang/files/clang-3.0-freebsd-runtime-gcc-detection.patch')
-rw-r--r--sys-devel/clang/files/clang-3.0-freebsd-runtime-gcc-detection.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys-devel/clang/files/clang-3.0-freebsd-runtime-gcc-detection.patch b/sys-devel/clang/files/clang-3.0-freebsd-runtime-gcc-detection.patch
new file mode 100644
index 0000000..5c016f5
--- /dev/null
+++ b/sys-devel/clang/files/clang-3.0-freebsd-runtime-gcc-detection.patch
@@ -0,0 +1,20 @@
+diff -upNr a/llvm-3.0.src/tools/clang/lib/Driver/ToolChains.cpp b/llvm-3.0.src/tools/clang/lib/Driver/ToolChains.cpp
+--- a/llvm-3.0.src/tools/clang/lib/Driver/ToolChains.cpp 2012-05-23 15:45:01.333127000 -0400
++++ b/llvm-3.0.src/tools/clang/lib/Driver/ToolChains.cpp 2012-05-23 16:16:26.023642076 -0400
+@@ -1215,6 +1215,16 @@ FreeBSD::FreeBSD(const HostInfo &Host, c
+ } else {
+ getFilePaths().push_back("/usr/lib");
+ }
++
++ llvm::OwningPtr<llvm::MemoryBuffer> File;
++ if (!llvm::MemoryBuffer::getFile("/etc/env.d/gcc/config-" + getDriver().DefaultHostTriple, File))
++ {
++ bool Exists;
++ StringRef Version = File.get()->getBuffer().rsplit('-').second.substr(0,5);
++ const std::string GentooPath = "/usr/lib/gcc/" + getDriver().DefaultHostTriple + "/" + Version.str();
++ if (!llvm::sys::fs::exists(GentooPath + "/crtbegin.o", Exists) && Exists)
++ getFilePaths().push_back(GentooPath);
++ }
+ }
+
+ Tool &FreeBSD::SelectTool(const Compilation &C, const JobAction &JA,