Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ey0TJ-00024F-VA for pgsql-admin@arkaria.postgresql.org; Mon, 19 Mar 2018 19:29:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ey0TI-0003NW-PA for pgsql-admin@arkaria.postgresql.org; Mon, 19 Mar 2018 19:29:28 +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.89) (envelope-from ) id 1ey0TI-0003NJ-Hk; Mon, 19 Mar 2018 19:29:28 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ey0TA-0006le-VI; Mon, 19 Mar 2018 19:29:28 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w2JJT6Rs013507; Mon, 19 Mar 2018 15:29:06 -0400 From: Tom Lane To: Terry Phelps cc: pgsql-hackers@lists.postgresql.org, Heikki Linnakangas , pgsql-admin@lists.postgresql.org Subject: Re: Compile error while building postgresql 10.3 In-reply-to: References: Comments: In-reply-to Terry Phelps message dated "Mon, 19 Mar 2018 15:10:35 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <13505.1521487746.1@sss.pgh.pa.us> Date: Mon, 19 Mar 2018 15:29:06 -0400 Message-ID: <13506.1521487746@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Terry Phelps writes: > Just for fun, I am trying to build postgres from source on FreeBSD 11. Yes, > I know I don't need to, and I have already installed the 10.3 server and > client packages, and they run fine. I did a 'git clone' today, and have > hours-old source code. FWIW, development-code issues generally belong on -hackers, so forwarding this there. > So, I install the prereqs, and did a 'configure' and 'make', and expected > it to 'just work'. However, I get this compile error: > cc -I/usr/local/include -I../../src/port -DFRONTEND -I../../src/include > -c -o pg_crc32c_sse42.o pg_crc32c_sse42.c > pg_crc32c_sse42.c:37:18: error: always_inline function '_mm_crc32_u64' > requires > target feature 'ssse3', but would be inlined into function > 'pg_comp_crc32c_sse42' that is compiled without support for 'ssse3' > crc = (uint32) _mm_crc32_u64(crc, *((const uint64 *) p)); > ^ > pg_crc32c_sse42.c:44:9: error: always_inline function '_mm_crc32_u32' > requires > target feature 'ssse3', but would be inlined into function > 'pg_comp_crc32c_sse42' that is compiled without support for 'ssse3' > crc = _mm_crc32_u32(crc, *((const unsigned int *) p)); > ^ > pg_crc32c_sse42.c:63:9: error: always_inline function '_mm_crc32_u8' > requires > target feature 'ssse3', but would be inlined into function > 'pg_comp_crc32c_sse42' that is compiled without support for 'ssse3' > crc = _mm_crc32_u8(crc, *p); > ^ > 3 errors generated. > > I googled, and search the archives, and don't see anything applicable. My C > compiler is: > $ cc --version > FreeBSD clang version 4.0.0 (tags/RELEASE_400/final 297347) (based on LLVM > 4.0.0) > Target: x86_64-unknown-freebsd11.1 > Thread model: posix Huh. Apparently that compiler is stricter about the use of "ssse3" than anything we've tested this code on before. It's interesting that your "cc" line for pg_crc32c_sse42.c shows no sign of any added options for SSE4.2 compiler intrinsics, which seems to be what's needed here. The configure script is supposed to detect whether such options are needed, but it looks like it failed to do so correctly. Can you look into config.log and see what happened corresponding to this bit of configure.in? # Check for Intel SSE 4.2 intrinsics to do CRC calculations. # # First check if the _mm_crc32_u8 and _mm_crc32_u64 intrinsics can be used # with the default compiler flags. If not, check if adding the -msse4.2 # flag helps. CFLAGS_SSE42 is set to -msse4.2 if that's required. PGAC_SSE42_CRC32_INTRINSICS([]) if test x"$pgac_sse42_crc32_intrinsics" != x"yes"; then PGAC_SSE42_CRC32_INTRINSICS([-msse4.2]) fi AC_SUBST(CFLAGS_SSE42) regards, tom lane