1
+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2
+ From: Ruben De Smet <
[email protected] >
3
+ Date: Sun, 26 Jun 2022 10:57:51 +0200
4
+ Subject: [PATCH] Clang: SailfishOS toolchain
5
+
6
+ Signed-off-by: Ruben De Smet <
[email protected] >
7
+ ---
8
+ clang/include/clang/Driver/Distro.h | 5 +++++
9
+ clang/lib/Driver/Distro.cpp | 3 +++
10
+ clang/lib/Driver/ToolChains/Gnu.cpp | 4 +++-
11
+ clang/lib/Driver/ToolChains/Linux.cpp | 8 ++++----
12
+ 4 files changed, 15 insertions(+), 5 deletions(-)
13
+
1
14
diff --git a/clang/include/clang/Driver/Distro.h b/clang/include/clang/Driver/Distro.h
2
- index d382cf77a8b..8c06919f1d3 100644
15
+ index 2723f75e8945..58616ad541e1 100644
3
16
--- a/clang/include/clang/Driver/Distro.h
4
17
+++ b/clang/include/clang/Driver/Distro.h
5
- @@ -42 ,6 +42 ,7 @@ public:
18
+ @@ -45 ,6 +45 ,7 @@ public:
6
19
Fedora,
7
20
Gentoo,
8
21
OpenSUSE,
9
22
+ Sailfish,
10
23
UbuntuHardy,
11
24
UbuntuIntrepid,
12
25
UbuntuJaunty,
13
- @@ -119 ,6 +120 ,10 @@ public:
14
- return DistroVal >= DebianLenny && DistroVal <= DebianBullseye ;
26
+ @@ -124 ,6 +125 ,10 @@ public:
27
+ return DistroVal >= DebianLenny && DistroVal <= DebianBookworm ;
15
28
}
16
29
17
30
+ bool IsSailfish() const {
18
31
+ return DistroVal == Sailfish;
19
32
+ }
20
33
+
21
34
bool IsUbuntu() const {
22
- return DistroVal >= UbuntuHardy && DistroVal <= UbuntuFocal ;
35
+ return DistroVal >= UbuntuHardy && DistroVal <= UbuntuJammy ;
23
36
}
24
37
diff --git a/clang/lib/Driver/Distro.cpp b/clang/lib/Driver/Distro.cpp
25
- index 06707fefc9d..cf14a4073fd 100644
38
+ index 5ac38c34d112..cccb2026e527 100644
26
39
--- a/clang/lib/Driver/Distro.cpp
27
40
+++ b/clang/lib/Driver/Distro.cpp
28
- @@ -163 ,6 +163 ,9 @@ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS,
41
+ @@ -197 ,6 +197 ,9 @@ static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
29
42
if (VFS.exists("/etc/gentoo-release"))
30
43
return Distro::Gentoo;
31
44
@@ -36,40 +49,39 @@ index 06707fefc9d..cf14a4073fd 100644
36
49
}
37
50
38
51
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
39
- index e8ef881e89a..1bad4f13226 100644
52
+ index 7a9570a686f4..e7f57c824961 100644
40
53
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
41
54
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
42
- @@ -1999 ,7 +1999 ,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
55
+ @@ -2073 ,7 +2073 ,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
43
56
static const char *const AArch64LibDirs[] = {"/lib64", "/lib"};
44
57
static const char *const AArch64Triples[] = {
45
58
"aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux",
46
- - "aarch64-suse-linux", "aarch64-linux-android" };
47
- + "aarch64-suse-linux", "aarch64-linux-android", "aarch64- meego-linux-gnu"};
59
+ - "aarch64-suse-linux"};
60
+ + "aarch64-suse-linux", "aarch64-meego-linux-gnu"};
48
61
static const char *const AArch64beLibDirs[] = {"/lib"};
49
62
static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu",
50
63
"aarch64_be-linux-gnu"};
51
- @@ -2009 ,6 +2009 ,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
52
- "arm-linux-androideabi "};
64
+ @@ -2082 ,6 +2082 ,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
65
+ static const char *const ARMTriples[] = { "arm-linux-gnueabi "};
53
66
static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf",
54
67
"armv7hl-redhat-linux-gnueabi",
55
68
+ "armv7hl-meego-linux-gnueabi",
56
69
"armv6hl-suse-linux-gnueabi",
57
70
"armv7hl-suse-linux-gnueabi"};
58
71
static const char *const ARMebLibDirs[] = {"/lib"};
59
- @@ -2036,7 +2037 ,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
60
- "i586-redhat- linux", "i386-redhat- linux", "i586-suse -linux",
61
- "i486-slackware-linux ", "i686-montavista -linux", "i586-linux-gnu ",
62
- "i686-linux-android ", "i386-gnu ", "i486 -gnu",
63
- - "i586-gnu", "i686-gnu"};
64
- + "i586-gnu", "i686-gnu", "i486-meego-linux" };
72
+ @@ -2108,6 +2109 ,7 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes(
73
+ "i586-linux-gnu ", "i686- linux-gnu ", "i686-pc -linux-gnu ",
74
+ "i386-redhat-linux6E ", "i686-redhat -linux", "i386-redhat-linux ",
75
+ "i586-suse-linux ", "i686-montavista-linux ", "i686 -gnu",
76
+ + "i486-meego-linux"
77
+ };
65
78
66
- static const char *const MIPSLibDirs[] = {"/lib"};
67
- static const char *const MIPSTriples[] = {
79
+ static const char *const M68kLibDirs[] = {"/lib"};
68
80
diff --git a/clang/lib/Driver/ToolChains/Linux.cpp b/clang/lib/Driver/ToolChains/Linux.cpp
69
- index 6532c899492..3fa0bea23bd 100644
81
+ index 83cb41159de7..e7c2dcaef02a 100644
70
82
--- a/clang/lib/Driver/ToolChains/Linux.cpp
71
83
+++ b/clang/lib/Driver/ToolChains/Linux.cpp
72
- @@ -248 ,7 +248 ,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
84
+ @@ -194 ,7 +194 ,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
73
85
}
74
86
75
87
if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsAlpineLinux() ||
@@ -78,7 +90,7 @@ index 6532c899492..3fa0bea23bd 100644
78
90
ExtraOpts.push_back("-z");
79
91
ExtraOpts.push_back("relro");
80
92
}
81
- @@ -289 ,13 +289 ,13 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
93
+ @@ -233 ,13 +233 ,13 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
82
94
// Hexagon linker/loader does not support .gnu.hash
83
95
if (!IsMips && !IsHexagon) {
84
96
if (Distro.IsRedhat() || Distro.IsOpenSUSE() || Distro.IsAlpineLinux() ||
@@ -94,7 +106,7 @@ index 6532c899492..3fa0bea23bd 100644
94
106
(IsAndroid && Triple.isAndroidVersionLT(23)))
95
107
ExtraOpts.push_back("--hash-style=both");
96
108
}
97
- @@ -304 ,7 +304 ,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
109
+ @@ -248 ,7 +248 ,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
98
110
ExtraOpts.push_back("--build-id");
99
111
#endif
100
112
0 commit comments