https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93509
Matheus Afonso Martins Moreira <matheus.a.m.moreira at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |matheus.a.m.moreira at gmail dot c | |om --- Comment #2 from Matheus Afonso Martins Moreira <matheus.a.m.moreira at gmail dot com> --- I also need this feature. I'm writing freestanding Linux applications which are compiled with -ffreestanding -nostdlib. I would not need to implement __stack_chk_fail if GCC could be configured to emit traps instead of calling a function. The sanitizers already have trapping modes: -fsanitize-trap[=opts] The -fsanitize-trap= option instructs the compiler to report for sanitizers mentioned in comma-separated list of opts undefined behavior using __builtin_trap rather than a libubsan library routine. The advantage of this is that the libubsan library is not needed and is not linked in, so this is usable even in freestanding environments. This feature would be the stack smashing protector equivalent.