From 29decdf265479e793f83779fdd5e0af38c11960e Mon Sep 17 00:00:00 2001 From: haurog <36535774+haurog@users.noreply.github.com> Date: Wed, 11 Dec 2024 10:32:15 +0100 Subject: [PATCH] Enable compiling on RISC-V CPU (#2925) --- config.nims | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config.nims b/config.nims index 28535a23cc..261dabf73a 100644 --- a/config.nims +++ b/config.nims @@ -102,6 +102,11 @@ elif defined(macosx) and defined(arm64): # Apple's Clang can't handle "-march=native" on M1: https://github.com/status-im/nimbus-eth2/issues/2758 switch("passC", "-mcpu=apple-a14") switch("passL", "-mcpu=apple-a14") +elif defined(riscv64): + # riscv64 needs specification of ISA with extensions. 'gc' is widely supported + # and seems to be the minimum extensions needed to build. + switch("passC", "-march=rv64gc") + switch("passL", "-march=rv64gc") else: switch("passC", "-march=native") switch("passL", "-march=native")