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
|
--- ./tools/clang/lib/Driver/ToolChains.cpp.orig
+++ ./tools/clang/lib/Driver/ToolChains.cpp
@@ -1198,7 +1198,8 @@
"x86_64-suse-linux",
"x86_64-manbo-linux-gnu",
"x86_64-linux-gnu",
- "x86_64-slackware-linux"
+ "x86_64-slackware-linux",
+ "x86_64-alpine-linux-uclibc"
};
static const char *const X86LibDirs[] = { "/lib32", "/lib" };
static const char *const X86Triples[] = {
@@ -1210,7 +1211,8 @@
"i586-redhat-linux",
"i386-redhat-linux",
"i586-suse-linux",
- "i486-slackware-linux"
+ "i486-slackware-linux",
+ "i486-alpine-linux-uclibc"
};
static const char *const MIPSLibDirs[] = { "/lib" };
@@ -1814,6 +1816,7 @@
/// Linux toolchain (very bare-bones at the moment).
enum LinuxDistro {
+ AlpineLinux,
ArchLinux,
DebianLenny,
DebianSqueeze,
@@ -1935,6 +1938,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;
}
diff --git a/tools/clang/lib/Driver/Tools.cpp b/tools/clang/lib/Driver/Tools.cpp
index 6151e88..d811789 100644
--- a/tools/clang/lib/Driver/Tools.cpp
+++ b/tools/clang/lib/Driver/Tools.cpp
@@ -4308,7 +4308,7 @@ void linuxtools::Link::ConstructJob(Compilation &C, const JobAction &JA,
!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");
@@ -4317,7 +4317,7 @@ void linuxtools::Link::ConstructJob(Compilation &C, const JobAction &JA,
else if (ToolChain.getArch() == llvm::Triple::ppc64)
CmdArgs.push_back("/lib64/ld64.so.1");
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");
|