From 3f8de9a0ef93e7bba69dcc1dceefd59490cff2d7 Mon Sep 17 00:00:00 2001 From: Iain Sandoe Date: Thu, 3 Sep 2020 19:49:39 +0100 Subject: [PATCH] Darwin, Arm64 : Darwin should use an OS call to clear caches. The sys_icache_invalidate() function is the right one to use. The fixes issue #17 --- gcc/config/aarch64/darwin.h | 5 +++++ libgcc/config.host | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/config/aarch64/darwin.h b/gcc/config/aarch64/darwin.h index 19d9fd216f6d..60b8811fef69 100644 --- a/gcc/config/aarch64/darwin.h +++ b/gcc/config/aarch64/darwin.h @@ -217,3 +217,8 @@ along with GCC; see the file COPYING3. If not see #undef ASM_OUTPUT_DEF_FROM_DECLS +#undef CLEAR_INSN_CACHE +#define CLEAR_INSN_CACHE(beg, end) \ + extern void sys_icache_invalidate(void *start, size_t len); \ + sys_icache_invalidate ((beg), (size_t)((end)-(beg))) + diff --git a/libgcc/config.host b/libgcc/config.host index ac0415b97316..f6eb6ce36cb9 100644 --- a/libgcc/config.host +++ b/libgcc/config.host @@ -374,7 +374,6 @@ aarch64*-*-elf | aarch64*-*-rtems*) ;; aarch64*-*darwin* | arm64*-*darwin* ) extra_parts="$extra_parts crtfastmath.o" - tmake_file="${tmake_file} ${cpu_type}/t-aarch64" tmake_file="${tmake_file} ${cpu_type}/t-lse " tmake_file="${tmake_file} t-crtfm" # No soft float for now because our long double is DF not TF.