summaryrefslogtreecommitdiff
path: root/user/clang/0001-Add-support-for-Ad-lie-Linux.patch
blob: 6fdb585427bdcb08562ab252aad82750acdf35c9 (plain) (blame)
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
72
73
74
75
76
77
78
79
80
81
82
From 085ba75b10376fa55bb94cb6fa6c54526957732f Mon Sep 17 00:00:00 2001
From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
Date: Thu, 13 Sep 2018 11:42:28 -0500
Subject: [PATCH] =?UTF-8?q?Add=20support=20for=20Ad=C3=A9lie=20Linux?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 include/clang/Driver/Distro.h   | 5 +++++
 lib/Driver/Distro.cpp           | 3 +++
 lib/Driver/ToolChains/Linux.cpp | 6 ++++--
 3 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/include/clang/Driver/Distro.h b/include/clang/Driver/Distro.h
index 7b34a09256..7a3774a4f1 100644
--- a/include/clang/Driver/Distro.h
+++ b/include/clang/Driver/Distro.h
@@ -26,6 +26,7 @@ public:
     // NB: Releases of a particular Linux distro should be kept together
     // in this enum, because some tests are done by integer comparison against
     // the first and last known member in the family, e.g. IsRedHat().
+    AdelieLinux,
     AlpineLinux,
     ArchLinux,
     DebianLenny,
@@ -120,6 +121,10 @@ public:
     return DistroVal >= UbuntuHardy && DistroVal <= UbuntuDisco;
   }
 
+  bool IsAdelieLinux() const {
+    return DistroVal == AdelieLinux;
+  }
+
   bool IsAlpineLinux() const {
     return DistroVal == AlpineLinux;
   }
diff --git a/lib/Driver/Distro.cpp b/lib/Driver/Distro.cpp
index 2c4d44faf8..7ef35ab379 100644
--- a/lib/Driver/Distro.cpp
+++ b/lib/Driver/Distro.cpp
@@ -132,6 +132,9 @@ static Distro::DistroType DetectDistro(vfs::FileSystem &VFS) {
   if (VFS.exists("/etc/exherbo-release"))
     return Distro::Exherbo;
 
+  if (VFS.exists("/etc/adelie-release"))
+    return Distro::AdelieLinux;
+
   if (VFS.exists("/etc/alpine-release"))
     return Distro::AlpineLinux;
 
-- 
2.18.0

--- cfe-8.0.0.src/lib/Driver/ToolChains/Linux.cpp.old	2018-11-29 18:52:22.000000000 +0000
+++ cfe-8.0.0.src/lib/Driver/ToolChains/Linux.cpp	2019-04-23 23:49:37.786181838 +0000
@@ -236,13 +236,13 @@
 
   Distro Distro(D.getVFS());
 
-  if (Distro.IsAlpineLinux() || Triple.isAndroid()) {
+  if (Distro.IsAdelieLinux() || Distro.IsAlpineLinux() || Triple.isAndroid()) {
     ExtraOpts.push_back("-z");
     ExtraOpts.push_back("now");
   }
 
   if (Distro.IsOpenSUSE() || Distro.IsUbuntu() || Distro.IsAlpineLinux() ||
-      Triple.isAndroid()) {
+      Distro.IsAdelieLinux() || Triple.isAndroid()) {
     ExtraOpts.push_back("-z");
     ExtraOpts.push_back("relro");
   }
@@ -285,7 +285,8 @@
   if (!IsMips && !IsHexagon) {
     if (Distro.IsRedhat() || Distro.IsOpenSUSE() || Distro.IsAlpineLinux() ||
         (Distro.IsUbuntu() && Distro >= Distro::UbuntuMaverick) ||
-        (IsAndroid && !Triple.isAndroidVersionLT(23)))
+        (IsAndroid && !Triple.isAndroidVersionLT(23)) ||
+	Distro.IsAdelieLinux())
       ExtraOpts.push_back("--hash-style=gnu");
 
     if (Distro.IsDebian() || Distro.IsOpenSUSE() ||