Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tsvzz-006v5c-Jx for pgsql-bugs@arkaria.postgresql.org; Fri, 14 Mar 2025 03:46:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tsvzx-00DqEi-V2 for pgsql-bugs@arkaria.postgresql.org; Fri, 14 Mar 2025 03:46:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tsvzx-00DqCf-Lz for pgsql-bugs@lists.postgresql.org; Fri, 14 Mar 2025 03:46:13 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tsvzv-002jAQ-1W for pgsql-bugs@lists.postgresql.org; Fri, 14 Mar 2025 03:46:12 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 52E3kAW82974261; Thu, 13 Mar 2025 23:46:10 -0400 From: Tom Lane To: Mathew Heard cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18839: ARMv7 builds fail due to missing __crc32cw and similar In-reply-to: References: <2953389.1741911582@sss.pgh.pa.us> <2958437.1741914536@sss.pgh.pa.us> <2964086.1741917658@sss.pgh.pa.us> <2965436.1741918726@sss.pgh.pa.us> Comments: In-reply-to Mathew Heard message dated "Fri, 14 Mar 2025 14:12:35 +1100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2974259.1741923970.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 13 Mar 2025 23:46:10 -0400 Message-ID: <2974260.1741923970@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Mathew Heard writes: > When the configure test is running its forcing armv8-a+crc+simd (has > __crc32cb, etc) rather than testing for the feature against target > architecture (no __crc32cb, etc). While make is compiling for the target > architecture armv7ve+simd (no __crc32cb, etc). During the make it is of > course failing to find __crc32cb etc, they only existed during the > configure test due to the custom cflags used for that feature test (marc= h > armv8-a+crc+simd). No, because when pg_crc32c_armv8.c is compiled, that same -march setting is used for that one specific file -- trace through the use of CFLAGS_CRC in the Makefiles. For instance, on buildfarm member grison[1] which seems like it should be a pretty close match for your situation, the configure log shows checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=3D= ... (cached) no checking for __crc32cb, __crc32ch, __crc32cw, and __crc32cd with CFLAGS=3D= -march=3Darmv8-a+crc+simd... (cached) yes checking which CRC-32C implementation to use... ARMv8 CRC instructions wit= h runtime check and then in the build log we find ccache gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-= statement -Werror=3Dvla -Wendif-labels -Wmissing-format-attribute -Wimplic= it-fallthrough=3D3 -Wcast-function-type -Wshadow=3Dcompatible-local -Wform= at-security -fno-strict-aliasing -fwrapv -fexcess-precision=3Dstandard -Wn= o-format-truncation -Wno-stringop-truncation -g -O2 -march=3Darmv8-a+crc+s= imd -I../../src/port -DFRONTEND -I../../src/include -D_GNU_SOURCE -I/usr/= include/libxml2 -c -o pg_crc32c_armv8.o pg_crc32c_armv8.c (note the -march flag) so that's expected to compile, and does, even though the platform is armv7l in general. I have no idea whether grison's underlying hardware is v7 or v8, and it shouldn't matter for this purpose, because the only thing at stake is the build toolchain's behavior. > I'm not really sure what's so confusing about this situation. It seems l= ike > a configure feature test that will always detect CRC support on any ARM = gcc > (that supports those functions). I'm mostly surprised your arm build > environment is passing. I'm not sure how I can put this any more plainly: it works fine for everyone but you, including ARMv7 machines. I have no intention of regressing performance for everyone who runs on mixed ARMv7/v8 platforms in order to un-break your build. We need to figure out what is unusual about your build environment that is causing this mechanism not to work as-expected. regards, tom lane [1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=3Dgrison&dt=3D= 2025-03-14%2000%3A04%3A12