Re: Centralised architecture detection

Thomas Munro <thomas.munro@gmail.com>

From: Thomas Munro <thomas.munro@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Greg Burd <greg@burd.me>, Dagfinn Ilmari Mannsåker <ilmari@ilmari.org>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Andres Freund <andres@anarazel.de>, Lukas Fittl <lukas@fittl.com>, John Naylor <johncnaylorls@gmail.com>, Bryan Green <dbryan.green@gmail.com>
Date: 2026-07-01T00:31:40Z
Lists: pgsql-hackers
On Wed, Jul 1, 2026 at 9:31 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> So I was wrong to guess that every riscv64 platform predefines
> __riscv64__.  Greg, could you check what predefined architecture
> symbols that compiler does supply?  I'm tempted to blindly guess
> that __riscv64 will work, but I'd rather not guess.

No riscv here, but poking around, it looks like it's supposed to be
__riscv, and then __riscv_xlen == 32 or 64, or perhaps pointer size
check?  Not like the others, but this seems to have come down from the
RISCV project.

https://lists.riscv.org/g/sig-toolchains/attachment/688/0/riscv-toolchain.pdf
https://github.com/riscv-non-isa/riscv-c-api-doc/blob/main/src/c-api.adoc

It looks like they didn't want __riscv32 and __riscv64?

https://groups.google.com/a/groups.riscv.org/g/sw-dev/c/E8EO-Fd4t3s



Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Fix CPU-identification macros for RISC-V.

  2. Clean up inconsistencies in CPU-identification macros.