-
Notifications
You must be signed in to change notification settings - Fork 0
Native Executables
madc can generate standalone native Linux ELF executables from your programs.
madc -o program program.mad
./programThe output is a real native binary — no runtime dependency on madc.
When you pass -o, madc compiles your program to native machine code (just like JIT mode) but writes the result directly as an ELF executable instead of running it in-process — no external assembler or linker involved. The same MIR backend generates the code for both modes; native artifacts are position-independent and support -g DWARF debug info for gdb.
madc -o myapp myapp.madAll #included files are compiled together into a single binary.
The native executable lane is kept in sync with JIT mode. Both modes pass the same integration test suite (287/287 as of the latest build). When a test passes in JIT, it should also pass as a native executable.
Native executables link against libmadc.so for runtime support (string operations, namespace functions, etc.). To run the executable:
sudo make -C src install-libmadc # install libmadc.so to /usr/local/lib
LD_LIBRARY_PATH=/usr/local/lib ./program- CLI Reference — all command-line flags
- Embedding Guide — using madc as a library
- ← Back to Home