Skip to content

[don't merge] which object version breaks? #128040

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

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 18 additions & 4 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2641,7 +2641,6 @@ dependencies = [
"indexmap",
"memchr",
"ruzstd 0.5.0",
"wasmparser 0.118.2",
]

[[package]]
Expand All @@ -2661,7 +2660,11 @@ version = "0.35.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e"
dependencies = [
"crc32fast",
"hashbrown",
"indexmap",
"memchr",
"wasmparser 0.202.0",
]

[[package]]
Expand Down Expand Up @@ -3769,7 +3772,7 @@ dependencies = [
"itertools",
"libc",
"measureme",
"object 0.32.2",
"object 0.35.0",
"rustc-demangle",
"rustc_ast",
"rustc_attr",
Expand Down Expand Up @@ -3808,7 +3811,7 @@ dependencies = [
"itertools",
"jobserver",
"libc",
"object 0.32.2",
"object 0.35.0",
"pathdiff",
"regex",
"rustc_arena",
Expand Down Expand Up @@ -4791,7 +4794,7 @@ name = "rustc_target"
version = "0.0.0"
dependencies = [
"bitflags 2.5.0",
"object 0.32.2",
"object 0.35.0",
"rustc_abi",
"rustc_data_structures",
"rustc_feature",
Expand Down Expand Up @@ -6414,6 +6417,17 @@ dependencies = [
"semver",
]

[[package]]
name = "wasmparser"
version = "0.202.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6998515d3cf3f8b980ef7c11b29a9b1017d4cf86b99ae93b546992df9931413"
dependencies = [
"bitflags 2.5.0",
"indexmap",
"semver",
]

[[package]]
name = "wasmparser"
version = "0.210.0"
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_llvm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ bitflags = "2.4.1"
itertools = "0.12"
libc = "0.2"
measureme = "11"
object = { version = "0.32.0", default-features = false, features = ["std", "read"] }
object = { version = "0.35.0", default-features = false, features = ["std", "read"] }
rustc-demangle = "0.1.21"
rustc_ast = { path = "../rustc_ast" }
rustc_attr = { path = "../rustc_attr" }
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ libc = "0.2.50"
# tidy-alphabetical-end

[dependencies.object]
version = "0.32.1"
version = "0.35.0"
default-features = false
features = ["read_core", "elf", "macho", "pe", "xcoff", "unaligned", "archive", "write", "wasm"]

Expand Down
22 changes: 13 additions & 9 deletions compiler/rustc_codegen_ssa/src/back/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,11 @@ impl<'a> ArArchiveBuilder<'a> {
}

fn try_filter_fat_archs(
archs: object::read::Result<&[impl FatArch]>,
archs: &[impl FatArch],
target_arch: object::Architecture,
archive_path: &Path,
archive_map_data: &[u8],
) -> io::Result<Option<PathBuf>> {
let archs = archs.map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;

let desired = match archs.iter().find(|a| a.architecture() == target_arch) {
Some(a) => a,
None => return Ok(None),
Expand Down Expand Up @@ -146,17 +144,23 @@ pub fn try_extract_macho_fat_archive(
_ => return Ok(None),
};

match object::macho::FatHeader::parse(&*archive_map) {
Ok(h) if h.magic.get(object::endian::BigEndian) == object::macho::FAT_MAGIC => {
let archs = object::macho::FatHeader::parse_arch32(&*archive_map);
if let Ok(h) = object::read::macho::MachOFatFile32::parse(&*archive_map) {
if h.header().magic.get(object::endian::BigEndian) == object::macho::FAT_MAGIC {
let archs = h.arches();
try_filter_fat_archs(archs, target_arch, archive_path, &*archive_map)
} else {
Ok(None)
}
Ok(h) if h.magic.get(object::endian::BigEndian) == object::macho::FAT_MAGIC_64 => {
let archs = object::macho::FatHeader::parse_arch64(&*archive_map);
} else if let Ok(h) = object::read::macho::MachOFatFile64::parse(&*archive_map) {
if h.header().magic.get(object::endian::BigEndian) == object::macho::FAT_MAGIC_64 {
let archs = h.arches();
try_filter_fat_archs(archs, target_arch, archive_path, &*archive_map)
} else {
Ok(None)
}
} else {
// Not a FatHeader at all, just return None.
_ => Ok(None),
Ok(None)
}
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ fn link_dwarf_object(sess: &Session, cg_results: &CodegenResults, executable_out
.truncate(true)
.open(dwp_out_filename)?,
);
let mut output_stream = object::write::StreamingBuffer::new(output_stream);
let mut output_stream = thorin::object::write::StreamingBuffer::new(output_stream);
package.finish()?.emit(&mut output_stream)?;
output_stream.result()?;
output_stream.into_inner().flush()?;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_target/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ tracing = "0.1"
# tidy-alphabetical-start
default-features = false
features = ["elf", "macho"]
version = "0.32.0"
version = "0.35.0"
# tidy-alphabetical-end
Loading