From 56f7b3fc8d7c4ac94b4bdbc6e26bd7edbbcefb66 Mon Sep 17 00:00:00 2001 From: Adrian Danis Date: Tue, 24 May 2016 17:01:31 +1000 Subject: [PATCH] libsel4: arm: Reintroduce -O0 warning --- .../sel4_arch_include/aarch32/sel4/sel4_arch/syscalls.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libsel4/sel4_arch_include/aarch32/sel4/sel4_arch/syscalls.h b/libsel4/sel4_arch_include/aarch32/sel4/sel4_arch/syscalls.h index ff3277bdd..2bb07f060 100644 --- a/libsel4/sel4_arch_include/aarch32/sel4/sel4_arch/syscalls.h +++ b/libsel4/sel4_arch_include/aarch32/sel4/sel4_arch/syscalls.h @@ -17,6 +17,15 @@ #define __SWINUM(x) ((x) & 0x00ffffff) +#ifndef __OPTIMIZE__ +/* With no optimisations (-O0) GCC's register allocator clobbers the + * syscall arguments before you reach the 'swi' and you invoke the kernel + * incorrectly. + * See SELFOUR-187 + */ +#warning you are compiling with -O0; syscalls will most likely not work +#endif + static inline void seL4_Send(seL4_CPtr dest, seL4_MessageInfo_t msgInfo) {