diff --git a/reid-llvm-lib/src/compile.rs b/reid-llvm-lib/src/compile.rs index 4aee881..1c0e6bd 100644 --- a/reid-llvm-lib/src/compile.rs +++ b/reid-llvm-lib/src/compile.rs @@ -5,7 +5,7 @@ use std::{collections::HashMap, ffi::CString, ptr::null_mut}; use llvm_sys::{ - LLVMIntPredicate, + LLVMIntPredicate, LLVMLinkage, analysis::LLVMVerifyModule, core::*, prelude::*, @@ -204,6 +204,11 @@ impl FunctionHolder { unsafe { let own_function = *module.functions.get(&self.value).unwrap(); + if self.data.flags.is_extern { + LLVMSetLinkage(own_function.value_ref, LLVMLinkage::LLVMExternalLinkage); + return; + } + for block in &self.blocks { if block.data.deleted { continue;