aboutsummaryrefslogtreecommitdiffstats
path: root/main/llvm/llvm-0002-musl-triple.patch
blob: aba274a7b7448d0becec2479b06629ee41eda98b (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
72
73
74
75
76
77
diff --git a/include/llvm/ADT/Triple.h b/include/llvm/ADT/Triple.h
index 8a68599..072623c 100644
--- a/include/llvm/ADT/Triple.h
+++ b/include/llvm/ADT/Triple.h
@@ -154,6 +154,10 @@ public:
     EABIHF,
     Android,

+    Musl,
+    MuslEABI,
+    MuslEABIHF,
+
     MSVC,
     Itanium,
     Cygnus,
diff --git a/lib/Support/Triple.cpp b/lib/Support/Triple.cpp
index 0838e90..4be78e5 100644
--- a/lib/Support/Triple.cpp
+++ b/lib/Support/Triple.cpp
@@ -175,6 +175,9 @@ const char *Triple::getEnvironmentTypeName(EnvironmentType Kind) {
   case CODE16: return "code16";
   case EABI: return "eabi";
   case EABIHF: return "eabihf";
+  case Musl: return "musl";
+  case MuslEABIHF: return "muslgnueabihf";
+  case MuslEABI: return "muslgnueabi";
   case Android: return "android";
   case MSVC: return "msvc";
   case Itanium: return "itanium";
@@ -375,6 +378,9 @@ static Triple::EnvironmentType parseEnvironment(StringRef EnvironmentName) {
     .StartsWith("code16", Triple::CODE16)
     .StartsWith("gnu", Triple::GNU)
     .StartsWith("android", Triple::Android)
+    .StartsWith("muslgnueabihf", Triple::MuslEABIHF)
+    .StartsWith("muslgnueabi", Triple::MuslEABI)
+    .StartsWith("musl", Triple::Musl)
     .StartsWith("msvc", Triple::MSVC)
     .StartsWith("itanium", Triple::Itanium)
     .StartsWith("cygnus", Triple::Cygnus)
diff --git a/lib/Target/ARM/ARMSubtarget.h b/lib/Target/ARM/ARMSubtarget.h
index dbacd4d..b330be5 100644
--- a/lib/Target/ARM/ARMSubtarget.h
+++ b/lib/Target/ARM/ARMSubtarget.h
@@ -369,8 +369,10 @@ public:
   bool isTargetEHABICompatible() const {
     return (TargetTriple.getEnvironment() == Triple::EABI ||
             TargetTriple.getEnvironment() == Triple::GNUEABI ||
+            TargetTriple.getEnvironment() == Triple::MuslEABI ||
             TargetTriple.getEnvironment() == Triple::EABIHF ||
             TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
+            TargetTriple.getEnvironment() == Triple::MuslEABIHF ||
             TargetTriple.getEnvironment() == Triple::Android) &&
            !isTargetDarwin() && !isTargetWindows();
   }
@@ -379,6 +381,7 @@ public:
     // FIXME: this is invalid for WindowsCE
     return TargetTriple.getEnvironment() == Triple::GNUEABIHF ||
            TargetTriple.getEnvironment() == Triple::EABIHF ||
+           TargetTriple.getEnvironment() == Triple::MuslEABIHF ||
            isTargetWindows();
   }
   bool isTargetAndroid() const {
diff --git a/lib/Target/ARM/ARMTargetMachine.cpp b/lib/Target/ARM/ARMTargetMachine.cpp
index 7a8181b..ce5ceb9 100644
--- a/lib/Target/ARM/ARMTargetMachine.cpp
+++ b/lib/Target/ARM/ARMTargetMachine.cpp
@@ -87,6 +87,8 @@ computeTargetABI(const Triple &TT, StringRef CPU,
     case llvm::Triple::GNUEABIHF:
     case llvm::Triple::EABIHF:
     case llvm::Triple::EABI:
+    case llvm::Triple::MuslEABI:
+    case llvm::Triple::MuslEABIHF:
       TargetABI = ARMBaseTargetMachine::ARM_ABI_AAPCS;
       break;
     case llvm::Triple::GNU:
--
2.1.4