Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit fcaf04e

Browse files
committed
Auto merge of rust-lang#113559 - matthiaskrgr:rollup-jrqyctc, r=matthiaskrgr
Rollup of 7 pull requests Successful merges: - rust-lang#113386 (style-guide: Expand example of combinable expressions to include arrays) - rust-lang#113523 (Reuse LLVMConstInBoundsGEP2) - rust-lang#113528 (Dynamically size sigaltstk in rustc) - rust-lang#113543 (Remove `rustc_llvm` from llvm-stamp nags) - rust-lang#113548 (Update books) - rust-lang#113551 (bootstrap: Don't print "Skipping" twice) - rust-lang#113556 (Don't use serde-derive in the rls shim) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 1d4f5af + ad4f303 commit fcaf04e

File tree

17 files changed

+54
-39
lines changed

17 files changed

+54
-39
lines changed

‎Cargo.lock‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3021,7 +3021,6 @@ dependencies = [
30213021
name = "rls"
30223022
version = "2.0.0"
30233023
dependencies = [
3024-
"serde",
30253024
"serde_json",
30263025
]
30273026

‎compiler/rustc_codegen_llvm/src/common.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ impl<'ll, 'tcx> ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> {
290290
}
291291
};
292292
let llval = unsafe {
293-
llvm::LLVMRustConstInBoundsGEP2(
293+
llvm::LLVMConstInBoundsGEP2(
294294
self.type_i8(),
295295
self.const_bitcast(base_addr, self.type_i8p_ext(base_addr_space)),
296296
&self.const_usize(offset.bytes()),
@@ -320,7 +320,7 @@ impl<'ll, 'tcx> ConstMethods<'tcx> for CodegenCx<'ll, 'tcx> {
320320

321321
fn const_ptr_byte_offset(&self, base_addr: Self::Value, offset: abi::Size) -> Self::Value {
322322
unsafe {
323-
llvm::LLVMRustConstInBoundsGEP2(
323+
llvm::LLVMConstInBoundsGEP2(
324324
self.type_i8(),
325325
self.const_bitcast(base_addr, self.type_i8p()),
326326
&self.const_usize(offset.bytes()),

‎compiler/rustc_codegen_llvm/src/llvm/ffi.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1155,7 +1155,7 @@ extern "C" {
11551155
pub fn LLVMConstVector(ScalarConstantVals: *const &Value, Size: c_uint) -> &Value;
11561156

11571157
// Constant expressions
1158-
pub fn LLVMRustConstInBoundsGEP2<'a>(
1158+
pub fn LLVMConstInBoundsGEP2<'a>(
11591159
ty: &'a Type,
11601160
ConstantVal: &'a Value,
11611161
ConstantIndices: *const &'a Value,

‎compiler/rustc_driver_impl/src/lib.rs‎

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1453,13 +1453,13 @@ mod signal_handler {
14531453
/// When an error signal (such as SIGABRT or SIGSEGV) is delivered to the
14541454
/// process, print a stack trace and then exit.
14551455
pub(super) fn install() {
1456+
use std::alloc::{alloc, Layout};
1457+
14561458
unsafe {
1457-
constALT_STACK_SIZE: usize = libc::MINSIGSTKSZ + 64 * 1024;
1459+
let alt_stack_size: usize = min_sigstack_size() + 64 * 1024;
14581460
let mut alt_stack: libc::stack_t = std::mem::zeroed();
1459-
alt_stack.ss_sp =
1460-
std::alloc::alloc(std::alloc::Layout::from_size_align(ALT_STACK_SIZE, 1).unwrap())
1461-
as *mut libc::c_void;
1462-
alt_stack.ss_size = ALT_STACK_SIZE;
1461+
alt_stack.ss_sp = alloc(Layout::from_size_align(alt_stack_size, 1).unwrap()).cast();
1462+
alt_stack.ss_size = alt_stack_size;
14631463
libc::sigaltstack(&alt_stack, std::ptr::null_mut());
14641464

14651465
let mut sa: libc::sigaction = std::mem::zeroed();
@@ -1469,6 +1469,23 @@ mod signal_handler {
14691469
libc::sigaction(libc::SIGSEGV, &sa, std::ptr::null_mut());
14701470
}
14711471
}
1472+
1473+
/// Modern kernels on modern hardware can have dynamic signal stack sizes.
1474+
#[cfg(any(target_os = "linux", target_os = "android"))]
1475+
fn min_sigstack_size() -> usize {
1476+
const AT_MINSIGSTKSZ: core::ffi::c_ulong = 51;
1477+
let dynamic_sigstksz = unsafe { libc::getauxval(AT_MINSIGSTKSZ) };
1478+
// If getauxval couldn't find the entry, it returns 0,
1479+
// so take the higher of the "constant" and auxval.
1480+
// This transparently supports older kernels which don't provide AT_MINSIGSTKSZ
1481+
libc::MINSIGSTKSZ.max(dynamic_sigstksz as _)
1482+
}
1483+
1484+
/// Not all OS support hardware where this is needed.
1485+
#[cfg(not(any(target_os = "linux", target_os = "android")))]
1486+
fn min_sigstack_size() -> usize {
1487+
libc::MINSIGSTKSZ
1488+
}
14721489
}
14731490

14741491
#[cfg(not(all(unix, any(target_env = "gnu", target_os = "macos"))))]

‎compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,17 +1616,6 @@ extern "C" void LLVMRustSetLinkage(LLVMValueRef V,
16161616
LLVMSetLinkage(V, fromRust(RustLinkage));
16171617
}
16181618

1619-
// FIXME: replace with LLVMConstInBoundsGEP2 when bumped minimal version to llvm-14
1620-
extern "C" LLVMValueRef LLVMRustConstInBoundsGEP2(LLVMTypeRef Ty,
1621-
LLVMValueRef ConstantVal,
1622-
LLVMValueRef *ConstantIndices,
1623-
unsigned NumIndices) {
1624-
ArrayRef<Constant *> IdxList(unwrap<Constant>(ConstantIndices, NumIndices),
1625-
NumIndices);
1626-
Constant *Val = unwrap<Constant>(ConstantVal);
1627-
return wrap(ConstantExpr::getInBoundsGetElementPtr(unwrap(Ty), Val, IdxList));
1628-
}
1629-
16301619
extern "C" bool LLVMRustConstIntGetZExtValue(LLVMValueRef CV, uint64_t *value) {
16311620
auto C = unwrap<llvm::ConstantInt>(CV);
16321621
if (C->getBitWidth() > 64)

‎src/bootstrap/builder.rs‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use std::process::Command;
1313
use std::time::{Duration, Instant};
1414

1515
use crate::cache::{Cache, Interned, INTERNER};
16-
use crate::config::{SplitDebuginfo, TargetSelection};
16+
use crate::config::{DryRun,SplitDebuginfo, TargetSelection};
1717
use crate::doc;
1818
use crate::flags::{Color, Subcommand};
1919
use crate::install;
@@ -281,11 +281,15 @@ impl StepDescription {
281281

282282
fn is_excluded(&self, builder: &Builder<'_>, pathset: &PathSet) -> bool {
283283
if builder.config.exclude.iter().any(|e| pathset.has(&e, builder.kind)) {
284-
println!("Skipping {:?} because it is excluded", pathset);
284+
if !matches!(builder.config.dry_run, DryRun::SelfCheck) {
285+
println!("Skipping {:?} because it is excluded", pathset);
286+
}
285287
return true;
286288
}
287289

288-
if !builder.config.exclude.is_empty() {
290+
if !builder.config.exclude.is_empty()
291+
&& !matches!(builder.config.dry_run, DryRun::SelfCheck)
292+
{
289293
builder.verbose(&format!(
290294
"{:?} not skipped for {:?} -- not in {:?}",
291295
pathset, self.name, builder.config.exclude

‎src/doc/book‎

‎src/doc/edition-guide‎

‎src/doc/embedded-book‎

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /