Re: Compile error while building postgresql 10.3

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Terry Phelps <tgphelps50(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Compile error while building postgresql 10.3
Date: 2018-03-19 19:54:51
Message-ID: 20180319195451.vxymrucrnxwpbzw3@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

On 2018-03-19 15:50:10 -0400, Tom Lane wrote:
> [ please keep the list cc'd ]
>
> Terry Phelps <tgphelps50(at)gmail(dot)com> writes:
> > I can barely read a configure.in file, but here's what I think you're
> > asking for. If not, I'll try again:
>
> > configure:15453: checking for _mm_crc32_u8 and _mm_crc32_u32 with
> > CFLAGS=-msse4.2
> > configure:15475: cc -o conftest -Wall -Wmissing-prototypes -Wpointer-arith
> > -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute
> > -Wformat-security -fno-strict-aliasing -fwrapv
> > -Wno-unused-command-line-argument -I/usr/local/include -msse4.2
> > -L/usr/local/lib conftest.c -lz -lreadline -lcrypt -lm >&5
> > configure:15475: $? = 0
> > configure:15484: result: yes
>
> Interesting. So it looks like configure *did* decide that -msse4.2
> is needed. What do you get from "grep sse4 src/Makefile.global" ?
> What I'd expect is
>
> CFLAGS_SSE42 = -msse4.2
> PG_CRC32C_OBJS = pg_crc32c_sse42.o pg_crc32c_sb8.o pg_crc32c_choose.o
>
> If you see that, then the next question is why CFLAGS_SSE42 isn't
> getting propagated into the build of pg_crc32c_sse42.o, which would
> seem to suggest a problem with gmake. What make version are you
> using?

There seems to be something sketchy afoot here, even outside of
CFLAGS_SSE42 itself. From the original email:

cc -I/usr/local/include -I../../src/port -DFRONTEND -I../../src/include
-c -o pg_crc32c_sse42.o pg_crc32c_sse42.c

isn't this missing a number of important flags? Like at least
-fno-strict-aliasing -fwrapv -fexcess-precision=standard?

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Terry Phelps 2018-03-19 19:57:57 Re: Compile error while building postgresql 10.3
Previous Message Tom Lane 2018-03-19 19:50:10 Re: Compile error while building postgresql 10.3

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-03-19 19:56:47 Re: found xmin from before relfrozenxid on pg_catalog.pg_authid
Previous Message Jeremy Finzel 2018-03-19 19:53:58 Re: found xmin from before relfrozenxid on pg_catalog.pg_authid