We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b4ae88a commit 65c840dCopy full SHA for 65c840d
src/archive_writer.rs
@@ -408,12 +408,17 @@ fn write_symbols(
408
has_object: &mut bool,
409
) -> io::Result<Vec<u64>> {
410
let mut ret = vec![];
411
- *has_object = get_symbols(buf, &mut |sym| {
+ // We only set has_object if get_symbols determines it's looking at an
412
+ // object file. This is because if we're creating an rlib, the archive will
413
+ // always end in lib.rmeta, and cause has_object to always become false.
414
+ if get_symbols(buf, &mut |sym| {
415
ret.push(sym_names.stream_position()?);
416
sym_names.write_all(sym)?;
417
sym_names.write_all(&[0])?;
418
Ok(())
- })?;
419
+ })? == true {
420
+ *has_object = true;
421
+ }
422
Ok(ret)
423
}
424
0 commit comments