From 2ba7df2844df1f12d5b820d62c992777a6e82d50 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Mon, 1 Feb 2021 23:19:14 +0100 Subject: [PATCH] Fix illegal instruction crash on some ARM systems See https://github.com/xmrig/xmrig/issues/1916 --- src/jit_compiler_a64.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/jit_compiler_a64.cpp b/src/jit_compiler_a64.cpp index 5f6fcb3..e45774e 100644 --- a/src/jit_compiler_a64.cpp +++ b/src/jit_compiler_a64.cpp @@ -95,6 +95,10 @@ JitCompilerA64::JitCompilerA64() { memset(reg_changed_offset, 0, sizeof(reg_changed_offset)); memcpy(code, (void*) randomx_program_aarch64, CodeSize); + +#ifdef __GNUC__ + __builtin___clear_cache(reinterpret_cast(code), reinterpret_cast(code + CodeSize)); +#endif } JitCompilerA64::~JitCompilerA64()