Building for InstantOS

Compile insty programs for the x86_64_instantos target.

Target InstantOS with the compiler’s x86_64_instantos target:

insty --target x86_64_instantos src/main.ins -o app

What the target produces

  • An ELF ET_DYN (PIE), EM_X86_64, entry _start.
  • Linked against InstantOS mlibc: your program provides main; the sysroot’s crt1.o provides _start and calls it.
  • PT_INTERP is /lib/mlibc/ld-instantos.so, runpath /lib/mlibc, and libc.so is NEEDED.

Under the hood the compiler drives ld.lld with -pie -e _start --dynamic-linker /lib/mlibc/ld-instantos.so -rpath /lib/mlibc --hash-style=sysv -z max-page-size=0x1000, plus <sysroot>/lib/crt1.o and -L <sysroot>/lib -lc.

Sysroot

The mlibc sysroot defaults to the InstantOS tools/build-mlibc.sh output. Override it explicitly:

insty --target x86_64_instantos --sysroot /path/to/mlibc-root src/main.ins -o app

See the general compiler reference for all flags.