Re: Centralised architecture detection
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Greg Burd <greg@burd.me>
Cc: Thomas Munro <thomas.munro@gmail.com>, 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-06-30T21:31:47Z
Lists: pgsql-hackers
I wrote:
> Pushed. I shall now watch the buildfarm from a safe distance.
Sure enough, greenfly is not happy:
ccache /scratch/opt/llvm-22/bin/clang -Isrc/port/libpgport_srv.a.p -Isrc/include -I../pgsql/src/include -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -O2 -g -fno-strict-aliasing -fwrapv -fexcess-precision=standard -D_GNU_SOURCE -Wpointer-arith -Werror=vla -Werror=unguarded-availability-new -Wmissing-format-attribute -Wcast-function-type -Wformat-security -Wmissing-prototypes -Wold-style-definition -Wstrict-prototypes -Wimplicit-fallthrough -Wdeclaration-after-statement -Wmissing-variable-declarations -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-format-truncation -Wno-cast-function-type-strict -march=rv64gcv -fPIC -DBUILDING_DLL -MD -MQ src/port/libpgport_srv.a.p/bsearch_arg.c.o -MF src/port/libpgport_srv.a.p/bsearch_arg.c.o.d -o src/port/libpgport_srv.a.p/bsearch_arg.c.o -c ../pgsql/src/port/bsearch_arg.c
In file included from ../pgsql/src/port/bsearch_arg.c:36:
../pgsql/src/include/c.h:162:2: error: "cannot identify target architecture"
162 | #error "cannot identify target architecture"
| ^
1 error generated.
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.
To save you having to look it up, something like this should
do the trick:
clang -dM -E - </dev/null | sort >clang-predefined-macros
regards, tom lane
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix CPU-identification macros for RISC-V.
- d3223485546e master landed
-
Clean up inconsistencies in CPU-identification macros.
- 2ef57e636fc9 master landed