File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,10 @@ public final class JIT {
3232 /// The underlying LLVMExecutionEngineRef backing this JIT.
3333 internal let llvm : LLVMExecutionEngineRef
3434
35+ private static var linkOnce : ( ) = {
36+ return LLVMLinkInMCJIT ( )
37+ } ( )
38+
3539 /// Creates a Just In Time compiler that will compile the code in the
3640 /// provided `Module` to the architecture of the provided `TargetMachine`,
3741 /// and execute it.
@@ -41,6 +45,8 @@ public final class JIT {
4145 /// - machine: The target machine which you're compiling for
4246 /// - throws: JITError
4347 public init ( module: Module , machine: TargetMachine ) throws {
48+ _ = JIT . linkOnce
49+
4450 var jit : LLVMExecutionEngineRef ?
4551 var error : UnsafeMutablePointer < Int8 > ?
4652 if LLVMCreateExecutionEngineForModule ( & jit, module. llvm, & error) != 0 {
You can’t perform that action at this time.
0 commit comments