From 474d0f58f5f7c788f75798504173d653f4371b0a Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Sat, 28 Aug 2021 17:40:32 -0500 Subject: Add support for the RISC-V architecture Supports RV64GC (RISC-V 64-bit with general-purpose and compressed-instruction extensions) --- platform/linuxbsd/detect.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'platform/linuxbsd') diff --git a/platform/linuxbsd/detect.py b/platform/linuxbsd/detect.py index 1b9dd1e8f3..4b3804d049 100644 --- a/platform/linuxbsd/detect.py +++ b/platform/linuxbsd/detect.py @@ -119,6 +119,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"]): -- cgit v1.2.3