Skip to content

Commit fe5cc38

Browse files
committed
Auto merge of #98989 - dpaoliello:rawdylibbin, r=michaelwoerister
Enable raw-dylib for bin crates Fixes #93842 When `raw-dylib` is used in a `bin` crate, we need to collect all of the `raw-dylib` functions, generate the import library and add that to the linker command line. I also changed the tests so that 1) the C++ dlls are created after the Rust dlls, thus there is no chance of accidentally using them in the Rust linking process and 2) disabled generating import libraries when building with MSVC.
2 parents c5528ce + fef3b3e commit fe5cc38

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/archive.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use std::path::{Path, PathBuf};
44
use rustc_codegen_ssa::back::archive::ArchiveBuilder;
55
use rustc_session::Session;
66

7-
use rustc_data_structures::temp_dir::MaybeTempDir;
87
use rustc_session::cstore::DllImport;
98

109
struct ArchiveConfig<'a> {
@@ -177,7 +176,16 @@ impl<'a> ArchiveBuilder<'a> for ArArchiveBuilder<'a> {
177176
any_members
178177
}
179178

180-
fn inject_dll_import_lib(&mut self, _lib_name: &str, _dll_imports: &[DllImport], _tmpdir: &MaybeTempDir) {
179+
fn sess(&self) -> &Session {
180+
self.config.sess
181+
}
182+
183+
fn create_dll_import_lib(
184+
_sess: &Session,
185+
_lib_name: &str,
186+
_dll_imports: &[DllImport],
187+
_tmpdir: &Path,
188+
) -> PathBuf {
181189
unimplemented!();
182190
}
183191
}

0 commit comments

Comments
 (0)