Use the sym operator for inline assembly (#5459)
* Use the `sym` operator for inline assembly Avoids extra `#[no_mangle]` functions and undue symbols being exposed from Wasmtime. This is a newly stabilized feature in Rust 1.66.0. I've also added a `rust-version` entry to the `wasmtime` crate to try to head off possible reports in the future about odd error messages or usage of unstable features if the rustc version is too old. * Fix a s390x warning * Add `rust-version` annotation to Wasmtime crate As the other main entrypoint for embedders.
This commit is contained in:
@@ -104,7 +104,12 @@ pub mod trampolines {
|
||||
// This will delegate to the outer module to the actual
|
||||
// implementation and automatically perform `catch_unwind` along
|
||||
// with conversion of the return value in the face of traps.
|
||||
#[no_mangle]
|
||||
//
|
||||
// Note that rust targets which support `global_asm!` can use
|
||||
// the `sym` operator to get the symbol here, but other targets
|
||||
// like s390x need to use outlined assembly files which requires
|
||||
// `no_mangle`.
|
||||
#[cfg_attr(target_arch = "s390x", no_mangle)]
|
||||
unsafe extern "C" fn [<impl_ $name>](
|
||||
vmctx : *mut VMContext,
|
||||
$( $pname : libcall!(@ty $param), )*
|
||||
|
||||
Reference in New Issue
Block a user