core: Add RISC-V architecture detection.

* src/mes.c(mes_environment)[__riscv_xlen == 32]: Set
architecture to riscv32.
[__riscv_xlen == 64]: Set architecture to riscv64.

xlen
This commit is contained in:
W. J. van der Laan 2021-04-03 21:26:03 +00:00 committed by Janneke Nieuwenhuizen
parent 3267daedbf
commit 3752e735d2
1 changed files with 5 additions and 0 deletions

View File

@ -1,6 +1,7 @@
/* -*-comment-start: "//";comment-end:""-*-
* GNU Mes --- Maxwell Equations of Software
* Copyright © 2016,2017,2018,2019,2020,2021 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
* Copyright © 2021 W. J. van der Laan <laanwj@protonmail.com>
*
* This file is part of GNU Mes.
*
@ -61,6 +62,10 @@ mes_environment (int argc, char **argv)
arch = "arm";
#elif __x86_64__
arch = "x86_64";
#elif __riscv_xlen == 32
arch = "riscv32";
#elif __riscv_xlen == 64
arch = "riscv64";
#else
#error arch not supported
#endif