SIGN IN SIGN UP

Add a Fil-C job to the compile workflow.

Fil-C is a memory-safe implementation of C where pointers are checked on every access, so an out-of-bounds access, a use-after-free, or a type confusion panics instead of doing damage. It found two out-of-bounds reads that gcc, clang and valgrind missed.

Linking to code that was not built with Fil-C is severely restricted, so the /opt/fil distribution is used for the libraries it ships and libxml2 and libpq are built here with the same compiler. That takes minutes and produces the same thing every time, so the prefix is pushed to a container registry rather than actions/cache, which is not branch-scoped and so is shared across the short-lived branches this project works in, as the ccache already is. It is saved before the tests run so a failing test does not stop it being cached and a failed build is never cached.

Two things have to be turned off for libpq. Its exports list names the plain symbols but Fil-C emits pizlonated_-prefixed ones, so the version script hides every entry point, and -fvisibility=hidden hides the prefixed symbols as well because they do not inherit the default visibility PGDLLEXPORT puts on the declaration.

--gcc-toolchain keeps the host gcc out of the search path so a library that was not built with Fil-C cannot be picked up, and PKG_CONFIG_LIBDIR does the same for pkg-config. It also keeps meson from finding the libbacktrace gcc ships, which matters because the Fil-C runtime does not implement _Unwind_Backtrace. TZDIR is set because the glibc in /opt/fil looks for the timezone database under its own prefix, where there is none, and falls back to UTC without saying so.

The too large allocation test is skipped since Fil-C either satisfies an allocation or treats it as a hard error, so malloc() never returns NULL. A volatile local declared without an initializer loses its value across longjmp, which is a Fil-C bug reported upstream, so that declaration is patched in the job rather than in the test.
D
David Steele committed
12396fb353bc4aa10c3739b826189e421732adf5
Parent: 35fe00e