Quick Start
Build System Overview
The project uses the build process of a typical statically linked C application for Linux.Build Process Flow
Compile Units
A compile unit is a set of:- C/C++ files
- Assembly files
- Embedded files (binary content included via
.incbinassembler directive)
On Linux, compile units are position-independent to support ASLR (Address Space Layout Randomization).
Machine Targets
TheMACHINE environment variable allows building for different machine configurations.
Default Machine
The default machine isnative, which auto-detects your system configuration.
The “Frankendancer” build target (fdctl) only targets x86_64 with a Haswell-like minimum feature set (AVX2, FMA).
Build Extras
TheEXTRAS environment variable enables optional build features defined in config/extra/with-*.mk.
Debug Builds
Sanitizer Builds
Sanitizers bake in various runtime checks for development and testing.Fuzzing Builds
Fuzzers can be combined with sanitizers to find bugs more effectively.Code Generation
Generated code is checked into the repository to minimize tooling dependencies.Code generation tools are only required during development. All code generation tools are written in Python 3.9.
Dependencies
System Dependencies
Firedancer depends on:- GNU C Library (glibc) - linked dynamically
- C++ standard library - linked dynamically
Out-of-tree Dependencies
Firedancer aims for zero out-of-tree library dependencies. For practicality, some large external dependencies are fetched externally. Thedeps.sh script:
- Fetches dependencies
- Builds them using their native build scripts
- Installs includes and static libraries into
opt/directory
Build Configuration
Makefile Evaluation Steps
Each time the Makefile is evaluated:Configuration Files
Build configuration is spread across:GNUmakefile- Main entry pointconfig/machine/*.mk- Machine-specific settingsconfig/extra/with-*.mk- Optional featuresconfig/everything.mk- Global build rulessrc/**/Local.mk- Per-module build rules
ABI Stability
Firedancer does not aim to be ABI-stable, with a few exceptions.Symbols may change or disappear arbitrarily between different versions of the source code.
Cross-compiler Stability
The C parts of the project try to achieve cross-compiler stability. It should be fine to link together units compiled with:- Different versions of GCC
- A mix of GCC and Clang (from the same Firedancer revision)
Stable ABI Components
Some small parts explicitly offer a stable ABI for use as a shared library:- Cross-client compatibility layer
- Differential fuzzing targets
Building on Systems with CPU Isolation
If you have kernel CPU isolation enabled (e.g.,isolcpus in the kernel command line), make will typically only use non-isolated CPUs for the build.
See the
make-j script in contrib/ for help building efficiently on systems with CPU isolation enabled.