Skip to content
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
8 changes: 3 additions & 5 deletions compiler/rustc_codegen_ssa/src/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2212,7 +2212,9 @@ fn add_local_native_libraries(
NativeLibKind::Dylib { as_needed } => {
cmd.link_dylib(name, verbatim, as_needed.unwrap_or(true))
}
NativeLibKind::Unspecified => cmd.link_dylib(name, verbatim, true),
NativeLibKind::RawDylib | NativeLibKind::Unspecified => {
cmd.link_dylib(name, verbatim, true)
}
NativeLibKind::Framework { as_needed } => {
cmd.link_framework(name, as_needed.unwrap_or(true))
}
Expand All @@ -2233,10 +2235,6 @@ fn add_local_native_libraries(
cmd.link_staticlib(name, verbatim)
}
}
NativeLibKind::RawDylib => {
// FIXME(#58713): Proper handling for raw dylibs.
bug!("raw_dylib feature not yet implemented");
}
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/test/run-make/raw-dylib-c/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ else
endif
$(RUSTC) --crate-type lib --crate-name raw_dylib_test lib.rs
$(RUSTC) --crate-type bin driver.rs -L "$(TMPDIR)"
$(RUSTC) --crate-type bin --crate-name raw_dylib_test_bin lib.rs
"$(TMPDIR)"/driver > "$(TMPDIR)"/output.txt
"$(TMPDIR)"/raw_dylib_test_bin > "$(TMPDIR)"/output_bin.txt

ifdef RUSTC_BLESS_TEST
cp "$(TMPDIR)"/output.txt output.txt
else
$(DIFF) output.txt "$(TMPDIR)"/output.txt
$(DIFF) output.txt "$(TMPDIR)"/output_bin.txt
endif
4 changes: 4 additions & 0 deletions src/test/run-make/raw-dylib-c/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,7 @@ pub fn library_function() {
extern_fn_3();
}
}

fn main() {
library_function();
}