On Tue, Jul 13 2021, Matthieu Herrb <matth...@openbsd.org> wrote: > Hi, > > This patch adds riscv64 support to postgresql and postgresql-previous. > copied from FreeBSD ports. > > ok ?
Your patch *looks* fine from a quick glance, it's the same patch that has been proposed upstream earlier. But at least Tom Lane (long time postgres developer) wasn't keen on reusing gcc-style intrinsics. First report in 2016: https://www.postgresql.org/message-id/flat/20161119230312.ga8...@redhat.com Same thread, patch similar to yours: https://www.postgresql.org/message-id/20161120150905.GO11243%40redhat.com More recent thread, upstream doesn't seem to reach a conclusion: https://www.postgresql.org/message-id/20191019102234.s7utdy44npjqr7in%40alap3.anarazel.de https://www.postgresql.org/message-id/16913.1571545387%40sss.pgh.pa.us https://www.postgresql.org/message-id/CA%2BhUKGKnXHpROE%2Bm-Qw006V77Yo9NfTKAW2B-xn7XmDiRwmUZQ%40mail.gmail.com Your patch is not sufficient since I already committed a workaround for the lack of spinlock implementation earlier today. You'd want the additional diff below (untested). I have no strong opinion regarding the approach we should take. Index: databases/postgresql-previous/Makefile =================================================================== RCS file: /d/cvs/ports/databases/postgresql-previous/Makefile,v retrieving revision 1.16 diff -u -p -r1.16 Makefile --- databases/postgresql-previous/Makefile 12 Jul 2021 07:44:06 -0000 1.16 +++ databases/postgresql-previous/Makefile 12 Jul 2021 23:40:14 -0000 @@ -3,6 +3,7 @@ COMMENT= PostgreSQL RDBMS (previous version, for pg_upgrade) VERSION= 12.7 +REVIVION= 0 DISTNAME= postgresql-${VERSION} PKGNAME= postgresql-previous-${VERSION} @@ -62,7 +63,7 @@ CONFIGURE_ARGS= --with-openssl=/usr \ # a system to get this working, disable them for now. There is # (apparently) a serious performance hit doing this. -.if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "hppa" || ${MACHINE_ARCH} == "riscv64" +.if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "hppa" CONFIGURE_ARGS+=--disable-spinlocks .endif Index: databases/postgresql/Makefile =================================================================== RCS file: /d/cvs/ports/databases/postgresql/Makefile,v retrieving revision 1.274 diff -u -p -r1.274 Makefile --- databases/postgresql/Makefile 11 Jul 2021 23:05:06 -0000 1.274 +++ databases/postgresql/Makefile 12 Jul 2021 23:40:26 -0000 @@ -9,7 +9,7 @@ COMMENT-pg_upgrade=Support for upgrading VERSION= 13.3 PREV_MAJOR= 12 -REVISION= 0 +REVISION= 1 DISTNAME= postgresql-${VERSION} PKGNAME-main= postgresql-client-${VERSION} PKGNAME-server= postgresql-server-${VERSION} @@ -77,7 +77,7 @@ CONFIGURE_ARGS= --disable-rpath \ # a system to get this working, disable them for now. There is # (apparently) a serious performance hit doing this. -.if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "hppa" || ${MACHINE_ARCH} == "riscv64" +.if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "hppa" CONFIGURE_ARGS+= --disable-spinlocks .endif -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE