-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathlibrsvg-llvm-mingw.patch
297 lines (264 loc) · 11.6 KB
/
librsvg-llvm-mingw.patch
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
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Kleis Auke Wolthuizen <github@kleisauke.nl>
Date: Wed, 5 May 2021 21:00:00 +0200
Subject: [PATCH 1/4] Add llvm-mingw i686/ARMv7 targets
Upstream-Status: Inappropriate [enable feature]
Upstream only accepts Rust targets that are available in stable releases.
diff --git a/vendor/cfg-expr/src/targets/builtins.rs b/vendor/cfg-expr/src/targets/builtins.rs
index 1111111..2222222 100644
--- a/vendor/cfg-expr/src/targets/builtins.rs
+++ b/vendor/cfg-expr/src/targets/builtins.rs
@@ -541,6 +553,18 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[
has_atomics: HasAtomics::atomic_8_16_32_64_ptr,
panic: Panic::unwind,
},
+ TargetInfo {
+ triple: Triple::new_const("armv7-pc-windows-gnullvm"),
+ os: Some(Os::windows),
+ arch: Arch::arm,
+ env: Some(Env::gnu),
+ vendor: Some(Vendor::pc),
+ families: Families::windows,
+ pointer_width: 32,
+ endian: Endian::little,
+ has_atomics: HasAtomics::atomic_8_16_32_64_ptr,
+ panic: Panic::unwind,
+ },
TargetInfo {
triple: Triple::new_const("armv7-unknown-freebsd"),
os: Some(Os::freebsd),
@@ -889,6 +913,18 @@ pub const ALL_BUILTINS: &[TargetInfo] = &[
has_atomics: HasAtomics::atomic_8_16_32_64_ptr,
panic: Panic::unwind,
},
+ TargetInfo {
+ triple: Triple::new_const("i686-pc-windows-gnullvm"),
+ os: Some(Os::windows),
+ arch: Arch::x86,
+ env: Some(Env::gnu),
+ vendor: Some(Vendor::pc),
+ families: Families::windows,
+ pointer_width: 32,
+ endian: Endian::little,
+ has_atomics: HasAtomics::atomic_8_16_32_64_ptr,
+ panic: Panic::unwind,
+ },
TargetInfo {
triple: Triple::new_const("i686-pc-windows-msvc"),
os: Some(Os::windows),
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Kleis Auke Wolthuizen <github@kleisauke.nl>
Date: Mon, 21 Sep 2020 11:00:00 +0200
Subject: [PATCH 2/4] Fix linker error on llvm-mingw (targeting ARMv7)
Details:
lld-link: error: undefined symbol: __aeabi_idiv
>>> referenced by libcompiler_builtins-<HASH>.rlib(<O_FILE>):(__aeabi_idivmod)
Upstream-Status: Pending
diff --git a/vendor/compiler_builtins/build.rs b/vendor/compiler_builtins/build.rs
index 1111111..2222222 100644
--- a/vendor/compiler_builtins/build.rs
+++ b/vendor/compiler_builtins/build.rs
@@ -331,7 +331,7 @@ mod c {
if target_arch == "arm"
&& target_os != "ios"
&& target_os != "watchos"
- && target_env != "msvc"
+ && target_os != "windows"
{
sources.extend(&[
("__aeabi_div0", "arm/aeabi_div0.c"),
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Kleis Auke Wolthuizen <github@kleisauke.nl>
Date: Tue, 15 Feb 2022 11:38:18 +0100
Subject: [PATCH 3/4] Use appropriate fix/float aliases on llvm-mingw
See: https://github.com/llvm/llvm-project/commit/e6407356ba008e474322d52b7d031f65fa4913fc
Details:
ld.lld: error: duplicate symbol: __floatdisf
>>> defined at libclang_rt.builtins-arm.a(floatdisf.c.obj)
>>> defined at libcompiler_builtins-<HASH>.rlib(<O_FILE>)
ld.lld: error: duplicate symbol: __floatdidf
>>> defined at libclang_rt.builtins-arm.a(floatdidf.c.obj)
>>> defined at libcompiler_builtins-<HASH>.rlib(<O_FILE>)
ld.lld: error: duplicate symbol: __floatundisf
>>> defined at libclang_rt.builtins-arm.a(floatundisf.c.obj)
>>> defined at libcompiler_builtins-<HASH>.rlib(<O_FILE>)
ld.lld: error: duplicate symbol: __floatundidf
>>> defined at libclang_rt.builtins-arm.a(floatundidf.c.obj)
>>> defined at libcompiler_builtins-<HASH>.rlib(<O_FILE>)
ld.lld: error: duplicate symbol: __fixsfdi
>>> defined at libclang_rt.builtins-arm.a(fixsfdi.c.obj)
>>> defined at libcompiler_builtins-<HASH>.rlib(<O_FILE>)
ld.lld: error: duplicate symbol: __fixdfdi
>>> defined at libclang_rt.builtins-arm.a(fixdfdi.c.obj)
>>> defined at libcompiler_builtins-<HASH>.rlib(<O_FILE>)
ld.lld: error: duplicate symbol: __fixunssfdi
>>> defined at libclang_rt.builtins-arm.a(fixunssfdi.c.obj)
>>> defined at libcompiler_builtins-<HASH>.rlib(<O_FILE>)
ld.lld: error: duplicate symbol: __fixunsdfdi
>>> defined at libclang_rt.builtins-arm.a(fixunsdfdi.c.obj)
>>> defined at libcompiler_builtins-<HASH>.rlib(<O_FILE>)
Upstream-Status: Inappropriate [Windows specific]
This is Windows specific and would break compatibility with other Rust ARMv7 targets.
diff --git a/vendor/compiler_builtins/src/float/conv.rs b/vendor/compiler_builtins/src/float/conv.rs
index 1111111..2222222 100644
--- a/vendor/compiler_builtins/src/float/conv.rs
+++ b/vendor/compiler_builtins/src/float/conv.rs
@@ -82,12 +82,12 @@ intrinsics! {
f64::from_bits(int_to_float::u32_to_f64_bits(i))
}
- #[arm_aeabi_alias = __aeabi_ul2f]
+ #[arm_aeabi_alias = __u64tos]
pub extern "C" fn __floatundisf(i: u64) -> f32 {
f32::from_bits(int_to_float::u64_to_f32_bits(i))
}
- #[arm_aeabi_alias = __aeabi_ul2d]
+ #[arm_aeabi_alias = __u64tod]
pub extern "C" fn __floatundidf(i: u64) -> f64 {
f64::from_bits(int_to_float::u64_to_f64_bits(i))
}
@@ -117,13 +117,13 @@ intrinsics! {
f64::from_bits(int_to_float::u32_to_f64_bits(i.unsigned_abs()) | sign_bit)
}
- #[arm_aeabi_alias = __aeabi_l2f]
+ #[arm_aeabi_alias = __i64tos]
pub extern "C" fn __floatdisf(i: i64) -> f32 {
let sign_bit = ((i >> 63) as u32) << 31;
f32::from_bits(int_to_float::u64_to_f32_bits(i.unsigned_abs()) | sign_bit)
}
- #[arm_aeabi_alias = __aeabi_l2d]
+ #[arm_aeabi_alias = __i64tod]
pub extern "C" fn __floatdidf(i: i64) -> f64 {
let sign_bit = ((i >> 63) as u64) << 63;
f64::from_bits(int_to_float::u64_to_f64_bits(i.unsigned_abs()) | sign_bit)
@@ -160,7 +160,7 @@ intrinsics! {
}
}
- #[arm_aeabi_alias = __aeabi_f2ulz]
+ #[arm_aeabi_alias = __stou64]
pub extern "C" fn __fixunssfdi(f: f32) -> u64 {
let fbits = f.to_bits();
if fbits < 127 << 23 { // >= 0, < 1
@@ -208,7 +208,7 @@ intrinsics! {
}
}
- #[arm_aeabi_alias = __aeabi_d2ulz]
+ #[arm_aeabi_alias = __dtou64]
pub extern "C" fn __fixunsdfdi(f: f64) -> u64 {
let fbits = f.to_bits();
if fbits < 1023 << 52 { // >= 0, < 1
@@ -260,7 +260,7 @@ intrinsics! {
}
}
- #[arm_aeabi_alias = __aeabi_f2lz]
+ #[arm_aeabi_alias = __stoi64]
pub extern "C" fn __fixsfdi(f: f32) -> i64 {
let fbits = f.to_bits() & !0 >> 1; // Remove sign bit.
if fbits < 127 << 23 { // >= 0, < 1
@@ -311,7 +311,7 @@ intrinsics! {
}
}
- #[arm_aeabi_alias = __aeabi_d2lz]
+ #[arm_aeabi_alias = __dtoi64]
pub extern "C" fn __fixdfdi(f: f64) -> i64 {
let fbits = f.to_bits() & !0 >> 1; // Remove sign bit.
if fbits < 1023 << 52 { // >= 0, < 1
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Kleis Auke Wolthuizen <github@kleisauke.nl>
Date: Sat, 30 Apr 2022 16:05:00 +0200
Subject: [PATCH 4/4] Fix build errors on llvm-mingw (targeting ARMv7)
Details:
error[E0412]: cannot find type `WSADATA` in this scope
--> vendor/windows-sys/src/Windows/Win32/Networking/WinSock/mod.rs:347:63
|
347 | pub fn WSAStartup(wversionrequested: u16, lpwsadata: *mut WSADATA) -> i32;
| ^^^^^^^ help: a struct with a similar name exists: `WSPDATA`
...
8679 | pub struct WSPDATA {
| ------------------ similarly named struct `WSPDATA` defined here
error[E0412]: cannot find type `SERVENT` in this scope
--> vendor/windows-sys/src/Windows/Win32/Networking/WinSock/mod.rs:481:103
|
481 | pub fn getservbyname(name: ::windows_sys::core::PCSTR, proto: ::windows_sys::core::PCSTR) -> *mut SERVENT;
| ^^^^^^^ not found in this scope
error[E0412]: cannot find type `SERVENT` in this scope
--> vendor/windows-sys/src/Windows/Win32/Networking/WinSock/mod.rs:483:80
|
483 | pub fn getservbyport(port: i32, proto: ::windows_sys::core::PCSTR) -> *mut SERVENT;
| ^^^^^^^ not found in this scope
error[E0412]: cannot find type `DELAYLOAD_INFO` in this scope
--> vendor/windows-sys/src/Windows/Win32/System/WindowsProgramming/mod.rs:3241:140
|
3241 | ..._CALLBACK = ::core::option::Option<unsafe extern "system" fn(notificationreason: u32, delayloadinfo: *const DELAYLOAD_INFO) -> *mut ::...
| - help: you might be missing a type parameter: `<DELAYLOAD_INFO>` ^^^^^^^^^^^^^^ not found in this scope
Upstream-Status: Pending
diff --git a/vendor/windows-sys/src/Windows/Win32/Networking/WinSock/mod.rs b/vendor/windows-sys/src/Windows/Win32/Networking/WinSock/mod.rs
index 1111111..2222222 100644
--- a/vendor/windows-sys/src/Windows/Win32/Networking/WinSock/mod.rs
+++ b/vendor/windows-sys/src/Windows/Win32/Networking/WinSock/mod.rs
@@ -6687,16 +6687,16 @@ impl ::core::clone::Clone for SERVENT {
}
#[repr(C)]
#[doc = "*Required features: `\"Win32_Networking_WinSock\"`*"]
-#[cfg(target_arch = "x86")]
+#[cfg(any(target_arch = "arm", target_arch = "x86"))]
pub struct SERVENT {
pub s_name: ::windows_sys::core::PSTR,
pub s_aliases: *mut *mut i8,
pub s_port: i16,
pub s_proto: ::windows_sys::core::PSTR,
}
-#[cfg(target_arch = "x86")]
+#[cfg(any(target_arch = "arm", target_arch = "x86"))]
impl ::core::marker::Copy for SERVENT {}
-#[cfg(target_arch = "x86")]
+#[cfg(any(target_arch = "arm", target_arch = "x86"))]
impl ::core::clone::Clone for SERVENT {
fn clone(&self) -> Self {
*self
@@ -8009,7 +8009,7 @@ impl ::core::clone::Clone for WSADATA {
}
#[repr(C)]
#[doc = "*Required features: `\"Win32_Networking_WinSock\"`, `\"Win32_Foundation\"`*"]
-#[cfg(target_arch = "x86")]
+#[cfg(any(target_arch = "arm", target_arch = "x86"))]
#[cfg(feature = "Win32_Foundation")]
pub struct WSADATA {
pub wVersion: u16,
@@ -8020,10 +8020,10 @@ pub struct WSADATA {
pub iMaxUdpDg: u16,
pub lpVendorInfo: ::windows_sys::core::PSTR,
}
-#[cfg(target_arch = "x86")]
+#[cfg(any(target_arch = "arm", target_arch = "x86"))]
#[cfg(feature = "Win32_Foundation")]
impl ::core::marker::Copy for WSADATA {}
-#[cfg(target_arch = "x86")]
+#[cfg(any(target_arch = "arm", target_arch = "x86"))]
#[cfg(feature = "Win32_Foundation")]
impl ::core::clone::Clone for WSADATA {
fn clone(&self) -> Self {
diff --git a/vendor/windows-sys/src/Windows/Win32/System/WindowsProgramming/mod.rs b/vendor/windows-sys/src/Windows/Win32/System/WindowsProgramming/mod.rs
index 1111111..2222222 100644
--- a/vendor/windows-sys/src/Windows/Win32/System/WindowsProgramming/mod.rs
+++ b/vendor/windows-sys/src/Windows/Win32/System/WindowsProgramming/mod.rs
@@ -2179,7 +2179,7 @@ impl ::core::clone::Clone for DELAYLOAD_INFO {
}
#[repr(C)]
#[doc = "*Required features: `\"Win32_System_WindowsProgramming\"`*"]
-#[cfg(target_arch = "x86")]
+#[cfg(any(target_arch = "arm", target_arch = "x86"))]
pub struct DELAYLOAD_INFO {
pub Size: u32,
pub DelayloadDescriptor: *mut IMAGE_DELAYLOAD_DESCRIPTOR,
@@ -2190,9 +2190,9 @@ pub struct DELAYLOAD_INFO {
pub Unused: *mut ::core::ffi::c_void,
pub LastError: u32,
}
-#[cfg(target_arch = "x86")]
+#[cfg(any(target_arch = "arm", target_arch = "x86"))]
impl ::core::marker::Copy for DELAYLOAD_INFO {}
-#[cfg(target_arch = "x86")]
+#[cfg(any(target_arch = "arm", target_arch = "x86"))]
impl ::core::clone::Clone for DELAYLOAD_INFO {
fn clone(&self) -> Self {
*self