Set the DLL storage class to export.

This commit is contained in:
Nick Lewycky
2020-08-17 23:22:27 -07:00
parent 9e89ee9b7b
commit 36850d6230
2 changed files with 15 additions and 0 deletions

View File

@@ -66,6 +66,12 @@ impl FuncTrampoline {
trampoline_func
.as_global_value()
.set_section(FUNCTION_SECTION);
trampoline_func
.as_global_value()
.set_linkage(Linkage::DLLExport);
trampoline_func
.as_global_value()
.set_dll_storage_class(inkwell::DLLStorageClass::Export);
generate_trampoline(trampoline_func, ty, &callee_attrs, &self.ctx, &intrinsics)?;
if let Some(ref callbacks) = config.callbacks {
@@ -182,6 +188,12 @@ impl FuncTrampoline {
trampoline_func
.as_global_value()
.set_section(FUNCTION_SECTION);
trampoline_func
.as_global_value()
.set_linkage(Linkage::DLLExport);
trampoline_func
.as_global_value()
.set_dll_storage_class(inkwell::DLLStorageClass::Export);
generate_dynamic_trampoline(trampoline_func, ty, &self.ctx, &intrinsics)?;
if let Some(ref callbacks) = config.callbacks {