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
|
diff --git a/tools/clang/lib/Driver/ToolChains.cpp b/tools/clang/lib/Driver/ToolChains.cpp
index eb730e5..3e4afae 100644
--- a/tools/clang/lib/Driver/ToolChains.cpp
+++ b/tools/clang/lib/Driver/ToolChains.cpp
@@ -1377,6 +1377,7 @@ Tool &AuroraUX::SelectTool(const Compilation &C, const JobAction &JA,
/// Linux toolchain (very bare-bones at the moment).
enum LinuxDistro {
+ AlpineLinux,
ArchLinux,
DebianLenny,
DebianSqueeze,
@@ -1507,6 +1508,9 @@ static LinuxDistro DetectLinuxDistro(llvm::Triple::ArchType Arch) {
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;
}
@@ -1655,7 +1659,8 @@ Linux::GCCInstallationDetector::GCCInstallationDetector(const Driver &D)
"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"
};
LibDirs.append(X86_64LibDirs,
X86_64LibDirs + llvm::array_lengthof(X86_64LibDirs));
@@ -1672,7 +1677,8 @@ Linux::GCCInstallationDetector::GCCInstallationDetector(const Driver &D)
"i586-redhat-linux",
"i386-redhat-linux",
"i586-suse-linux",
- "i486-slackware-linux"
+ "i486-slackware-linux",
+ "i486-alpine-linux-uclibc"
};
LibDirs.append(X86LibDirs, X86LibDirs + llvm::array_lengthof(X86LibDirs));
Triples.append(X86Triples, X86Triples + llvm::array_lengthof(X86Triples));
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");
|