Filian: Debian packages compiled with the memory-safe Fil-C compiler
D. J. Bernstein reports that many libraries and applications work under Fil-C[1] (filcc, fil++), a memory-safe C/C++ compiler, without changes, and that the exceptions have not been hard to fix; his stated objective is to protect machines he manages by switching them to code compiled with Fil-C. In a graph of nearly 9000 microbenchmarks of Fil-C versus clang on cryptographic software, with each run pinned to 1 core on a Zen 4, code compiled with Fil-C typically takes between 1x and 4x as many cycles as the same code compiled with clang.
His project Filian[2] adapts Debian packages to Fil-C: on a Debian 13 system it downloads Fil-C, compiles it, installs it, then downloads selected Debian source packages, compiles them with Fil-C and installs them. Filnix[3] from Mikael Brockman does the same for Nix packages, and the post shows how an unprivileged user under Debian 12 with about 10GB of free disk space can download, compile and install Fil-C, then run a Fil-C-compiled Nethack. Bernstein is not distributing Filian binaries for now, but notes that users running several Debian systems with synchronized package versions can compile once and share the binary packages; some Filnix binary packages are already cached via Cachix, and packages from the Fil-C author's /opt/fil binary distribution can also be used. As a starting point on supply chain safety, he has posted a script that helps auditors see how Fil-C differs from upstream sources such as clang and glibc[4].
On his mini-PC phoenix, with a 6-core (12-thread) AMD Ryzen 5 7640HS (Zen 4) CPU and 12GB of RAM, compiling Fil-C and glibc had to be restarted a few times while the machine had only 12GB of swap; after switching to 36GB of swap everything worked with no restarts, and monitoring showed almost 19GB of swap plus 12GB of RAM in use at one point. A larger server with 128 cores and 512GB of RAM took 8 minutes for Fil-C plus 6 minutes for musl, with no restarts needed. A parallel build script went through 61 targets in 101 minutes of real time and successfully compiled 60 of them; libcap was the one that failed, and util-linux was skipped because taskset would need patching to call sched_getaffinity and sched_setaffinity as library functions rather than via syscall. Packages including bash, binutils, coreutils, curl, git, grep, openssl, perl, sqlite, vim and zsh compiled without problems, though Fil-C does not support vfork, and during a boost build it caught a safety issue in the b2 program: filc safety error: argument size mismatch (actual = 8, expected = 16).
Read the original cr.yp.toDiscussion
Discussion
The top comment points out that Bernstein is working on Filian, which would allow installing Fil-C binaries on a Debian machine alongside regular C binaries.
Sources
-
cr.yp.to
Filian, Fil-C binaries on Debian


