mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-21 16:51:33 +00:00
Fix compatibility with LLD
Ensure the runtime library is always at least linked as it has important symbols that we'll use later.
This commit is contained in:
@ -249,6 +249,7 @@ fn bindgen_export(export: &ast::Export, into: &mut Tokens) {
|
|||||||
#[export_name = #export_name]
|
#[export_name = #export_name]
|
||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
pub extern fn #generated_name(#(#args),*) #ret_ty {
|
pub extern fn #generated_name(#(#args),*) #ret_ty {
|
||||||
|
::wasm_bindgen::__rt::link_this_library();
|
||||||
#(#arg_conversions)*
|
#(#arg_conversions)*
|
||||||
let #ret = #receiver(#(#converted_arguments),*);
|
let #ret = #receiver(#(#converted_arguments),*);
|
||||||
#convert_ret
|
#convert_ret
|
||||||
@ -476,9 +477,10 @@ fn bindgen_import(import: &ast::Import, tokens: &mut Tokens) {
|
|||||||
quote!()
|
quote!()
|
||||||
};
|
};
|
||||||
|
|
||||||
let invocation = quote! {
|
let invocation = my_quote! {
|
||||||
#(#attrs)*
|
#(#attrs)*
|
||||||
#vis extern #fn_token #name(#me #(#arguments),*) #ret {
|
#vis extern #fn_token #name(#me #(#arguments),*) #ret {
|
||||||
|
::wasm_bindgen::__rt::link_this_library();
|
||||||
extern {
|
extern {
|
||||||
fn #import_name(#(#abi_arguments),*) -> #abi_ret;
|
fn #import_name(#(#abi_arguments),*) -> #abi_ret;
|
||||||
}
|
}
|
||||||
|
@ -435,4 +435,6 @@ pub mod __rt {
|
|||||||
pub unsafe extern fn __wbindgen_boxed_str_free(ptr: *mut String) {
|
pub unsafe extern fn __wbindgen_boxed_str_free(ptr: *mut String) {
|
||||||
drop(Box::from_raw(ptr));
|
drop(Box::from_raw(ptr));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn link_this_library() {}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user