summaryrefslogtreecommitdiff
path: root/user/rust/0028-Add-foxkit-target-specs.patch
blob: 5f13c2e3b0f1d4ee356fc4efd55d552d46c27332 (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
From 2a651859050ef1826fd1dd15e2bb272a67c03438 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
Date: Mon, 17 Sep 2018 02:29:06 +0000
Subject: [PATCH 28/29] Add foxkit target specs

---
 src/bootstrap/native.rs                       | 10 ++++++--
 .../spec/aarch64_foxkit_linux_musl.rs         | 21 +++++++++++++++++
 .../spec/armv7_foxkit_linux_musleabihf.rs     | 21 +++++++++++++++++
 .../spec/i586_foxkit_linux_musl.rs            | 23 +++++++++++++++++++
 src/librustc_target/spec/mod.rs               |  7 ++++++
 .../spec/powerpc64_foxkit_linux_musl.rs       | 21 +++++++++++++++++
 .../spec/powerpc_foxkit_linux_musl.rs         | 23 +++++++++++++++++++
 .../spec/x86_64_foxkit_linux_musl.rs          | 21 +++++++++++++++++
 8 files changed, 145 insertions(+), 2 deletions(-)
 create mode 100644 src/librustc_target/spec/aarch64_foxkit_linux_musl.rs
 create mode 100644 src/librustc_target/spec/armv7_foxkit_linux_musleabihf.rs
 create mode 100644 src/librustc_target/spec/i586_foxkit_linux_musl.rs
 create mode 100644 src/librustc_target/spec/powerpc64_foxkit_linux_musl.rs
 create mode 100644 src/librustc_target/spec/powerpc_foxkit_linux_musl.rs
 create mode 100644 src/librustc_target/spec/x86_64_foxkit_linux_musl.rs

diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs
index 186ef75189..9122eeb785 100644
--- a/src/bootstrap/native.rs
+++ b/src/bootstrap/native.rs
@@ -652,6 +652,12 @@ impl Step for Openssl {
             "x86_64-unknown-linux-gnux32" => "linux-x32",
             "x86_64-unknown-linux-musl" => "linux-x86_64",
             "x86_64-unknown-netbsd" => "BSD-x86_64",
+            "aarch64-foxkit-linux-musl" => "linux-aarch64",
+            "armv7-foxkit-linux-musleabihf" => "linux-armv4",
+            "i586-foxkit-linux-musl" => "linux-elf",
+            "powerpc-foxkit-linux-musl" => "linux-ppc",
+            "powerpc64-foxkit-linux-musl" => "linux-ppc64",
+            "x86_64-foxkit-linux-musl" => "linux-x86_64",
             _ => panic!("don't know how to configure OpenSSL for {}", target),
         };
         configure.arg(os);
@@ -666,7 +672,7 @@ impl Step for Openssl {
             configure.arg("-fomit-frame-pointer");
         }
         // OpenSSL ships incompatible ELFv1 ABI assembly code
-        if target == "powerpc64-unknown-linux-musl" {
+        if target == "powerpc64-unknown-linux-musl" || target == "powerpc64-foxkit-linux-musl" {
             configure.arg("no-asm");
         }
         if target == "sparc64-unknown-netbsd" {
@@ -681,7 +687,7 @@ impl Step for Openssl {
         // Make PIE binaries
         // Non-PIE linker support was removed in Lollipop
         // https://source.android.com/security/enhancements/enhancements50
-        if target == "i686-linux-android" {
+        if target == "i686-linux-android" || target == "i586-foxkit-linux-musl" {
             configure.arg("no-asm");
         }
         configure.current_dir(&obj);
diff --git a/src/librustc_target/spec/aarch64_foxkit_linux_musl.rs b/src/librustc_target/spec/aarch64_foxkit_linux_musl.rs
new file mode 100644
index 0000000000..18ad2c2f31
--- /dev/null
+++ b/src/librustc_target/spec/aarch64_foxkit_linux_musl.rs
@@ -0,0 +1,21 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use spec::TargetResult;
+
+pub fn target() -> TargetResult {
+    let mut base = super::aarch64_unknown_linux_musl::target()?;
+
+    base.llvm_target = "aarch64-foxkit-linux-musl".to_string();
+    base.target_vendor = "foxkit".to_string();
+    base.options.crt_static_default = false;
+
+    Ok(base)
+}
diff --git a/src/librustc_target/spec/armv7_foxkit_linux_musleabihf.rs b/src/librustc_target/spec/armv7_foxkit_linux_musleabihf.rs
new file mode 100644
index 0000000000..facfd5d363
--- /dev/null
+++ b/src/librustc_target/spec/armv7_foxkit_linux_musleabihf.rs
@@ -0,0 +1,21 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use spec::TargetResult;
+
+pub fn target() -> TargetResult {
+    let mut base = super::armv7_unknown_linux_musleabihf::target()?;
+
+    base.llvm_target = "armv7-foxkit-linux-musleabihf".to_string();
+    base.target_vendor = "foxkit".to_string();
+    base.options.crt_static_default = false;
+
+    Ok(base)
+}
diff --git a/src/librustc_target/spec/i586_foxkit_linux_musl.rs b/src/librustc_target/spec/i586_foxkit_linux_musl.rs
new file mode 100644
index 0000000000..e0284d96e6
--- /dev/null
+++ b/src/librustc_target/spec/i586_foxkit_linux_musl.rs
@@ -0,0 +1,23 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use spec::{LinkerFlavor, TargetResult};
+
+pub fn target() -> TargetResult {
+    let mut base = super::i586_unknown_linux_musl::target()?;
+
+    base.llvm_target = "i586-foxkit-linux-musl".to_string();
+    base.target_vendor = "foxkit".to_string();
+    base.options.crt_static_default = false;
+    base.options.post_link_args.insert(LinkerFlavor::Gcc,
+        vec!["-Wl,--as-needed".to_string(), "-lssp_nonshared".to_string()]);
+
+    Ok(base)
+}
diff --git a/src/librustc_target/spec/mod.rs b/src/librustc_target/spec/mod.rs
index 94aa07abb6..1187afbb60 100644
--- a/src/librustc_target/spec/mod.rs
+++ b/src/librustc_target/spec/mod.rs
@@ -375,6 +375,13 @@ supported_targets! {
     ("armv7-unknown-cloudabi-eabihf", armv7_unknown_cloudabi_eabihf),
     ("i686-unknown-cloudabi", i686_unknown_cloudabi),
     ("x86_64-unknown-cloudabi", x86_64_unknown_cloudabi),
+
+    ("aarch64-foxkit-linux-musl", aarch64_foxkit_linux_musl),
+    ("armv7-foxkit-linux-musleabihf", armv7_foxkit_linux_musleabihf),
+    ("i586-foxkit-linux-musl", i586_foxkit_linux_musl),
+    ("powerpc-foxkit-linux-musl", powerpc_foxkit_linux_musl),
+    ("powerpc64-foxkit-linux-musl", powerpc64_foxkit_linux_musl),
+    ("x86_64-foxkit-linux-musl", x86_64_foxkit_linux_musl),
 }
 
 /// Everything `rustc` knows about how to compile for a specific target.
diff --git a/src/librustc_target/spec/powerpc64_foxkit_linux_musl.rs b/src/librustc_target/spec/powerpc64_foxkit_linux_musl.rs
new file mode 100644
index 0000000000..b7202ee0fc
--- /dev/null
+++ b/src/librustc_target/spec/powerpc64_foxkit_linux_musl.rs
@@ -0,0 +1,21 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use spec::TargetResult;
+
+pub fn target() -> TargetResult {
+    let mut base = super::powerpc64_unknown_linux_musl::target()?;
+
+    base.llvm_target = "powerpc64-foxkit-linux-musl".to_string();
+    base.target_vendor = "foxkit".to_string();
+    base.options.crt_static_default = false;
+
+    Ok(base)
+}
diff --git a/src/librustc_target/spec/powerpc_foxkit_linux_musl.rs b/src/librustc_target/spec/powerpc_foxkit_linux_musl.rs
new file mode 100644
index 0000000000..34246a7e28
--- /dev/null
+++ b/src/librustc_target/spec/powerpc_foxkit_linux_musl.rs
@@ -0,0 +1,23 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use spec::{LinkerFlavor, TargetResult};
+
+pub fn target() -> TargetResult {
+    let mut base = super::powerpc_unknown_linux_musl::target()?;
+
+    base.llvm_target = "powerpc-foxkit-linux-musl".to_string();
+    base.target_vendor = "foxkit".to_string();
+    base.options.crt_static_default = false;
+    base.options.post_link_args.insert(LinkerFlavor::Gcc,
+        vec!["-Wl,--as-needed".to_string(), "-lssp_nonshared".to_string()]);
+
+    Ok(base)
+}
diff --git a/src/librustc_target/spec/x86_64_foxkit_linux_musl.rs b/src/librustc_target/spec/x86_64_foxkit_linux_musl.rs
new file mode 100644
index 0000000000..801dd8d6f4
--- /dev/null
+++ b/src/librustc_target/spec/x86_64_foxkit_linux_musl.rs
@@ -0,0 +1,21 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use spec::TargetResult;
+
+pub fn target() -> TargetResult {
+    let mut base = super::x86_64_unknown_linux_musl::target()?;
+
+    base.llvm_target = "x86_64-foxkit-linux-musl".to_string();
+    base.target_vendor = "foxkit".to_string();
+    base.options.crt_static_default = false;
+
+    Ok(base)
+}
-- 
2.18.0