Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit c94848c

Browse files
committedDec 5, 2024·
Auto merge of rust-lang#133905 - jhpratt:rollup-iho8sl1, r=jhpratt
Rollup of 6 pull requests Successful merges: - rust-lang#127565 (Teach rustc about the Xtensa VaListImpl) - rust-lang#133844 (clarify simd_relaxed_fma non-determinism) - rust-lang#133867 (Fix "std" support status of some tier 3 targets) - rust-lang#133882 (Improve comments for the default backtrace printer) - rust-lang#133888 (Improve bootstrap job objects) - rust-lang#133898 (skip `setup::Hook` on non-git sources) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 0e98766 + 6b58941 commit c94848c

31 files changed

+199
-78
lines changed
 

‎compiler/rustc_codegen_llvm/src/va_arg.rs‎

Lines changed: 111 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,23 @@ use crate::type_::Type;
1010
use crate::type_of::LayoutLlvmExt;
1111
use crate::value::Value;
1212

13+
fn round_up_to_alignment<'ll>(
14+
bx: &mut Builder<'_, 'll, '_>,
15+
mut value: &'ll Value,
16+
align: Align,
17+
) -> &'ll Value {
18+
value = bx.add(value, bx.cx().const_i32(align.bytes() as i32 - 1));
19+
return bx.and(value, bx.cx().const_i32(-(align.bytes() as i32)));
20+
}
21+
1322
fn round_pointer_up_to_alignment<'ll>(
1423
bx: &mut Builder<'_, 'll, '_>,
1524
addr: &'ll Value,
1625
align: Align,
1726
ptr_ty: &'ll Type,
1827
) -> &'ll Value {
1928
let mut ptr_as_int = bx.ptrtoint(addr, bx.cx().type_isize());
20-
ptr_as_int = bx.add(ptr_as_int, bx.cx().const_i32(align.bytes() as i32 - 1));
21-
ptr_as_int = bx.and(ptr_as_int, bx.cx().const_i32(-(align.bytes() as i32)));
29+
ptr_as_int = round_up_to_alignment(bx, ptr_as_int, align);
2230
bx.inttoptr(ptr_as_int, ptr_ty)
2331
}
2432

@@ -270,6 +278,106 @@ fn emit_s390x_va_arg<'ll, 'tcx>(
270278
bx.load(val_type, val_addr, layout.align.abi)
271279
}
272280

281+
fn emit_xtensa_va_arg<'ll, 'tcx>(
282+
bx: &mut Builder<'_, 'll, 'tcx>,
283+
list: OperandRef<'tcx, &'ll Value>,
284+
target_ty: Ty<'tcx>,
285+
) -> &'ll Value {
286+
// Implementation of va_arg for Xtensa. There doesn't seem to be an authoritative source for
287+
// this, other than "what GCC does".
288+
//
289+
// The va_list type has three fields:
290+
// struct __va_list_tag {
291+
// int32_t *va_stk; // Arguments passed on the stack
292+
// int32_t *va_reg; // Arguments passed in registers, saved to memory by the prologue.
293+
// int32_t va_ndx; // Offset into the arguments, in bytes
294+
// };
295+
//
296+
// The first 24 bytes (equivalent to 6 registers) come from va_reg, the rest from va_stk.
297+
// Thus if va_ndx is less than 24, the next va_arg *may* read from va_reg,
298+
// otherwise it must come from va_stk.
299+
//
300+
// Primitive arguments are never split between registers and the stack. For example, if loading an 8 byte
301+
// primitive value and va_ndx = 20, we instead bump the offset and read everything from va_stk.
302+
let va_list_addr = list.immediate();
303+
// FIXME: handle multi-field structs that split across regsave/stack?
304+
let layout = bx.cx.layout_of(target_ty);
305+
let from_stack = bx.append_sibling_block("va_arg.from_stack");
306+
let from_regsave = bx.append_sibling_block("va_arg.from_regsave");
307+
let end = bx.append_sibling_block("va_arg.end");
308+
309+
// (*va).va_ndx
310+
let va_reg_offset = 4;
311+
let va_ndx_offset = va_reg_offset + 4;
312+
let offset_ptr =
313+
bx.inbounds_gep(bx.type_i8(), va_list_addr, &[bx.cx.const_usize(va_ndx_offset)]);
314+
315+
let offset = bx.load(bx.type_i32(), offset_ptr, bx.tcx().data_layout.i32_align.abi);
316+
let offset = round_up_to_alignment(bx, offset, layout.align.abi);
317+
318+
let slot_size = layout.size.align_to(Align::from_bytes(4).unwrap()).bytes() as i32;
319+
320+
// Update the offset in va_list, by adding the slot's size.
321+
let offset_next = bx.add(offset, bx.const_i32(slot_size));
322+
323+
// Figure out where to look for our value. We do that by checking the end of our slot (offset_next).
324+
// If that is within the regsave area, then load from there. Otherwise load from the stack area.
325+
let regsave_size = bx.const_i32(24);
326+
let use_regsave = bx.icmp(IntPredicate::IntULE, offset_next, regsave_size);
327+
bx.cond_br(use_regsave, from_regsave, from_stack);
328+
329+
bx.switch_to_block(from_regsave);
330+
// update va_ndx
331+
bx.store(offset_next, offset_ptr, bx.tcx().data_layout.pointer_align.abi);
332+
333+
// (*va).va_reg
334+
let regsave_area_ptr =
335+
bx.inbounds_gep(bx.type_i8(), va_list_addr, &[bx.cx.const_usize(va_reg_offset)]);
336+
let regsave_area =
337+
bx.load(bx.type_ptr(), regsave_area_ptr, bx.tcx().data_layout.pointer_align.abi);
338+
let regsave_value_ptr = bx.inbounds_gep(bx.type_i8(), regsave_area, &[offset]);
339+
bx.br(end);
340+
341+
bx.switch_to_block(from_stack);
342+
343+
// The first time we switch from regsave to stack we needs to adjust our offsets a bit.
344+
// va_stk is set up such that the first stack argument is always at va_stk + 32.
345+
// The corrected offset is written back into the va_list struct.
346+
347+
// let offset_corrected = cmp::max(offset, 32);
348+
let stack_offset_start = bx.const_i32(32);
349+
let needs_correction = bx.icmp(IntPredicate::IntULE, offset, stack_offset_start);
350+
let offset_corrected = bx.select(needs_correction, stack_offset_start, offset);
351+
352+
// let offset_next_corrected = offset_corrected + slot_size;
353+
// va_ndx = offset_next_corrected;
354+
let offset_next_corrected = bx.add(offset_next, bx.const_i32(slot_size));
355+
// update va_ndx
356+
bx.store(offset_next_corrected, offset_ptr, bx.tcx().data_layout.pointer_align.abi);
357+
358+
// let stack_value_ptr = unsafe { (*va).va_stk.byte_add(offset_corrected) };
359+
let stack_area_ptr = bx.inbounds_gep(bx.type_i8(), va_list_addr, &[bx.cx.const_usize(0)]);
360+
let stack_area = bx.load(bx.type_ptr(), stack_area_ptr, bx.tcx().data_layout.pointer_align.abi);
361+
let stack_value_ptr = bx.inbounds_gep(bx.type_i8(), stack_area, &[offset_corrected]);
362+
bx.br(end);
363+
364+
bx.switch_to_block(end);
365+
366+
// On big-endian, for values smaller than the slot size we'd have to align the read to the end
367+
// of the slot rather than the start. While the ISA and GCC support big-endian, all the Xtensa
368+
// targets supported by rustc are litte-endian so don't worry about it.
369+
370+
// if from_regsave {
371+
// unsafe { *regsave_value_ptr }
372+
// } else {
373+
// unsafe { *stack_value_ptr }
374+
// }
375+
assert!(bx.tcx().sess.target.endian == Endian::Little);
376+
let value_ptr =
377+
bx.phi(bx.type_ptr(), &[regsave_value_ptr, stack_value_ptr], &[from_regsave, from_stack]);
378+
return bx.load(layout.llvm_type(bx), value_ptr, layout.align.abi);
379+
}
380+
273381
pub(super) fn emit_va_arg<'ll, 'tcx>(
274382
bx: &mut Builder<'_, 'll, 'tcx>,
275383
addr: OperandRef<'tcx, &'ll Value>,
@@ -302,6 +410,7 @@ pub(super) fn emit_va_arg<'ll, 'tcx>(
302410
let indirect: bool = target_ty_size > 8 || !target_ty_size.is_power_of_two();
303411
emit_ptr_va_arg(bx, addr, target_ty, indirect, Align::from_bytes(8).unwrap(), false)
304412
}
413+
"xtensa" => emit_xtensa_va_arg(bx, addr, target_ty),
305414
// For all other architecture/OS combinations fall back to using
306415
// the LLVM va_arg instruction.
307416
// https://llvm.org/docs/LangRef.html#va-arg-instruction

‎compiler/rustc_target/src/spec/targets/armv4t_unknown_linux_gnueabi.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub(crate) fn target() -> Target {
77
description: Some("Armv4T Linux".into()),
88
tier: Some(3),
99
host_tools: Some(false),
10-
std: None, // ?
10+
std: Some(true),
1111
},
1212
pointer_width: 32,
1313
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),

‎compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_uclibceabi.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub(crate) fn target() -> Target {
77
description: Some("Armv5TE Linux with uClibc".into()),
88
tier: Some(3),
99
host_tools: Some(false),
10-
std: None, // ?
10+
std: Some(true),
1111
},
1212
pointer_width: 32,
1313
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),

‎compiler/rustc_target/src/spec/targets/m68k_unknown_linux_gnu.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub(crate) fn target() -> Target {
1212
description: Some("Motorola 680x0 Linux".into()),
1313
tier: Some(3),
1414
host_tools: Some(false),
15-
std: None, // ?
15+
std: Some(true),
1616
},
1717
pointer_width: 32,
1818
data_layout: "E-m:e-p:32:16:32-i8:8:8-i16:16:16-i32:16:32-n8:16:32-a:0:16-S16".into(),

‎compiler/rustc_target/src/spec/targets/mips64_openwrt_linux_musl.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
1717
description: Some("MIPS64 for OpenWrt Linux musl 1.2.3".into()),
1818
tier: Some(3),
1919
host_tools: Some(false),
20-
std: None, // ?
20+
std: Some(true),
2121
},
2222
pointer_width: 64,
2323
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),

‎compiler/rustc_target/src/spec/targets/mipsisa32r6_unknown_linux_gnu.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub(crate) fn target() -> Target {
88
description: Some("32-bit MIPS Release 6 Big Endian".into()),
99
tier: Some(3),
1010
host_tools: Some(false),
11-
std: None, // ?
11+
std: Some(true),
1212
},
1313
pointer_width: 32,
1414
data_layout: "E-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),

‎compiler/rustc_target/src/spec/targets/mipsisa32r6el_unknown_linux_gnu.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub(crate) fn target() -> Target {
77
description: Some("32-bit MIPS Release 6 Little Endian".into()),
88
tier: Some(3),
99
host_tools: Some(false),
10-
std: None, // ?
10+
std: Some(true),
1111
},
1212
pointer_width: 32,
1313
data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(),

‎compiler/rustc_target/src/spec/targets/mipsisa64r6_unknown_linux_gnuabi64.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub(crate) fn target() -> Target {
88
description: Some("64-bit MIPS Release 6 Big Endian".into()),
99
tier: Some(3),
1010
host_tools: Some(false),
11-
std: None, // ?
11+
std: Some(true),
1212
},
1313
pointer_width: 64,
1414
data_layout: "E-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128".into(),

‎compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_musl.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub(crate) fn target() -> Target {
1414
description: Some("64-bit PowerPC Linux with musl 1.2.3".into()),
1515
tier: Some(3),
1616
host_tools: Some(false),
17-
std: None, // ?
17+
std: Some(true),
1818
},
1919
pointer_width: 64,
2020
data_layout: "E-m:e-Fn32-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),

‎compiler/rustc_target/src/spec/targets/powerpc64le_unknown_freebsd.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ pub(crate) fn target() -> Target {
1212
metadata: crate::spec::TargetMetadata {
1313
description: Some("PPC64LE FreeBSD".into()),
1414
tier: Some(3),
15-
host_tools: Some(false),
16-
std: Some(false),
15+
host_tools: Some(true),
16+
std: Some(true),
1717
},
1818
pointer_width: 64,
1919
data_layout: "e-m:e-Fn32-i64:64-n32:64".into(),

‎compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_musl.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
1313
description: Some("64-bit PowerPC Linux with musl 1.2.3, Little Endian".into()),
1414
tier: Some(3),
1515
host_tools: Some(false),
16-
std: None, // ?
16+
std: Some(true),
1717
},
1818
pointer_width: 64,
1919
data_layout: "e-m:e-Fn32-i64:64-n32:64-S128-v256:256:256-v512:512:512".into(),

‎compiler/rustc_target/src/spec/targets/powerpc_unknown_freebsd.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub(crate) fn target() -> Target {
1717
description: Some("PowerPC FreeBSD".into()),
1818
tier: Some(3),
1919
host_tools: Some(false),
20-
std: Some(false),
20+
std: Some(true),
2121
},
2222
pointer_width: 32,
2323
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),

‎compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_musl.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
1313
description: Some("PowerPC Linux with musl 1.2.3".into()),
1414
tier: Some(3),
1515
host_tools: Some(false),
16-
std: None, // ?
16+
std: Some(true),
1717
},
1818
pointer_width: 32,
1919
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),

‎compiler/rustc_target/src/spec/targets/powerpc_unknown_openbsd.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub(crate) fn target() -> Target {
1313
description: None,
1414
tier: Some(3),
1515
host_tools: Some(false),
16-
std: None, // ?
16+
std: Some(true),
1717
},
1818
pointer_width: 32,
1919
data_layout: "E-m:e-p:32:32-Fn32-i64:64-n32".into(),

‎compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_gnu.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub(crate) fn target() -> Target {
99
description: Some("RISC-V Linux (kernel 5.4, glibc 2.33)".into()),
1010
tier: Some(3),
1111
host_tools: Some(false),
12-
std: Some(false),
12+
std: Some(true),
1313
},
1414
pointer_width: 32,
1515
data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),

‎compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_musl.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub(crate) fn target() -> Target {
1111
),
1212
tier: Some(3),
1313
host_tools: Some(false),
14-
std: Some(false),
14+
std: Some(true),
1515
},
1616
pointer_width: 32,
1717
data_layout: "e-m:e-p:32:32-i64:64-n32-S128".into(),

‎compiler/rustc_target/src/spec/targets/riscv64_linux_android.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub(crate) fn target() -> Target {
99
description: Some("RISC-V 64-bit Android".into()),
1010
tier: Some(3),
1111
host_tools: Some(false),
12-
std: Some(false),
12+
std: Some(true),
1313
},
1414
pointer_width: 64,
1515
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),

‎compiler/rustc_target/src/spec/targets/riscv64gc_unknown_freebsd.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub(crate) fn target() -> Target {
77
description: Some("RISC-V FreeBSD".into()),
88
tier: Some(3),
99
host_tools: Some(false),
10-
std: Some(false),
10+
std: Some(true),
1111
},
1212
pointer_width: 64,
1313
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),

‎compiler/rustc_target/src/spec/targets/riscv64gc_unknown_fuchsia.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ pub(crate) fn target() -> Target {
77
description: Some("RISC-V Fuchsia".into()),
88
tier: Some(3),
99
host_tools: Some(false),
10-
std: Some(false),
10+
std: Some(true),
1111
},
1212
pointer_width: 64,
1313
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),

‎compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_musl.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ pub(crate) fn target() -> Target {
99
description: Some("RISC-V Linux (kernel 4.20, musl 1.2.3)".into()),
1010
tier: Some(3),
1111
host_tools: Some(false),
12-
std: Some(false),
12+
std: Some(true),
1313
},
1414
pointer_width: 64,
1515
data_layout: "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128".into(),

‎compiler/rustc_target/src/spec/targets/s390x_unknown_linux_musl.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
1919
description: Some("S390x Linux (kernel 3.2, musl 1.2.3)".into()),
2020
tier: Some(3),
2121
host_tools: Some(false),
22-
std: Some(false),
22+
std: Some(true),
2323
},
2424
pointer_width: 64,
2525
data_layout: "E-m:e-i1:8:16-i8:8:16-i64:64-f128:64-v128:64-a:8:16-n32:64".into(),

‎compiler/rustc_target/src/spec/targets/thumbv7neon_unknown_linux_musleabihf.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pub(crate) fn target() -> Target {
1616
description: Some("Thumb2-mode ARMv7-A Linux with NEON, musl 1.2.3".into()),
1717
tier: Some(3),
1818
host_tools: Some(false),
19-
std: None, // ?
19+
std: Some(true),
2020
},
2121
pointer_width: 32,
2222
data_layout: "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64".into(),

‎compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_none.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub(crate) fn target() -> Target {
1414
description: None,
1515
tier: None,
1616
host_tools: None,
17-
std: None,
17+
std: Some(true),
1818
},
1919
pointer_width: 64,
2020
data_layout:

‎library/core/Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ check-cfg = [
4343
'cfg(bootstrap)',
4444
'cfg(no_fp_fmt_parse)',
4545
'cfg(stdarch_intel_sde)',
46+
'cfg(target_arch, values("xtensa"))',
4647
# core use #[path] imports to portable-simd `core_simd` crate
4748
# and to stdarch `core_arch` crate which messes-up with Cargo list
4849
# of declared features, we therefor expect any feature cfg

‎library/core/src/ffi/va_list.rs‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use crate::ops::{Deref, DerefMut};
1515
not(target_arch = "aarch64"),
1616
not(target_arch = "powerpc"),
1717
not(target_arch = "s390x"),
18+
not(target_arch = "xtensa"),
1819
not(target_arch = "x86_64")
1920
),
2021
all(target_arch = "aarch64", target_vendor = "apple"),
@@ -37,6 +38,7 @@ pub struct VaListImpl<'f> {
3738
not(target_arch = "aarch64"),
3839
not(target_arch = "powerpc"),
3940
not(target_arch = "s390x"),
41+
not(target_arch = "xtensa"),
4042
not(target_arch = "x86_64")
4143
),
4244
all(target_arch = "aarch64", target_vendor = "apple"),
@@ -113,6 +115,18 @@ pub struct VaListImpl<'f> {
113115
_marker: PhantomData<&'f mut &'f c_void>,
114116
}
115117

118+
/// Xtensa ABI implementation of a `va_list`.
119+
#[cfg(target_arch = "xtensa")]
120+
#[repr(C)]
121+
#[derive(Debug)]
122+
#[lang = "va_list"]
123+
pub struct VaListImpl<'f> {
124+
stk: *mut i32,
125+
reg: *mut i32,
126+
ndx: i32,
127+
_marker: PhantomData<&'f mut &'f c_void>,
128+
}
129+
116130
/// A wrapper for a `va_list`
117131
#[repr(transparent)]
118132
#[derive(Debug)]
@@ -124,6 +138,7 @@ pub struct VaList<'a, 'f: 'a> {
124138
not(target_arch = "s390x"),
125139
not(target_arch = "x86_64")
126140
),
141+
target_arch = "xtensa",
127142
all(target_arch = "aarch64", target_vendor = "apple"),
128143
target_family = "wasm",
129144
target_os = "uefi",
@@ -138,6 +153,7 @@ pub struct VaList<'a, 'f: 'a> {
138153
target_arch = "s390x",
139154
target_arch = "x86_64"
140155
),
156+
not(target_arch = "xtensa"),
141157
any(not(target_arch = "aarch64"), not(target_vendor = "apple")),
142158
not(target_family = "wasm"),
143159
not(target_os = "uefi"),
@@ -155,6 +171,7 @@ pub struct VaList<'a, 'f: 'a> {
155171
not(target_arch = "s390x"),
156172
not(target_arch = "x86_64")
157173
),
174+
target_arch = "xtensa",
158175
all(target_arch = "aarch64", target_vendor = "apple"),
159176
target_family = "wasm",
160177
target_os = "uefi",
@@ -173,8 +190,10 @@ impl<'f> VaListImpl<'f> {
173190
target_arch = "aarch64",
174191
target_arch = "powerpc",
175192
target_arch = "s390x",
193+
target_arch = "xtensa",
176194
target_arch = "x86_64"
177195
),
196+
not(target_arch = "xtensa"),
178197
any(not(target_arch = "aarch64"), not(target_vendor = "apple")),
179198
not(target_family = "wasm"),
180199
not(target_os = "uefi"),

‎library/core/src/intrinsics/simd.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,8 @@ extern "rust-intrinsic" {
619619
/// set has support for a fused operation, and that the fused operation is more efficient
620620
/// than the equivalent, separate pair of mul and add instructions. It is unspecified
621621
/// whether or not a fused operation is selected, and that may depend on optimization
622-
/// level and context, for example.
622+
/// level and context, for example. It may even be the case that some SIMD lanes get fused
623+
/// and others do not.
623624
///
624625
/// `T` must be a vector of floats.
625626
#[cfg(not(bootstrap))]

‎library/std/src/sys/backtrace.rs‎

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ unsafe fn _print_fmt(fmt: &mut fmt::Formatter<'_>, print_fmt: PrintFmt) -> fmt::
5858
let mut res = Ok(());
5959
let mut omitted_count: usize = 0;
6060
let mut first_omit = true;
61-
// Start immediately if we're not using a short backtrace.
62-
let mut start = print_fmt != PrintFmt::Short;
61+
// If we're using a short backtrace, ignore all frames until we're told to start printing.
62+
let mut print = print_fmt != PrintFmt::Short;
6363
set_image_base();
6464
// SAFETY: we roll our own locking in this town
6565
unsafe {
@@ -72,27 +72,25 @@ unsafe fn _print_fmt(fmt: &mut fmt::Formatter<'_>, print_fmt: PrintFmt) -> fmt::
7272
backtrace_rs::resolve_frame_unsynchronized(frame, |symbol| {
7373
hit = true;
7474

75-
// Any frames between `__rust_begin_short_backtrace` and `__rust_end_short_backtrace`
76-
// are omitted from the backtrace in short mode, `__rust_end_short_backtrace` will be
77-
// called before the panic hook, so we won't ignore any frames if there is no
78-
// invoke of `__rust_begin_short_backtrace`.
75+
// `__rust_end_short_backtrace` means we are done hiding symbols
76+
// for now. Print until we see `__rust_begin_short_backtrace`.
7977
if print_fmt == PrintFmt::Short {
8078
if let Some(sym) = symbol.name().and_then(|s| s.as_str()) {
81-
if start && sym.contains("__rust_begin_short_backtrace") {
82-
start = false;
79+
if sym.contains("__rust_end_short_backtrace") {
80+
print = true;
8381
return;
8482
}
85-
if sym.contains("__rust_end_short_backtrace") {
86-
start = true;
83+
if print && sym.contains("__rust_begin_short_backtrace") {
84+
print = false;
8785
return;
8886
}
89-
if !start {
87+
if !print {
9088
omitted_count += 1;
9189
}
9290
}
9391
}
9492

95-
if start {
93+
if print {
9694
if omitted_count > 0 {
9795
debug_assert!(print_fmt == PrintFmt::Short);
9896
// only print the message between the middle of frames
@@ -112,7 +110,7 @@ unsafe fn _print_fmt(fmt: &mut fmt::Formatter<'_>, print_fmt: PrintFmt) -> fmt::
112110
});
113111
#[cfg(target_os = "nto")]
114112
if libc::__my_thread_exit as *mut libc::c_void == frame.ip() {
115-
if !hit && start {
113+
if !hit && print {
116114
use crate::backtrace_rs::SymbolName;
117115
res = bt_fmt.frame().print_raw(
118116
frame.ip(),
@@ -123,7 +121,7 @@ unsafe fn _print_fmt(fmt: &mut fmt::Formatter<'_>, print_fmt: PrintFmt) -> fmt::
123121
}
124122
return false;
125123
}
126-
if !hit && start {
124+
if !hit && print {
127125
res = bt_fmt.frame().print_raw(frame.ip(), None, None, None);
128126
}
129127

‎src/bootstrap/bootstrap.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,8 @@ def bootstrap(args):
11841184
args = [build.bootstrap_binary()]
11851185
args.extend(sys.argv[1:])
11861186
env = os.environ.copy()
1187+
# The Python process ID is used when creating a Windows job object
1188+
# (see src\bootstrap\src\utils\job.rs)
11871189
env["BOOTSTRAP_PARENT_ID"] = str(os.getpid())
11881190
env["BOOTSTRAP_PYTHON"] = sys.executable
11891191
run(args, env=env, verbose=build.verbose, is_bootstrap=True)

‎src/bootstrap/src/core/build_steps/setup.rs‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -452,24 +452,26 @@ pub struct Hook;
452452
impl Step for Hook {
453453
type Output = ();
454454
const DEFAULT: bool = true;
455+
455456
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
456457
run.alias("hook")
457458
}
459+
458460
fn make_run(run: RunConfig<'_>) {
459-
if run.builder.config.dry_run() {
460-
return;
461-
}
462461
if let [cmd] = &run.paths[..] {
463462
if cmd.assert_single_path().path.as_path().as_os_str() == "hook" {
464463
run.builder.ensure(Hook);
465464
}
466465
}
467466
}
467+
468468
fn run(self, builder: &Builder<'_>) -> Self::Output {
469469
let config = &builder.config;
470-
if config.dry_run() {
470+
471+
if config.dry_run() || !config.rust_info.is_managed_git_subrepository() {
471472
return;
472473
}
474+
473475
t!(install_git_hook_maybe(builder, config));
474476
}
475477
}

‎src/bootstrap/src/utils/job.rs‎

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ pub unsafe fn setup(build: &mut crate::Build) {
1515
///
1616
/// Most of the time when you're running a build system (e.g., make) you expect
1717
/// Ctrl-C or abnormal termination to actually terminate the entire tree of
18-
/// process in play, not just the one at the top. This currently works "by
18+
/// processes in play. This currently works "by
1919
/// default" on Unix platforms because Ctrl-C actually sends a signal to the
20-
/// *process group* rather than the parent process, so everything will get torn
21-
/// down. On Windows, however, this does not happen and Ctrl-C just kills the
22-
/// parent process.
20+
/// *process group* so everything will get torn
21+
/// down. On Windows, however, Ctrl-C is only sent to processes in the same console.
22+
/// If a process is detached or attached to another console, it won't receive the
23+
/// signal.
2324
///
2425
/// To achieve the same semantics on Windows we use Job Objects to ensure that
2526
/// all processes die at the same time. Job objects have a mode of operation
@@ -87,15 +88,7 @@ mod for_windows {
8788
);
8889
assert!(r.is_ok(), "{}", io::Error::last_os_error());
8990

90-
// Assign our process to this job object. Note that if this fails, one very
91-
// likely reason is that we are ourselves already in a job object! This can
92-
// happen on the build bots that we've got for Windows, or if just anyone
93-
// else is instrumenting the build. In this case we just bail out
94-
// immediately and assume that they take care of it.
95-
//
96-
// Also note that nested jobs (why this might fail) are supported in recent
97-
// versions of Windows, but the version of Windows that our bots are running
98-
// at least don't support nested job objects.
91+
// Assign our process to this job object.
9992
let r = AssignProcessToJobObject(job, GetCurrentProcess());
10093
if r.is_err() {
10194
CloseHandle(job).ok();
@@ -124,14 +117,19 @@ mod for_windows {
124117
// (only when wrongly setting the environmental variable),
125118
// it might be better to improve the experience of the second case
126119
// when users have interrupted the parent process and we haven't finish
127-
// duplicating the handle yet. We just need close the job object if that occurs.
128-
CloseHandle(job).ok();
120+
// duplicating the handle yet.
129121
return;
130122
}
131123
};
132124

133125
let mut parent_handle = HANDLE::default();
134-
let r = DuplicateHandle(
126+
// If this fails, well at least we tried! An example of DuplicateHandle
127+
// failing in the past has been when the wrong python2 package spawned this
128+
// build system (e.g., the `python2` package in MSYS instead of
129+
// `mingw-w64-x86_64-python2`). Not sure why it failed, but the "failure
130+
// mode" here is that we only clean everything up when the build system
131+
// dies, not when the python parent does, so not too bad.
132+
let _ = DuplicateHandle(
135133
GetCurrentProcess(),
136134
job,
137135
parent,
@@ -140,15 +138,6 @@ mod for_windows {
140138
false,
141139
DUPLICATE_SAME_ACCESS,
142140
);
143-
144-
// If this failed, well at least we tried! An example of DuplicateHandle
145-
// failing in the past has been when the wrong python2 package spawned this
146-
// build system (e.g., the `python2` package in MSYS instead of
147-
// `mingw-w64-x86_64-python2`). Not sure why it failed, but the "failure
148-
// mode" here is that we only clean everything up when the build system
149-
// dies, not when the python parent does, so not too bad.
150-
if r.is_err() {
151-
CloseHandle(job).ok();
152-
}
141+
CloseHandle(parent).ok();
153142
}
154143
}

‎src/doc/rustc/src/platform-support.md‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -344,15 +344,15 @@ target | std | host | notes
344344
[`powerpc-wrs-vxworks-spe`](platform-support/vxworks.md) | ✓ | |
345345
[`powerpc-wrs-vxworks`](platform-support/vxworks.md) | ✓ | |
346346
`powerpc64-unknown-freebsd` | ✓ | ✓ | PPC64 FreeBSD (ELFv1 and ELFv2)
347-
`powerpc64le-unknown-freebsd` | | | PPC64LE FreeBSD
348-
`powerpc-unknown-freebsd` | | | PowerPC FreeBSD
347+
`powerpc64le-unknown-freebsd` | ✓ | ✓ | PPC64LE FreeBSD
348+
`powerpc-unknown-freebsd` | ? | | PowerPC FreeBSD
349349
`powerpc64-unknown-linux-musl` | ? | | 64-bit PowerPC Linux with musl 1.2.3
350350
[`powerpc64-wrs-vxworks`](platform-support/vxworks.md) | ✓ | |
351351
`powerpc64le-unknown-linux-musl` | ? | | 64-bit PowerPC Linux with musl 1.2.3, Little Endian
352352
[`powerpc64-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | OpenBSD/powerpc64
353353
[`powerpc64-ibm-aix`](platform-support/aix.md) | ? | | 64-bit AIX (7.2 and newer)
354-
`riscv32gc-unknown-linux-gnu` | | | RISC-V Linux (kernel 5.4, glibc 2.33)
355-
`riscv32gc-unknown-linux-musl` | | | RISC-V Linux (kernel 5.4, musl 1.2.3 + RISCV32 support patches)
354+
`riscv32gc-unknown-linux-gnu` | | | RISC-V Linux (kernel 5.4, glibc 2.33)
355+
`riscv32gc-unknown-linux-musl` | ? | | RISC-V Linux (kernel 5.4, musl 1.2.3 + RISCV32 support patches)
356356
[`riscv32im-risc0-zkvm-elf`](platform-support/riscv32im-risc0-zkvm-elf.md) | ? | | RISC Zero's zero-knowledge Virtual Machine (RV32IM ISA)
357357
[`riscv32ima-unknown-none-elf`](platform-support/riscv32-unknown-none-elf.md) | * | | Bare RISC-V (RV32IMA ISA)
358358
[`riscv32imac-unknown-xous-elf`](platform-support/riscv32imac-unknown-xous-elf.md) | ? | | RISC-V Xous (RV32IMAC ISA)
@@ -361,13 +361,13 @@ target | std | host | notes
361361
[`riscv32imafc-esp-espidf`](platform-support/esp-idf.md) | ✓ | | RISC-V ESP-IDF
362362
[`riscv32-wrs-vxworks`](platform-support/vxworks.md) | ✓ | |
363363
[`riscv64gc-unknown-hermit`](platform-support/hermit.md) | ✓ | | RISC-V Hermit
364-
`riscv64gc-unknown-freebsd` | | | RISC-V FreeBSD
365-
`riscv64gc-unknown-fuchsia` | | | RISC-V Fuchsia
364+
`riscv64gc-unknown-freebsd` | ? | | RISC-V FreeBSD
365+
`riscv64gc-unknown-fuchsia` | ? | | RISC-V Fuchsia
366366
[`riscv64gc-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | RISC-V NetBSD
367367
[`riscv64gc-unknown-openbsd`](platform-support/openbsd.md) | ✓ | ✓ | OpenBSD/riscv64
368-
[`riscv64-linux-android`](platform-support/android.md) | | | RISC-V 64-bit Android
368+
[`riscv64-linux-android`](platform-support/android.md) | ? | | RISC-V 64-bit Android
369369
[`riscv64-wrs-vxworks`](platform-support/vxworks.md) | ✓ | |
370-
[`s390x-unknown-linux-musl`](platform-support/s390x-unknown-linux-musl.md) | | | S390x Linux (kernel 3.2, musl 1.2.3)
370+
[`s390x-unknown-linux-musl`](platform-support/s390x-unknown-linux-musl.md) | | | S390x Linux (kernel 3.2, musl 1.2.3)
371371
`sparc-unknown-linux-gnu` | ✓ | | 32-bit SPARC Linux
372372
[`sparc-unknown-none-elf`](./platform-support/sparc-unknown-none-elf.md) | * | | Bare 32-bit SPARC V7+
373373
[`sparc64-unknown-netbsd`](platform-support/netbsd.md) | ✓ | ✓ | NetBSD/sparc64

0 commit comments

Comments
 (0)
This repository has been archived.