Skip to content

Commit 0e64d5e

Browse files
committed
[WIP] Use a fixed rust-ar
1 parent cbb4f13 commit 0e64d5e

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ core = { version = "1.0.0", optional = true, package = 'rustc-std-workspace-core
3333

3434
[build-dependencies]
3535
cc = { optional = true, version = "1.0" }
36-
ar = { optional = true }
36+
ar = { optional = true, path = "../rust-ar" }
3737

3838
[dev-dependencies]
3939
panic-handler = { path = 'crates/panic-handler' }

build.rs

+1-13
Original file line numberDiff line numberDiff line change
@@ -504,16 +504,6 @@ mod c_system {
504504
r.to_string()
505505
}
506506

507-
// TODO: this really should be part of ar
508-
fn clone_header(h0: &ar::Header) -> ar::Header {
509-
let mut h = ar::Header::new(h0.identifier().to_vec(), h0.size());
510-
h.set_mtime(h0.mtime());
511-
h.set_uid(h0.uid());
512-
h.set_gid(h0.gid());
513-
h.set_mode(h0.mode());
514-
h
515-
}
516-
517507
fn find_library<I>(dirs: I, libname: &str) -> Result<PathBuf, Vec<String>>
518508
where
519509
I: Iterator<Item = PathBuf>
@@ -600,11 +590,9 @@ mod c_system {
600590
},
601591
}
602592
};
603-
orig.jump_to_entry(i).unwrap(); // Work around a stupid rust-ar bug
604593
let mut entry = orig.jump_to_entry(i).unwrap();
605-
let header = clone_header(entry.header());
606594
// TODO: ar really should have an append_entry to avoid the clone
607-
new.append(&header, &mut entry).unwrap();
595+
new.append(&entry.header().clone(), &mut entry).unwrap();
608596
println!("cargo:rustc-cfg={}=\"optimized-c\"", sym);
609597
}
610598

0 commit comments

Comments
 (0)