Fil-C

Memory SafetyC/C++ CompatibilityModern Tooling

Pizfix: The Original Fil-C Staging Area

Fil-C is fanatically compatible with C/C++ at the source level, but not compatible at all at the ABI level. This means that:

Fil-C requires its own separate slice of headers, libraries, and executables. This document describes the simplest approach, called the Pizfix, which makes it easy to have a self-contained installation of Fil-C headers and libraries without requiring root privileges.

Two alternatives to the Pizfix are /opt/fil and the Pizlix Linux distribution.

The Pizfix Slice

When you install Fil-C the "pizfix" way, either from source or from binary, you will get relevant libraries, binaries, and headers in two places, assuming you unpacked Fil-C in the fil-c directory:

This allows for users to easily set up a Fil-C slice anywhere on their Linux machine, and the Fil-C compiler and loader both search for headers and libraries in the pizfix. The compiler knows to do this by finding the pizfix relative to the location of its own binary. The clang driver is just doing this logic:

  1. Observe that the clang binary is at filc/build/bin/clang.

  2. Locate clang's own headers in filc/build/bin/../lib/clang/20/include.

  3. Locate the pizfix at filc/build/bin/../../pizfix.

  4. Locate the headers in filc/build/bin/../../pizfix/include, filc/build/bin/../../pizfix/stdfil-include, and filc/build/bin/../../pizfix/os-include.

  5. Locate the libraries in filc/build/bin/../../pizfix/lib.

When installing additional libraries and software, it's easiest to tell the build system that --prefix=fil-c/pizfix - i.e. put all software in the pizfix staging area. Additionally, it's useful to build pkgconf and put it in the pizfix and then run all build systems with PATH=fil-c/pizfix/bin:$PATH so that various packages in the pizfix are able to find one another the "pkg" way.

Currently, the Fil-C clang will only pull this trick if it locates the pizfix. Otherwise, it will look for headers and libraries the normal Linux way (i.e. /usr/include, /lib, and /usr/lib). In other words, Fil-C is already set up to support being used as the primary slice of a Linux distribution with a Fil-C userland.