1 2 3 4 5 6 7 8 9 10 11 12 13 14
#include "stdlib.h" void abort() { /* * On gcc, a 'while(true) {}' will infinitely loop * but clang will optimize it away on -O2 if it's empty * therefore, add no-op */ asm volatile("cli"); while (true) asm volatile("hlt"); __builtin_unreachable(); }