Build & integrate
Hook Frontera into your build.
Protect rewrite, static link, and post-link stamp are one pipeline—not optional extras.
Pipeline
- Build
libfrontera.a(and optionallylibphomo.a). - Run sources through
frontera-protect(attribute → RKVM stubs). - Link with
libfrontera.a, D runtime, and system libraries. - Run
frontera-stampon the linked binary.
cxx-frontera.sh
Preferred driver for hand-rolled builds. It rewrites each .cpp, compiles with your flags, pulls in phomo when available, and stamps -o output:
/path/to/frontera/scripts/cxx-frontera.sh g++ main.cpp \
-std=c++20 -I. -O2 ./libfrontera.a \
-L"$HOME/dlang/ldc-1.42.0/lib" -lphobos2-ldc -ldruntime-ldc \
-lpthread -ldl -lm -o myappLink requirements
| Artifact | Role |
|---|---|
libfrontera.a | Antitamper + RKVM runtime (D) |
libphomo.a | Optional eBPF ptrace watcher |
-lphobos2-ldc -ldruntime-ldc | LDC D runtime |
-lpthread -ldl -lm | System deps |
-lelf -lz | Required with phomo |
CMake
Include cmake/Frontera.cmake and use frontera_add_executable (orfrontera_protect_sources, frontera_link_target,frontera_stamp_target). From the Frontera tree:
cmake -S examples/cmake-app -B examples/cmake-app/build \
-DFRONTERA_ROOT="$(pwd)"
cmake --build examples/cmake-app/build
./examples/cmake-app/build/frontera_exampleSet FRONTERA_ROOT and, if needed, FRONTERA_LDC_LIB to your LDC library directory.
What frontera_at_start does
Whether you call it from C or a protected stub injects it:
#include "frontera_at.h"
int main(void) {
if (frontera_at_start() != FRONTERA_AT_OK)
return 1;
/* application */
return 0;
}frontera_check_self_integrity()— on-disk digest + memory baseline.frontera_vm_guard()— may hard-exit on high VM score.phomo_at_start()— soft-fail without CAP_BPF / root.
Inspect failures with frontera_at_last_error(). WithFRONTERA_HARD_ABORT (default under strong mode), C++runtime_init() may _Exit(1) on AT failure.
Platform notes
- GNU/Linux only (
/proc,/sys, Linux syscalls). - x86_64: CPUID hypervisor leaf + DMI scoring.
- AArch64: no CPUID hypervisor leaf; DMI / cpuinfo still contribute.
- phomo needs
CAP_BPF/CAP_PERFMON(or root) at runtime.