@@ -46,12 +46,12 @@ diff --git a/vendor/compiler_builtins/build.rs b/vendor/compiler_builtins/build.
46
46
index 1111111..2222222 100644
47
47
--- a/vendor/compiler_builtins/build.rs
48
48
+++ b/vendor/compiler_builtins/build.rs
49
- @@ -421 ,7 +421 ,7 @@ mod c {
49
+ @@ -502 ,7 +502 ,7 @@ mod c {
50
50
}
51
51
}
52
52
53
- - if target_arch == "arm" && target_vendor != "apple" && target_env != "msvc" {
54
- + if target_arch == "arm" && target_vendor != "apple" && target_os != "windows" {
53
+ - if target.arch == "arm" && target.vendor != "apple" && target.env != "msvc" {
54
+ + if target.arch == "arm" && target.vendor != "apple" && target.os != "windows" {
55
55
sources.extend(&[
56
56
("__aeabi_div0", "arm/aeabi_div0.c"),
57
57
("__aeabi_drsub", "arm/aeabi_drsub.c"),
@@ -247,38 +247,53 @@ index 1111111..2222222 100644
247
247
*self
248
248
249
249
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
250
- From: Kleis Auke Wolthuizen <github@kleisauke.nl >
251
- Date: Mon, 29 Jul 2024 15:00 :00 +0200
252
- Subject: [PATCH 5/5] Ensure compatibility with LLVM 19
250
+ From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= <mati865@gmail.com >
251
+ Date: Sat, 10 Aug 2024 12:21 :00 +0200
252
+ Subject: [PATCH 5/5] Remap Windows targets triples to their LLVM counterparts
253
253
254
- See: https://github.com/rust-lang/cc-rs/issues/1167
254
+ Fixes https://github.com/rust-lang/cc-rs/issues/1167
255
255
256
- Upstream-Status: Pending
256
+ Upstream-Status: Submitted [https://github.com/rust-lang/cc-rs/pull/1176]
257
257
258
258
diff --git a/vendor/cc-1.0.99/src/lib.rs b/vendor/cc-1.0.99/src/lib.rs
259
259
index 1111111..2222222 100644
260
260
--- a/vendor/cc-1.0.99/src/lib.rs
261
261
+++ b/vendor/cc-1.0.99/src/lib.rs
262
- @@ -1889,7 +1889,10 @@ impl Build {
263
- cmd.push_opt_unless_duplicate(format!("-O{}", opt_level).into());
264
- }
265
-
266
- - if cmd.is_like_clang() && target.contains("windows") {
267
- + if cmd.is_like_clang()
268
- + && target.contains("windows")
269
- + && !target.ends_with("-gnullvm")
270
- + {
271
- // Disambiguate mingw and msvc on Windows. Problem is that
272
- // depending on the origin clang can default to a mismatchig
273
- // run-time.
274
- @@ -2129,6 +2132,10 @@ impl Build {
262
+ @@ -2129,6 +2129,17 @@ impl Build {
275
263
}
276
264
277
265
cmd.push_cc_arg(format!("--target={}", target).into());
278
- + } else if target.ends_with("-gnullvm") {
279
- + cmd.push_cc_arg(
280
- + format!("--target={}", target.strip_suffix("llvm").unwrap()).into(),
281
- + );
266
+ + } else if let Ok(index) = target_info::WINDOWS_TRIPLE_MAPPING
267
+ + .binary_search_by_key(&target, |(target, _)| target)
268
+ + {
269
+ + cmd.args.push(
270
+ + format!(
271
+ + "--target={}-{}",
272
+ + target_info::WINDOWS_TRIPLE_MAPPING[index].1,
273
+ + rest
274
+ + )
275
+ + .into(),
276
+ + )
282
277
} else {
283
278
cmd.push_cc_arg(format!("--target={}", target).into());
284
279
}
280
+ diff --git a/vendor/cc-1.0.99/src/target_info.rs b/vendor/cc-1.0.99/src/target_info.rs
281
+ index 1111111..2222222 100644
282
+ --- a/vendor/cc-1.0.99/src/target_info.rs
283
+ +++ b/vendor/cc-1.0.99/src/target_info.rs
284
+ @@ -12,3 +12,15 @@ pub const RISCV_ARCH_MAPPING: &[(&str, &str)] = &[
285
+ ("riscv64gc", "riscv64"),
286
+ ("riscv64imac", "riscv64"),
287
+ ];
288
+ + pub const WINDOWS_TRIPLE_MAPPING: &[(&str, &str)] = &[
289
+ + ("aarch64-pc-windows-gnullvm", "aarch64-pc-windows-gnu"),
290
+ + ("aarch64-uwp-windows-msvc", "aarch64-pc-windows-msvc"),
291
+ + ("i686-pc-windows-gnullvm", "i686-pc-windows-gnu"),
292
+ + ("i686-uwp-windows-gnu", "i686-pc-windows-gnu"),
293
+ + ("i686-uwp-windows-msvc", "i686-pc-windows-msvc"),
294
+ + ("i686-win7-windows-msvc", "i686-pc-windows-msvc"),
295
+ + ("thumbv7a-uwp-windows-msvc", "thumbv7a-pc-windows-msvc"),
296
+ + ("x86_64-pc-windows-gnullvm", "x86_64-pc-windows-gnu"),
297
+ + ("x86_64-uwp-windows-gnu", "x86_64-pc-windows-gnu"),
298
+ + ("x86_64-uwp-windows-msvc", "x86_64-pc-windows-msvc"),
299
+ + ];
0 commit comments