summaryrefslogtreecommitdiffstats
path: root/testing/llvm/clang-3.6-add-alpine-distro.patch
blob: 9b959d335dbaf79e9e2100afe310177630f44036 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
diff --git a/lib/Driver/ToolChains.cpp b/lib/Driver/ToolChains.cpp
index f789fd5..6d75b4b 100644
--- a/lib/Driver/ToolChains.cpp
+++ b/lib/Driver/ToolChains.cpp
@@ -2667,12 +2673,13 @@ Tool *Solaris::buildLinker() const {
   return new tools::solaris::Link(*this);
 }

 /// Distribution (very bare-bones at the moment).

 enum Distro {
+  AlpineLinux,
   ArchLinux,
   DebianLenny,
   DebianSqueeze,
   DebianWheezy,
   DebianJessie,
   Exherbo,
@@ -2778,12 +2785,15 @@ static Distro DetectDistro(llvm::Triple::ArchType Arch) {
   if (llvm::sys::fs::exists("/etc/exherbo-release"))
     return Exherbo;

   if (llvm::sys::fs::exists("/etc/arch-release"))
     return ArchLinux;

+  if (llvm::sys::fs::exists("/etc/alpine-release"))
+    return AlpineLinux;
+
   return UnknownDistro;
 }

 /// \brief Get our best guess at the multiarch triple for a target.
 ///
 /// Debian-based systems are starting to use a multiarch setup where they use