Skip to content

Commit

Permalink
Fix stdlib building
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Nov 1, 2024
1 parent e1be9ca commit f02f239
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions compiler/rustc_metadata/src/locator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,11 +577,6 @@ impl<'a> CrateLocator<'a> {
) {
Ok(blob) => {
if let Some(h) = self.crate_matches(&blob, &lib) {
if blob.get_header().is_reference {
if slot.is_none() {
todo!("return error");
}
}
(h, blob)
} else {
info!("metadata mismatch");
Expand Down Expand Up @@ -656,7 +651,12 @@ impl<'a> CrateLocator<'a> {
continue;
}
}

if !metadata.get_header().is_reference {
// FIXME nicer error when only an rlib or dylib with is_reference is found
// and no .rmeta?
*slot = Some((hash, metadata, lib.clone()));
}
ret = Some((lib, kind));
}

Expand Down Expand Up @@ -747,6 +747,7 @@ impl<'a> CrateLocator<'a> {
let dll_prefix = self.target.dll_prefix.as_ref();
let dll_suffix = self.target.dll_suffix.as_ref();
if file.starts_with(dll_prefix) && file.ends_with(dll_suffix) {
rmetas.insert(loc_canon.with_extension("rmeta"), PathKind::ExternFlag);
return Some(dylibs);
}
None
Expand Down

0 comments on commit f02f239

Please sign in to comment.