parent
3fbe7f0bb3
commit
b1a0abc7a6
|
@ -1959,6 +1959,14 @@ dependencies = [
|
|||
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libloading"
|
||||
version = "0.6.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "librocksdb-sys"
|
||||
version = "6.2.4"
|
||||
|
@ -4519,7 +4527,7 @@ dependencies = [
|
|||
"itertools 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libloading 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memmap 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-derive 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -6528,6 +6536,7 @@ dependencies = [
|
|||
"checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f"
|
||||
"checksum libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)" = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005"
|
||||
"checksum libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753"
|
||||
"checksum libloading 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3c4f51b790f5bdb65acb4cc94bb81d7b2ee60348a5431ac1467d390b017600b0"
|
||||
"checksum librocksdb-sys 6.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "0a0785e816e1e11e7599388a492c61ef80ddc2afc91e313e61662cce537809be"
|
||||
"checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83"
|
||||
"checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c"
|
||||
|
|
|
@ -17,7 +17,7 @@ fs_extra = "1.1.0"
|
|||
itertools = "0.9.0"
|
||||
lazy_static = "1.4.0"
|
||||
libc = "0.2.69"
|
||||
libloading = "0.5.2"
|
||||
libloading = "0.6.1"
|
||||
log = "0.4.8"
|
||||
memmap = "0.7.0"
|
||||
num-derive = { version = "0.3" }
|
||||
|
|
|
@ -81,17 +81,17 @@ impl NativeLoader {
|
|||
}
|
||||
|
||||
#[cfg(windows)]
|
||||
fn library_open(path: &PathBuf) -> std::io::Result<Library> {
|
||||
fn library_open(path: &PathBuf) -> Result<Library, libloading::Error> {
|
||||
Library::new(path)
|
||||
}
|
||||
|
||||
#[cfg(not(windows))]
|
||||
fn library_open(path: &PathBuf) -> std::io::Result<Library> {
|
||||
fn library_open(path: &PathBuf) -> Result<Library, libloading::Error> {
|
||||
// Linux tls bug can cause crash on dlclose(), workaround by never unloading
|
||||
Library::open(Some(path), libc::RTLD_NODELETE | libc::RTLD_NOW)
|
||||
}
|
||||
|
||||
fn invoke_entrypoint<T>(
|
||||
fn get_entrypoint<T>(
|
||||
name: &str,
|
||||
cache: &RwLock<HashMap<String, Symbol<T>>>,
|
||||
) -> Result<Symbol<T>, InstructionError> {
|
||||
|
@ -141,11 +141,11 @@ impl NativeLoader {
|
|||
trace!("Call native {:?}", name);
|
||||
if name.ends_with("loader_program") {
|
||||
let entrypoint =
|
||||
Self::invoke_entrypoint::<LoaderEntrypoint>(name, &self.loader_symbol_cache)?;
|
||||
Self::get_entrypoint::<LoaderEntrypoint>(name, &self.loader_symbol_cache)?;
|
||||
unsafe { entrypoint(program.unsigned_key(), params, instruction_data) }
|
||||
} else {
|
||||
let entrypoint =
|
||||
Self::invoke_entrypoint::<ProgramEntrypoint>(name, &self.program_symbol_cache)?;
|
||||
Self::get_entrypoint::<ProgramEntrypoint>(name, &self.program_symbol_cache)?;
|
||||
unsafe { entrypoint(program.unsigned_key(), params, instruction_data) }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue