Skip to content
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

Rollup of 6 pull requests #128996

Closed
wants to merge 21 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
acb0241
Add windows-targets crate to std's sysroot
ChrisDenton Aug 9, 2024
a1b2b7f
Exclude windows-targets from the workspace
ChrisDenton Aug 9, 2024
03ee7b5
Move verbose help parsing to `main`
Kobzol Aug 9, 2024
5431a93
Pass `Flags` to `Config::parse` explicitly
Kobzol Aug 9, 2024
4f8042e
Support reading thin archives in ArArchiveBuilder
bjorn3 Aug 10, 2024
a57f73d
Add test for thin archive reading support
bjorn3 Aug 10, 2024
c1f5350
Use ArArchiveBuilder with the LLVM backend too
bjorn3 Aug 10, 2024
141d9dc
remove unused imports from rmake tests
lqd Aug 10, 2024
f4cb0de
remove other warnings from rmake tests
lqd Aug 10, 2024
d63a067
Add fixme for removing LlvmArchiveBuilder in the future
bjorn3 Aug 10, 2024
dcd6170
use `rfs` in rustdoc io rmake test
lqd Aug 11, 2024
db68a19
Fix review comments and other improvements
bjorn3 Aug 11, 2024
01a97ed
bootstrap: fix trying to modify file times on read-only file
jieyouxu Aug 11, 2024
13c36f1
bootstrap: extract out a `set_file_times` helper
jieyouxu Aug 11, 2024
c361c92
Use assert_matches around the compiler
compiler-errors Aug 11, 2024
2165459
Rollup merge of #128873 - ChrisDenton:windows-targets, r=Mark-Simulacrum
matthiaskrgr Aug 12, 2024
ea31cd9
Rollup merge of #128878 - Kobzol:refactor-flags, r=onur-ozkan
matthiaskrgr Aug 12, 2024
62fddf1
Rollup merge of #128936 - bjorn3:fix_thin_archive_reading, r=jieyouxu
matthiaskrgr Aug 12, 2024
03c2854
Rollup merge of #128937 - lqd:clean-rmake-tests, r=jieyouxu
matthiaskrgr Aug 12, 2024
9ef4afb
Rollup merge of #128977 - jieyouxu:writable-file, r=Kobzol
matthiaskrgr Aug 12, 2024
345d0fe
Rollup merge of #128978 - compiler-errors:assert-matches, r=jieyouxu
matthiaskrgr Aug 12, 2024
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
Prev Previous commit
Next Next commit
Fix review comments and other improvements
bjorn3 committed Aug 11, 2024
commit db68a19b619ffc4b4ee9d1118d064d184d0bcd37
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_llvm/src/back/archive.rs
Original file line number Diff line number Diff line change
@@ -108,8 +108,8 @@ impl ArchiveBuilderBuilder for LlvmArchiveBuilderBuilder {
fn new_archive_builder<'a>(&self, sess: &'a Session) -> Box<dyn ArchiveBuilder + 'a> {
// Keeping LlvmArchiveBuilder around in case of a regression caused by using
// ArArchiveBuilder.
// FIXME remove a couple of months after #128936 gets merged in case no
// regression is found.
// FIXME(#128955) remove a couple of months after #128936 gets merged in case
// no regression is found.
if false {
Box::new(LlvmArchiveBuilder { sess, additions: Vec::new() })
} else {
6 changes: 2 additions & 4 deletions compiler/rustc_codegen_ssa/src/back/archive.rs
Original file line number Diff line number Diff line change
@@ -308,10 +308,8 @@ impl<'a> ArchiveBuilder for ArArchiveBuilder<'a> {
.map_err(|err| io::Error::new(io::ErrorKind::InvalidData, err))?;
if !skip(&file_name) {
if entry.is_thin() {
self.entries.push((
file_name.clone().into_bytes(),
ArchiveEntry::File(PathBuf::from(file_name)),
));
let member_path = archive_path.parent().unwrap().join(Path::new(&file_name));
self.entries.push((file_name.into_bytes(), ArchiveEntry::File(member_path)));
} else {
self.entries.push((
file_name.into_bytes(),
7 changes: 1 addition & 6 deletions tests/run-make/staticlib-thin-archive/bin.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
#[link(name = "rust_archive", kind = "static")]
extern "C" {
fn simple_fn();
}

fn main() {
unsafe {
simple_fn();
rust_lib::simple_fn();
}
}
31 changes: 23 additions & 8 deletions tests/run-make/staticlib-thin-archive/rmake.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
// Regression test for https://github.com/rust-lang/rust/issues/107407
// Regression test for https://github.com/rust-lang/rust/issues/107407 which
// checks that rustc can read thin archive. Before the object crate added thin
// archive support rustc would add emit object files to the staticlib and after
// the object crate added thin archive support it would previously crash the
// compiler due to a missing special case for thin archive members.
use std::path::Path;

use run_make_support::{llvm_ar, rustc, static_lib_name};
use run_make_support::{llvm_ar, rust_lib_name, rustc, static_lib_name};

fn main() {
rustc().input("simple_obj.rs").emit("obj").run();
llvm_ar().obj_to_thin_ar().output_input(static_lib_name("thin_archive"), "simple_obj.o").run();
rustc().input("rust_archive.rs").run();
// Disable lld as it ignores the symbol table in the archive file.
rustc()
.input("bin.rs") /*.arg("-Zlinker-features=-lld")*/
std::fs::create_dir("archive").unwrap();

// Build a thin archive
rustc().input("simple_obj.rs").emit("obj").output("archive/simple_obj.o").run();
llvm_ar()
.obj_to_thin_ar()
.output_input(
Path::new("archive").join(static_lib_name("thin_archive")),
"archive/simple_obj.o",
)
.run();

// Build an rlib which includes the members of this thin archive
rustc().input("rust_lib.rs").library_search_path("archive").run();

// Build a binary which requires a symbol from the thin archive
rustc().input("bin.rs").extern_("rust_lib", rust_lib_name("rust_lib")).run();
}
4 changes: 0 additions & 4 deletions tests/run-make/staticlib-thin-archive/rust_archive.rs

This file was deleted.

6 changes: 6 additions & 0 deletions tests/run-make/staticlib-thin-archive/rust_lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#![crate_type = "rlib"]

#[link(name = "thin_archive", kind = "static")]
extern "C" {
pub fn simple_fn();
}