We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b4ae88a commit 21cbbc5Copy full SHA for 21cbbc5
src/archive_writer.rs
@@ -408,12 +408,18 @@ 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
+ {
421
+ *has_object = true;
422
+ }
423
Ok(ret)
424
}
425
0 commit comments