Prevent trampoline entrypoints from being stripped out during LTO (#5773)
This works around a `rustc` bug where compiling with LTO will sometimes strip out some of the trampoline entrypoint symbols resulting in a linking failure.
This commit is contained in:
@@ -122,6 +122,17 @@ pub mod trampolines {
|
||||
Err(panic) => crate::traphandlers::resume_panic(panic),
|
||||
}
|
||||
}
|
||||
|
||||
// This works around a `rustc` bug where compiling with LTO
|
||||
// will sometimes strip out some of these symbols resulting
|
||||
// in a linking failure.
|
||||
#[allow(non_upper_case_globals)]
|
||||
#[used]
|
||||
static [<impl_ $name _ref>]: unsafe extern "C" fn(
|
||||
*mut VMContext,
|
||||
$( $pname : libcall!(@ty $param), )*
|
||||
) $( -> libcall!(@ty $result))? = [<impl_ $name>];
|
||||
|
||||
)*
|
||||
}};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user