Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c8T0d-0003Pc-5b for pgsql-bugs@arkaria.postgresql.org; Sun, 20 Nov 2016 14:22:19 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1c8T0c-0004Ip-Ie for pgsql-bugs@arkaria.postgresql.org; Sun, 20 Nov 2016 14:22:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c8PUf-0006av-QS for pgsql-bugs@postgresql.org; Sun, 20 Nov 2016 10:37:05 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1c8PUX-00018o-EB for pgsql-bugs@postgresql.org; Sun, 20 Nov 2016 10:37:05 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 12E114E336; Sun, 20 Nov 2016 10:36:54 +0000 (UTC) Received: from localhost (ovpn-204-28.brq.redhat.com [10.40.204.28]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uAKAarc2026666; Sun, 20 Nov 2016 05:36:53 -0500 Date: Sun, 20 Nov 2016 10:36:52 +0000 From: "Richard W.M. Jones" To: Tom Lane Cc: pgsql-bugs@postgresql.org Subject: Re: PostgreSQL cannot be compiled on RISC-V Message-ID: <20161120103652.GN11243@redhat.com> References: <20161119230312.GA8656@redhat.com> <16690.1479611287@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <16690.1479611287@sss.pgh.pa.us> User-Agent: Mutt/1.5.20 (2009-12-10) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Sun, 20 Nov 2016 10:36:54 +0000 (UTC) X-Pg-Spam-Score: -9.8 (---------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On Sat, Nov 19, 2016 at 10:08:07PM -0500, Tom Lane wrote: > "Richard W.M. Jones" writes: > > ../../../src/include/storage/s_lock.h:890:2: error: #error PostgreSQL does not have native spinlock support on this platform. To continue the compilation, rerun configure using --disable-spinlocks. However, performance will be poor. Please report this to pgsql-bugs@postgresql.org. > > Hi Richard, > > What's a RISC-V, and can you provide some gcc assembler implementing > spinlocks for it? See commentary and code for other platforms in > src/include/storage/s_lock.h. The answer to the first question is a lot easier than the second :-) RISC-V is an open source instruction set architecture. https://riscv.org/ I'm currently compiling Fedora for RISC-V and this was the thing that stops PostgreSQL from being compiled. https://fedoraproject.org/wiki/Architectures/RISC-V I looked at the file you pointed to. I believe it should be possible to follow the ARM implementation and call __sync_lock_test_and_set (a GCC builtin). I will try this out, but note that compiling anything on RISC-V by hand is currently a very tedious process that can take many hours. - - - Yesterday I added --disable-spinlocks and built PostgreSQL again overnight, and it compiles fine but fails in the tests: https://fedorapeople.org/groups/risc-v/logs/postgresql/9.5.5-1.fc25.0.riscv64/build.log The errors mostly seem to be: ERROR: unexpected EOF on client connection with an open transaction This is *probably* because our kernel lacks networking support, but I didn't look at this in great detail yet. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/ -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs