ocaml / Zarith

The Zarith library implements arithmetic and logical operations over arbitrary-precision integers and rational numbers. The implementation, based on GMP, is very efficient.
Other
226 stars 69 forks source link

riscv support: update config.guess to latest upstream version from autotools #131

Closed avsm closed 1 year ago

avsm commented 1 year ago

I'm bootstrapping a RISC-V box at the moment, and Zarith needs this patch to successfully build. Without it, I get this error at configure time:

binary uname: found in /bin
./configure: unable to guess system type

This script, last modified 2010-09-24, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from

  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
and
  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD

If the version you run (./configure) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.

config.guess timestamp = 2010-09-24

uname -m = riscv64
uname -r = 5.15.0-starfive
uname -s = Linux
uname -v = #1 SMP Wed Dec 21 03:56:12 EST 2022

I updated the config.guess file using the latest from their repository:

wget -O config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'

And with it, linux-riscv targets are detected successfully and all the Zarith tests pass on OCaml 4.13. I've lightly tested it for regressions on macOS/Linux-arm64 without any issues.

xavierleroy commented 1 year ago

This said, I have the impression that the configure script no longer needs to determine the architecture, now that we no longer use hand-written asm files...