Skip to content

Commit

Permalink
libsel4vm: Force optimisation level for release
Browse files Browse the repository at this point in the history
As the comment in the file explains, optimisation level -O3 on gcc 8.4
is too aggressive and causes issues for the guest VM. The problem isn't
limited to a single function or group of functions but rather the entire
file for some reason that requires extra investigation (but is not worth
the time to do so).

Signed-off-by: Damon Lee <[email protected]>
  • Loading branch information
Damon Lee authored and Damon Lee committed Apr 9, 2021
1 parent adf3588 commit 0f9286d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions libsel4vm/src/arch/x86/guest_x86_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
* SPDX-License-Identifier: BSD-2-Clause
*/

/* Under release mode, this file will get built using -O3. Howerver on gcc 8.4,
* the -O3 optimisation level is too aggressive and causes issues for the guest
* VM. Hence, instead of using -O3 we use -O2 to avoid the issue. */
#ifdef NDEBUG
#pragma GCC optimize ("O2")
#endif

#include <sel4/sel4.h>

#include <sel4vm/guest_vm.h>
Expand Down

0 comments on commit 0f9286d

Please sign in to comment.