forked from Imagelibrary/seL4
ARM/v7-a: Force -O2 compilation of idle thread
This fixes a problem with -O0 SMP builds on ARM visible as kernel data aborts whenever the idle thread executes. The idle thread receives no stack pointer. At -O2, this is fine as the wfi() call is inlined and stack operations in idle_thread are optimized out. At -O0, the stack operations remain and wfi() is not inlined, resulting in stack accesses in the idle thread that cause data aborts. Forcing -O2 behaviour was deemed the simplest solution for now. Giving the idle thread a stack would have had larger verification ramifications for what is now a fairly uncommon use case.
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#define UNUSED __attribute__((unused))
|
||||
#define USED __attribute__((used))
|
||||
#define FASTCALL __attribute__((fastcall))
|
||||
#define FORCE_O2 __attribute__((optimize("O2")))
|
||||
/** MODIFIES: */
|
||||
void __builtin_unreachable(void);
|
||||
#define UNREACHABLE() __builtin_unreachable()
|
||||
|
||||
Reference in New Issue
Block a user