Load the standard library
[kaleidoscope-hs.git] / Main.hs
diff --git a/Main.hs b/Main.hs
index 97407fee2fbf6ef7907f3f45a934e737fa29d593..c2fff06f82a811a3cc789fc37a3836fb70fa5d26 100644 (file)
--- a/Main.hs
+++ b/Main.hs
@@ -19,6 +19,7 @@ import LLVM.AST.Operand
 import LLVM.AST.Type as Type
 import LLVM.Context
 import LLVM.IRBuilder
+import LLVM.Linking
 import LLVM.Module
 import LLVM.OrcJIT
 import LLVM.OrcJIT.CompileLayer
@@ -38,7 +39,8 @@ data JITEnv = JITEnv
   }
 
 main :: IO ()
-main =
+main = do
+  loadLibraryPermanently (Just "stdlib.dylib")
   withContext $ \ctx -> withHostTargetMachineDefault $ \tm ->
     withExecutionSession $ \exSession ->
       withSymbolResolver exSession (SymbolResolver symResolver) $ \symResolverPtr ->