diff --git a/accel/tcg/tcg-runtime.c b/accel/tcg/tcg-runtime.c index 2f1bfc51d9..216a325c4b 100644 --- a/accel/tcg/tcg-runtime.c +++ b/accel/tcg/tcg-runtime.c @@ -37,6 +37,8 @@ //// --- Begin LibAFL code --- +#include "libafl_extras/exit.h" + #ifndef CONFIG_USER_ONLY #include "sysemu/runstate.h" @@ -49,8 +51,6 @@ #include #include -#include "libafl_extras/exit.h" - void libafl_save_qemu_snapshot(char *name, bool sync); void libafl_load_qemu_snapshot(char *name, bool sync); diff --git a/libafl_extras/exit.c b/libafl_extras/exit.c index 4008023b81..c68a888c84 100644 --- a/libafl_extras/exit.c +++ b/libafl_extras/exit.c @@ -9,12 +9,12 @@ __thread int libafl_qemu_break_asap = 0; __thread CPUState* libafl_breakpoint_cpu; __thread vaddr libafl_breakpoint_pc; -__thread static struct libafl_exit_reason last_exit_reason; +static __thread struct libafl_exit_reason last_exit_reason; #else static struct libafl_exit_reason last_exit_reason; #endif -#ifdef TARGET_ARM +#if defined(TARGET_ARM) && !defined(TARGET_AARCH64) #define THUMB_MASK(value) (value | cpu_env(libafl_breakpoint_cpu)->thumb) #else #define THUMB_MASK(value) value diff --git a/libafl_extras/meson.build b/libafl_extras/meson.build index e8d633fae8..da410afc86 100644 --- a/libafl_extras/meson.build +++ b/libafl_extras/meson.build @@ -2,5 +2,5 @@ specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files( 'syx-snapshot/device-save.c', 'syx-snapshot/syx-snapshot.c', 'syx-snapshot/channel-buffer-writeback.c', - 'exit.c', )]) +specific_ss.add(files('exit.c'))