Oml backend outputs LLVM bytecode files in textual .ll and binary .bc representation. The .bc file can be dynamically loaded by OmlBcLoader which uses JIT compiler.
MultiOberon build command produces object file .o, which can be dynamically loaded and executed by runtime.
MultiOberon build provides also linking abilities for creating executive.
Oml - LLVM backend for MultiOberon
-
- Posts: 68
- Joined: Wed Mar 29, 2017 3:58 pm
Re: Oml - LLVM backend for MultiOberon
Simple example demonstates howto compile HelloWorld in command line
Compilation results in .ll and .bc bytecode files
After this, the program can be executed in LLVM JIT compiler
But loading in JIT is too time-consuming.
Just compile this to object file.
After this, the object file can be loaded with all necessary fixups
If we need 64-bit, use the similar shell from Blwr directory. Blwr is 64-bit binary catalog. Blwr differs from Blwe, as RAX register differs from EAX. Compile
Build
And Run
Code: Select all
c:\suok5\Mob>Blwe\omlsh co -odc OmtestHelloWorld
oml:compiling c:\suok5\Mob/Omtest/Mod/HelloWorld.odc >c:\suok5\Mob/Omtest/Clwe/OmtestHelloWorld .ll=9742 .bc=3420
After this, the program can be executed in LLVM JIT compiler
Code: Select all
c:\suok5\Mob>Blwe\omlsh run -ext bc OmtestHelloWorld
Hello, World
Just compile this to object file.
Code: Select all
c:\suok5\Mob>Blwe\omlsh build OmtestHelloWorld
===== obj-building HostConLog ... done
===== obj-building OmtestHelloWorld ... done
Code: Select all
c:\suok5\Mob>Blwe\omlsh run OmtestHelloWorld
Hello, World
Code: Select all
c:\suok5\Mob>Blwr\omlsh co -odc OmtestHelloWorld
oml:compiling c:\suok5\Mob/Omtest/Mod/HelloWorld.odc >c:\suok5\Mob/Omtest/Clwr/OmtestHelloWorld .ll=9742 .bc=3424
Code: Select all
c:\suok5\Mob>Blwr\omlsh build OmtestHelloWorld
===== obj-building HostConLog ... done
===== obj-building OmtestHelloWorld ... done
Code: Select all
c:\suok5\Mob>Blwr\omlsh run OmtestHelloWorld
Hello, World