Re: Compile error while building postgresql 10.3

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Compile error while building postgresql 10.3
Дата
Msg-id 13506.1521487746@sss.pgh.pa.us
обсуждение исходный текст
Список pgsql-hackers
Terry Phelps <tgphelps50@gmail.com> 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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Arthur Zakirov
Дата:
Сообщение: Re: [PROPOSAL] Shared Ispell dictionaries
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Compile error while building postgresql 10.3