Understand how Minimus implements OpenSSF hardening recommendations for compiling packages dependent on GCC and Clang
-Wall -Wformat
-fstack-clash-protection -fstack-protector-strong -Wl
. For the full list, refer to the OpenSSF guide.-fhardened
is used for GCC v14.0.0 or newer to enable a pre-determined set of hardening options in GCC.-fno-delete-null-pointer-checks -fno-strict-overflow -fno-strict-aliasing -ftrivial-auto-var-init=zero
.-Werror=implicit -Werror=incompatible-pointer-types -Werror=int-conversion
.fcf-protection=full
is used for x86_64 builds and -mbranch-protection=standard
is used for amd64.-fstack-protector-strong
and -fcf-protection=full flags
to mitigate against stack-based buffer overflow vulnerabilities and prevent attackers from running malicious code.-D_FORTIFY_SOURCE=3
is used to protect against unsafe memory usage.-fstack-clash-protection
enables runtime checks for variable-size stack allocation validity to prevent stack clash attacks and stack pointer manipulation, where attackers overwrite adjacent memory regions such as the heap, memory-mapped files, or guard pages.-fstack-protector-strong
, -fstack-protector-all
, and -fstack-protector --param=ssp-buffer-size=<n>
enable runtime checks for stack-based buffer overflows. These flags mitigate stack smashing attacks and potential control-flow hijacking attacks that may lead to arbitrary code execution.