summaryrefslogtreecommitdiffstats
path: root/main/llvm/clang-2.9-alpine-linux.patch
blob: f53aee4b92ec29f1412215a3aa3e09ba051ca568 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
--- ./tools.orig/clang/lib/Driver/ToolChains.cpp
+++ ./tools/clang/lib/Driver/ToolChains.cpp
@@ -1273,6 +1273,7 @@
 /// Linux toolchain (very bare-bones at the moment).
 
 enum LinuxDistro {
+  AlpineLinux,
   ArchLinux,
   DebianLenny,
   DebianSqueeze,
@@ -1380,6 +1381,9 @@
   if (!llvm::sys::fs::exists("/etc/arch-release", Exists) && Exists)
     return ArchLinux;
 
+  if (!llvm::sys::fs::exists("/etc/alpine-release", Exists) && Exists)
+    return AlpineLinux;
+
   return UnknownDistro;
 }
 
@@ -1432,6 +1436,9 @@
     else if (!llvm::sys::fs::exists("/usr/lib/gcc/x86_64-manbo-linux-gnu",
              Exists) && Exists)
       GccTriple = "x86_64-manbo-linux-gnu";
+    else if (!llvm::sys::fs::exists("/usr/lib/gcc/x86_64-alpine-linux-uclibc",
+             Exists) && Exists)
+      GccTriple = "x86_64-alpine-linux-uclibc";
   } else if (Arch == llvm::Triple::x86) {
     if (!llvm::sys::fs::exists("/usr/lib/gcc/i686-linux-gnu", Exists) && Exists)
       GccTriple = "i686-linux-gnu";
@@ -1447,9 +1454,13 @@
     else if (!llvm::sys::fs::exists("/usr/lib/gcc/i586-suse-linux", Exists) &&
              Exists)
       GccTriple = "i586-suse-linux";
+    else if (!llvm::sys::fs::exists("/usr/lib/gcc/i486-alpine-linux-uclibc", Exists) &&
+             Exists)
+      GccTriple = "i486-alpine-linux-uclibc";
   }
 
-  const char* GccVersions[] = {"4.5.2", "4.5.1", "4.5", "4.4.5", "4.4.4",
+  const char* GccVersions[] = {"4.6.3", "4.6.2", "4.6.1", "4.6.0",
+                               "4.5.2", "4.5.1", "4.5", "4.4.5", "4.4.4",
                                "4.4.3", "4.4", "4.3.4", "4.3.3", "4.3.2",
                                "4.3", "4.2.4", "4.2.3", "4.2.2", "4.2.1",
                                "4.2"};
@@ -1513,7 +1524,7 @@
       Distro == UbuntuKarmic)
     ExtraOpts.push_back("--build-id");
 
-  if (Distro == ArchLinux)
+  if (Distro == ArchLinux || Distro == AlpineLinux)
     Lib = "lib";
 
   Paths.push_back(Base + Suffix);
--- ./tools.orig/clang/lib/Driver/Tools.cpp
+++ ./tools/clang/lib/Driver/Tools.cpp
@@ -3621,12 +3621,12 @@
        !Args.hasArg(options::OPT_shared))) {
     CmdArgs.push_back("-dynamic-linker");
     if (ToolChain.getArch() == llvm::Triple::x86)
-      CmdArgs.push_back("/lib/ld-linux.so.2");
+      CmdArgs.push_back("/lib/ld-uClibc.so.0.9.32");
     else if (ToolChain.getArch() == llvm::Triple::arm ||
              ToolChain.getArch() == llvm::Triple::thumb)
       CmdArgs.push_back("/lib/ld-linux.so.3");
     else
-      CmdArgs.push_back("/lib64/ld-linux-x86-64.so.2");
+      CmdArgs.push_back("/lib/ld64-uClibc.so.0.9.32");
   }
 
   CmdArgs.push_back("-o");