[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] configure: normalize riscv* cpu types too

From: Michael Tokarev
Subject: [PATCH] configure: normalize riscv* cpu types too
Date: Sat, 4 Feb 2023 14:25:02 +0300

For most CPU types out there, ./configure normalizes all
variations into base form plus, optionally, variations,
to find the proper arch-specific code.  In particular,
it's possible to use
   ./configure --cpu=$(uname -m)
and it will figure out the right base cpu family out of
that. But this does not work for riscv64 for example,
since there's no similar normalisation for that one.

For now, as far as I can see, there'no support for other
riscv "sizes" (like riscv32 which actually esists as
hardware). So for the time being, just normalize the
cpu name to be "riscv" for all riscv* variants, just
like it is done for arm and mips.  If/when support for
other riscv variants will be added, this might be
extended to distinguish them based on __LP64__ define
or __riscv_xlen==32/64/128.

Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
 configure | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/configure b/configure
index 9e407ce2e3..1deb65c95f 100755
--- a/configure
+++ b/configure
@@ -578,6 +578,9 @@ case "$cpu" in
     CPU_CFLAGS="-m64 -mlittle-endian" ;;
+  riscv*)
+    cpu="riscv" ;;
     CPU_CFLAGS="-m31" ;;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]