Skip to content

Rollup of 10 pull requests #137796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 27 commits into from
Mar 1, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7061551
Add FileCheck annotations to mir-opt/issues
Shunpoco Dec 30, 2024
736ef0a
Don't error when adding a staticlib with bitcode files compiled by ne…
bjorn3 Feb 14, 2025
9147b6d
Add test
bjorn3 Feb 14, 2025
3a3aede
Update some comparison tests now that they pass in LLVM20
scottmcm Feb 18, 2025
ec45166
Tell llvm-ar to not create a symbol table
bjorn3 Feb 21, 2025
92eb445
tests: use minicore more
davidtwco Feb 24, 2025
9f190d7
Restore usage of io::Error
bjorn3 Feb 26, 2025
4fcebee
Fix Windows `Command` search path bug
ChrisDenton Feb 26, 2025
9a2362a
linker: Fix escaping style for response files on Windows
petrochenkov Feb 26, 2025
e28500d
Re-enable `--generate-link-to-defintion` for tools internal rustdoc
aDotInTheVoid Feb 26, 2025
d8a067b
remove most `simd_` intrinsic declaration in tests
folkertdev Feb 24, 2025
a837e99
simplify some imports with `simd::*`
folkertdev Feb 24, 2025
4e961dc
make `simd_insert` and `simd_extract` `const fn`s
folkertdev Feb 24, 2025
038f4e2
use the right feature in codegen tests
folkertdev Feb 24, 2025
660241d
Fix test directives that were accidentally ignored
yotamofek Feb 24, 2025
0881dba
Move "unused_exter_crate" test from rustdoc-ui to rustdoc
yotamofek Feb 27, 2025
b67b6c0
Fix sized constraint for unsafe binder
compiler-errors Feb 28, 2025
d9c34a7
Rollup merge of #134943 - Shunpoco:116971-mir-opt-issues, r=DianQK
jieyouxu Feb 28, 2025
61e9004
Rollup merge of #137017 - bjorn3:ignore_invalid_bitcode, r=oli-obk
jieyouxu Feb 28, 2025
87cac9f
Rollup merge of #137197 - scottmcm:cmp-20, r=ibraheemdev
jieyouxu Feb 28, 2025
d09523d
Rollup merge of #137540 - yotamofek:pr/more-deprecated-test-directive…
jieyouxu Feb 28, 2025
50ef985
Rollup merge of #137551 - folkertdev:import-simd-intrinsics, r=RalfJung
jieyouxu Feb 28, 2025
50ed7f9
Rollup merge of #137599 - davidtwco:use-minicore-more, r=jieyouxu
jieyouxu Feb 28, 2025
4606610
Rollup merge of #137673 - ChrisDenton:search-path-bug, r=dtolnay
jieyouxu Feb 28, 2025
f1cdd3b
Rollup merge of #137676 - petrochenkov:winresp, r=Kobzol
jieyouxu Feb 28, 2025
9e1ead6
Rollup merge of #137693 - aDotInTheVoid:gaming, r=onur-ozkan,Guillaum…
jieyouxu Feb 28, 2025
0cb9827
Rollup merge of #137770 - compiler-errors:unsafe-binder-sized-crit, r…
jieyouxu Feb 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1726,8 +1726,12 @@ fn exec_linker(
args.push_str(
&Escape {
arg: arg.to_str().unwrap(),
// LLD also uses MSVC-like parsing for @-files by default when running on windows hosts
is_like_msvc: sess.target.is_like_msvc || (cfg!(windows) && flavor.uses_lld()),
// Windows-style escaping for @-files is used by
// - all linkers targeting MSVC-like targets, including LLD
// - all LLD flavors running on Windows hosts
// С/С++ compilers use Posix-style escaping (except clang-cl, which we do not use).
is_like_msvc: sess.target.is_like_msvc
|| (cfg!(windows) && flavor.uses_lld() && !flavor.uses_cc()),
}
.to_string(),
);
Expand Down
20 changes: 16 additions & 4 deletions src/bootstrap/src/core/build_steps/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,13 @@ impl Step for Cargotest {
.args(builder.config.test_args())
.env("RUSTC", builder.rustc(compiler))
.env("RUSTDOC", builder.rustdoc(compiler));
add_rustdoc_cargo_linker_args(&mut cmd, builder, compiler.host, LldThreads::No);
add_rustdoc_cargo_linker_args(
&mut cmd,
builder,
compiler.host,
LldThreads::No,
compiler.stage,
);
cmd.delay_failure().run(builder);
}
}
Expand Down Expand Up @@ -847,7 +853,7 @@ impl Step for RustdocTheme {
.env("CFG_RELEASE_CHANNEL", &builder.config.channel)
.env("RUSTDOC_REAL", builder.rustdoc(self.compiler))
.env("RUSTC_BOOTSTRAP", "1");
cmd.args(linker_args(builder, self.compiler.host, LldThreads::No));
cmd.args(linker_args(builder, self.compiler.host, LldThreads::No, self.compiler.stage));

cmd.delay_failure().run(builder);
}
Expand Down Expand Up @@ -1023,7 +1029,13 @@ impl Step for RustdocGUI {
cmd.env("RUSTDOC", builder.rustdoc(self.compiler))
.env("RUSTC", builder.rustc(self.compiler));

add_rustdoc_cargo_linker_args(&mut cmd, builder, self.compiler.host, LldThreads::No);
add_rustdoc_cargo_linker_args(
&mut cmd,
builder,
self.compiler.host,
LldThreads::No,
self.compiler.stage,
);

for path in &builder.paths {
if let Some(p) = helpers::is_valid_test_suite_arg(path, "tests/rustdoc-gui", builder) {
Expand Down Expand Up @@ -1887,7 +1899,7 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the

let mut hostflags = flags.clone();
hostflags.push(format!("-Lnative={}", builder.test_helpers_out(compiler.host).display()));
hostflags.extend(linker_flags(builder, compiler.host, LldThreads::No));
hostflags.extend(linker_flags(builder, compiler.host, LldThreads::No, compiler.stage));

let mut targetflags = flags;
targetflags.push(format!("-Lnative={}", builder.test_helpers_out(target).display()));
Expand Down
6 changes: 3 additions & 3 deletions src/bootstrap/src/core/builder/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ impl Cargo {
}
}

for arg in linker_args(builder, compiler.host, LldThreads::Yes) {
for arg in linker_args(builder, compiler.host, LldThreads::Yes, 0) {
self.hostflags.arg(&arg);
}

Expand All @@ -270,10 +270,10 @@ impl Cargo {
}
// We want to set -Clinker using Cargo, therefore we only call `linker_flags` and not
// `linker_args` here.
for flag in linker_flags(builder, target, LldThreads::Yes) {
for flag in linker_flags(builder, target, LldThreads::Yes, compiler.stage) {
self.rustflags.arg(&flag);
}
for arg in linker_args(builder, target, LldThreads::Yes) {
for arg in linker_args(builder, target, LldThreads::Yes, compiler.stage) {
self.rustdocflags.arg(&arg);
}

Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ impl<'a> Builder<'a> {
cmd.arg("-Dwarnings");
}
cmd.arg("-Znormalize-docs");
cmd.args(linker_args(self, compiler.host, LldThreads::Yes));
cmd.args(linker_args(self, compiler.host, LldThreads::Yes, compiler.stage));
cmd
}

Expand Down
14 changes: 11 additions & 3 deletions src/bootstrap/src/utils/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,9 @@ pub fn linker_args(
builder: &Builder<'_>,
target: TargetSelection,
lld_threads: LldThreads,
stage: u32,
) -> Vec<String> {
let mut args = linker_flags(builder, target, lld_threads);
let mut args = linker_flags(builder, target, lld_threads, stage);

if let Some(linker) = builder.linker(target) {
args.push(format!("-Clinker={}", linker.display()));
Expand All @@ -446,12 +447,18 @@ pub fn linker_flags(
builder: &Builder<'_>,
target: TargetSelection,
lld_threads: LldThreads,
stage: u32,
) -> Vec<String> {
let mut args = vec![];
if !builder.is_lld_direct_linker(target) && builder.config.lld_mode.is_used() {
match builder.config.lld_mode {
LldMode::External => {
args.push("-Clinker-flavor=gnu-lld-cc".to_string());
// cfg(bootstrap) - remove after updating bootstrap compiler (#137498)
if stage == 0 && target.is_windows() {
args.push("-Clink-arg=-fuse-ld=lld".to_string());
} else {
args.push("-Clinker-flavor=gnu-lld-cc".to_string());
}
// FIXME(kobzol): remove this flag once MCP510 gets stabilized
args.push("-Zunstable-options".to_string());
}
Expand Down Expand Up @@ -479,8 +486,9 @@ pub fn add_rustdoc_cargo_linker_args(
builder: &Builder<'_>,
target: TargetSelection,
lld_threads: LldThreads,
stage: u32,
) {
let args = linker_args(builder, target, lld_threads);
let args = linker_args(builder, target, lld_threads, stage);
let mut flags = cmd
.get_envs()
.find_map(|(k, v)| if k == OsStr::new("RUSTDOCFLAGS") { v } else { None })
Expand Down