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
|
From: Shiz <hi@shiz.me>
Updated by Rasmus Thomsen <oss@cogitri.dev> on 28th of July 2019
Updated again by Ariadne Conill <ariadne@dereferenced.org> on 31 October 2020
Date: Thu, 20 Aug 2017 01:52:36 +0200
Last-Updated: Sat, 28 Oct 2017 20:23:00 +0200
Subject: [PATCH] Add Alpine targets
This adds `$arch-alpine-linux-musl` targets to Rust to encode our toolchain
and distribution-specific quirks instead of polluting the main musl target of
`$arch-unknown-linux-musl`.
--- /dev/null
+++ rustc-1.48.0-src/compiler/rustc_target/src/spec/aarch64_alpine_linux_musl.rs
@@ -0,0 +1,13 @@
+use crate::spec::Target;
+
+pub fn target() -> Target {
+ let mut base = super::aarch64_unknown_linux_musl::target();
+
+ base.llvm_target = "aarch64-alpine-linux-musl".to_string();
+ base.options.vendor = "alpine".to_string();
+ base.options.crt_static_default = false;
+ base.options.static_position_independent_executables = true;
+ base.options.need_rpath = true;
+
+ base
+}
--- /dev/null
+++ rustc-1.48.0-src/compiler/rustc_target/src/spec/armv6_alpine_linux_musleabihf.rs
@@ -0,0 +1,13 @@
+use crate::spec::Target;
+
+pub fn target() -> Target {
+ let mut base = super::arm_unknown_linux_musleabihf::target();
+
+ base.llvm_target = "armv6-alpine-linux-musleabihf".to_string();
+ base.options.vendor = "alpine".to_string();
+ base.options.crt_static_default = false;
+ base.options.static_position_independent_executables = true;
+ base.options.need_rpath = true;
+
+ base
+}
--- /dev/null
+++ rustc-1.48.0-src/compiler/rustc_target/src/spec/armv7_alpine_linux_musleabihf.rs
@@ -0,0 +1,13 @@
+use crate::spec::Target;
+
+pub fn target() -> Target {
+ let mut base = super::armv7_unknown_linux_musleabihf::target();
+
+ base.llvm_target = "armv7-alpine-linux-musleabihf".to_string();
+ base.options.vendor = "alpine".to_string();
+ base.options.crt_static_default = false;
+ base.options.static_position_independent_executables = true;
+ base.options.need_rpath = true;
+
+ base
+}
--- /dev/null
+++ rustc-1.48.0-src/compiler/rustc_target/src/spec/i586_alpine_linux_musl.rs
@@ -0,0 +1,14 @@
+use crate::spec::Target;
+
+pub fn target() -> Target {
+ let mut base = super::i686_unknown_linux_musl::target();
+
+ base.options.cpu = "pentium4".to_string();
+ base.llvm_target = "i586-alpine-linux-musl".to_string();
+ base.options.vendor = "alpine".to_string();
+ base.options.crt_static_default = false;
+ base.options.static_position_independent_executables = true;
+ base.options.need_rpath = true;
+
+ base
+}
--- rustc-1.48.0-src.orig/compiler/rustc_target/src/spec/mod.rs
+++ rustc-1.48.0-src/compiler/rustc_target/src/spec/mod.rs
@@ -490,6 +490,16 @@
}
supported_targets! {
+ ("i586-alpine-linux-musl", i586_alpine_linux_musl),
+ ("x86_64-alpine-linux-musl", x86_64_alpine_linux_musl),
+ ("aarch64-alpine-linux-musl", aarch64_alpine_linux_musl),
+ ("armv6-alpine-linux-musleabihf", armv6_alpine_linux_musleabihf),
+ ("armv7-alpine-linux-musleabihf", armv7_alpine_linux_musleabihf),
+ ("powerpc-alpine-linux-musl", powerpc_alpine_linux_musl),
+ ("powerpc64-alpine-linux-musl", powerpc64_alpine_linux_musl),
+ ("powerpc64le-alpine-linux-musl", powerpc64le_alpine_linux_musl),
+ ("s390x-alpine-linux-musl", s390x_alpine_linux_musl),
+ ("riscv64-alpine-linux-musl", riscv64_alpine_linux_musl),
("x86_64-unknown-linux-gnu", x86_64_unknown_linux_gnu),
("x86_64-unknown-linux-gnux32", x86_64_unknown_linux_gnux32),
("i686-unknown-linux-gnu", i686_unknown_linux_gnu),
--- /dev/null
+++ rustc-1.48.0-src/compiler/rustc_target/src/spec/powerpc64_alpine_linux_musl.rs
@@ -0,0 +1,13 @@
+use crate::spec::Target;
+
+pub fn target() -> Target {
+ let mut base = super::powerpc64_unknown_linux_musl::target();
+
+ base.llvm_target = "powerpc64-alpine-linux-musl".to_string();
+ base.options.vendor = "alpine".to_string();
+ base.options.crt_static_default = false;
+ base.options.static_position_independent_executables = true;
+ base.options.need_rpath = true;
+
+ base
+}
--- /dev/null
+++ rustc-1.48.0-src/compiler/rustc_target/src/spec/powerpc64le_alpine_linux_musl.rs
@@ -0,0 +1,13 @@
+use crate::spec::Target;
+
+pub fn target() -> Target {
+ let mut base = super::powerpc64le_unknown_linux_musl::target();
+
+ base.llvm_target = "powerpc64le-alpine-linux-musl".to_string();
+ base.options.vendor = "alpine".to_string();
+ base.options.crt_static_default = false;
+ base.options.static_position_independent_executables = true;
+ base.options.need_rpath = true;
+
+ base
+}
--- /dev/null
+++ rustc-1.48.0-src/compiler/rustc_target/src/spec/powerpc_alpine_linux_musl.rs
@@ -0,0 +1,13 @@
+use crate::spec::Target;
+
+pub fn target() -> Target {
+ let mut base = super::powerpc_unknown_linux_musl::target();
+
+ base.llvm_target = "powerpc-alpine-linux-musl".to_string();
+ base.options.vendor = "alpine".to_string();
+ base.options.crt_static_default = false;
+ base.options.static_position_independent_executables = true;
+ base.options.need_rpath = true;
+
+ base
+}
--- /dev/null
+++ rustc-1.48.0-src/compiler/rustc_target/src/spec/s390x_alpine_linux_musl.rs
@@ -0,0 +1,13 @@
+use crate::spec::Target;
+
+pub fn target() -> Target {
+ let mut base = super::s390x_unknown_linux_musl::target();
+
+ base.llvm_target = "s390x-alpine-linux-musl".to_string();
+ base.options.vendor = "alpine".to_string();
+ base.options.crt_static_default = false;
+ base.options.static_position_independent_executables = true;
+ base.options.need_rpath = true;
+
+ base
+}
--- /dev/null
+++ rustc-1.48.0-src/compiler/rustc_target/src/spec/x86_64_alpine_linux_musl.rs
@@ -0,0 +1,13 @@
+use crate::spec::Target;
+
+pub fn target() -> Target {
+ let mut base = super::x86_64_unknown_linux_musl::target();
+
+ base.llvm_target = "x86_64-alpine-linux-musl".to_string();
+ base.options.vendor = "alpine".to_string();
+ base.options.crt_static_default = false;
+ base.options.static_position_independent_executables = true;
+ base.options.need_rpath = true;
+
+ base
+}
--- /dev/null
+++ rustc-1.52.1-src/compiler/rustc_target/src/spec/riscv64_alpine_linux_musl.rs
@@ -0,0 +1,13 @@
+use crate::spec::Target;
+
+pub fn target() -> Target {
+ let mut base = super::riscv64gc_unknown_linux_musl::target();
+
+ base.llvm_target = "riscv64-alpine-linux-musl".to_string();
+ base.options.vendor = "alpine".to_string();
+ base.options.crt_static_default = false;
+ base.options.static_position_independent_executables = true;
+ base.options.need_rpath = true;
+
+ base
+}
|