Skip to content

Build the static world with -fcf-protection=none - #13

Open
buyemune-sys wants to merge 2 commits into
pg83:mainfrom
buyemune-sys:fix/gcc-default-cet
Open

buyemune-sys wants to merge 2 commits into
pg83:mainfrom
buyemune-sys:fix/gcc-default-cet

Conversation

@buyemune-sys

@buyemune-sys buyemune-sys commented Oct 17, 2026 •

Copy link
Copy Markdown

The problem

On Ubuntu with the system GCC, ./build fails:

FAIL $(B)/obj/solo_libunwind/ext/llvm/libunwind/src/UnwindRegistersSave.S.o
ext/llvm/libunwind/src/assembly.h:19:10: fatal error: cet.h: No such file or directory

Ubuntu's GCC enables -fcf-protection by default and defines __CET__. libunwind's assembly.h then includes <cet.h>, a header of the compiler itself, which the static world's -nostdinc cannot reach.

CI never hits this combination: on Ubuntu, solo is built with clang, and the GCC jobs run on Alpine and Fedora, where CET is off by default.

The fix

  • -fcf-protection=none is added to target_flags (build.py), i.e. only for the vendored targets. musl carries no CET markers, so the static world never ran with IBT or shadow stacks anyway.
  • The Ubuntu / Clang job gains a GCC step (CC=gcc ./build solo): g++ is already installed there, and nothing else builds with Ubuntu's system GCC.

Verification

  • main: the error above (Ubuntu, GCC 15);
  • with the fix: ./build solo and ./build test pass without CFLAGS.

Workaround until this is merged: CFLAGS=-fcf-protection=none CXXFLAGS=-fcf-protection=none ./build.

buyemune-sys and others added 2 commits October 20, 2026 15:42
Security updates replaced libapparmor1 4.0.1really4.0.1-0ubuntu0.24.04.7
with .9 and libexpat1 2.6.1-2ubuntu0.4 with ubuntu0.6, and the pool kept
only the new files, so the cold-cache Fetch x86_64 job answers 404 and
every x86-64 job behind it is skipped. Both pins move to the versions
noble-updates ships now; their SHA256s match the archive's Packages index.
The other twelve pins are still served.
Ubuntu's GCC enables -fcf-protection by default. That defines __CET__,
and libunwind's assembly then includes the compiler's <cet.h>, which the
runtime's -nostdinc cannot reach, so `./build` stops at
UnwindRegistersSave.S on a stock Ubuntu with GCC. musl carries no CET
markers, so the static world never ran with IBT or shadow stacks anyway;
switching the protection off for the vendored targets only changes what
the compiler is allowed to assume.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant