From a68ac70c470f1ceea09c324cfa1dcd8c2489f35c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Fri, 27 Aug 2021 15:16:49 +0200 Subject: [PATCH] Fix ARM64 build There is some weird issues regarding linking `__clear_cache` under `clang-cl`, therefore we just call the Windows API instead on these builds. --- src/codegen_new/codegen_allocator.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/codegen_new/codegen_allocator.c b/src/codegen_new/codegen_allocator.c index f441c2c4b..ad07afd73 100644 --- a/src/codegen_new/codegen_allocator.c +++ b/src/codegen_new/codegen_allocator.c @@ -120,7 +120,11 @@ void codegen_allocator_clean_blocks(struct mem_block_t *block) #if defined __ARM_EABI__ || defined _ARM_ || defined __aarch64__ || defined _M_ARM || defined _M_ARM64 while (1) { +#ifndef _MSC_VER __clear_cache(&mem_block_alloc[block->offset], &mem_block_alloc[block->offset + MEM_BLOCK_SIZE]); +#else + FlushInstructionCache(GetCurrentProcess(), &mem_block_alloc[block->offset], MEM_BLOCK_SIZE); +#endif if (block->next) block = &mem_blocks[block->next - 1]; else