On 12/1/25 3:36 PM, Palmer Dabbelt wrote: > Embedded users have always sort of just been on their own to sort these > sorts of things out, and fence.i been enabled/disabled between older > releases so hopefully we're safe there too. > > (There's also that outstanding __clear_cache libcall bug, where some > configurations build a libgcc with an empty __clear_cache when they > shouldn't. IIRC Jim reported it a few years ago...)
So linux.h and gnu.h both define ICACHE_FLUSH_FUNC to __riscv_flush_icache, so those targets will always emit the libcall. For targets that are non-linux and non-gnu, we'll emit an fence.i instruction if it's enabled (TARGET_ZIFENCEI). For all other targets, yes, the clear_cache pattern will expand to an empty nop. I think it's up to those special targets to determine how they want handle that. That's a separate issue than this though. Peter
