aboutsummaryrefslogtreecommitdiffstats
path: root/executor/common_kvm_syzos.h
diff options
context:
space:
mode:
Diffstat (limited to 'executor/common_kvm_syzos.h')
-rw-r--r--executor/common_kvm_syzos.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/executor/common_kvm_syzos.h b/executor/common_kvm_syzos.h
index 5fe513ab1..923284efe 100644
--- a/executor/common_kvm_syzos.h
+++ b/executor/common_kvm_syzos.h
@@ -35,10 +35,19 @@
#define __addrspace_guest
#endif
+// Disable optimizations for a particular function.
+#if defined(__clang__)
+#define __optnone __attribute__((optnone))
+#elif defined(__GNUC__)
+#define __optnone __attribute__((optimize("O0")))
+#else
+#define __optnone
+#endif
+
// Host will map the code in this section into the guest address space.
#define GUEST_CODE __attribute__((section("guest"))) __no_stack_protector __addrspace_guest
// Start/end of the guest section.
extern char *__start_guest, *__stop_guest;
-#endif // EXECUTOR_COMMON_KVM_SYZOS_H \ No newline at end of file
+#endif // EXECUTOR_COMMON_KVM_SYZOS_H