From d19876e0e451d7531566583d2f25c5c9381f64f1 Mon Sep 17 00:00:00 2001 From: "W. J. van der Laan" Date: Sat, 3 Apr 2021 21:26:03 +0000 Subject: [PATCH] mes: Add RISC-V architecture detection. * src/mes.c: Add ifdefs to detect when compiled on riscv32 or riscv64 architectures. --- src/mes.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mes.c b/src/mes.c index 86699ba5..d0b507a1 100644 --- a/src/mes.c +++ b/src/mes.c @@ -1,6 +1,7 @@ /* -*-comment-start: "//";comment-end:""-*- * GNU Mes --- Maxwell Equations of Software * Copyright © 2016,2017,2018,2019,2020,2021 Jan (janneke) Nieuwenhuizen + * Copyright © 2021 W. J. van der Laan * * This file is part of GNU Mes. * @@ -59,6 +60,14 @@ mes_environment (int argc, char **argv) arch = "arm"; #elif __x86_64__ arch = "x86_64"; +#elif __riscv + #if __riscv_xlen == 32 + arch = "riscv32"; + #elif __riscv_xlen == 64 + arch = "riscv64"; + #else + #error riscv xlen not supported + #endif #else #error arch not supported #endif