From 18b1de19834c0475a012b82ce239a583da5fd8f9 Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Wed, 27 Oct 2021 13:56:38 -0500 Subject: [PATCH] [3.x] Add RISC-V to "server" platform --- platform/server/detect.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/server/detect.py b/platform/server/detect.py index 717f28bb218..191034073b8 100644 --- a/platform/server/detect.py +++ b/platform/server/detect.py @@ -80,6 +80,13 @@ def configure(env): if env["bits"] == "default": env["bits"] = "64" if is64 else "32" + if env["arch"] == "" and platform.machine() == "riscv64": + env["arch"] = "rv64" + + if env["arch"] == "rv64": + # G = General-purpose extensions, C = Compression extension (very common). + env.Append(CCFLAGS=["-march=rv64gc"]) + ## Compiler configuration if "CXX" in env and "clang" in os.path.basename(env["CXX"]):