Re: Bug fix for glibc broke freebsd build in REL_11_STABLE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, Victor Wagner <vitus(at)wagner(dot)pp(dot)ru>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Bug fix for glibc broke freebsd build in REL_11_STABLE
Date: 2018-12-01 17:06:36
Message-ID: 19045.1543683996@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)anarazel(dot)de> writes:
> On 2018-09-04 17:51:30 -0700, Andres Freund wrote:
>> My current proposal is thus to do add a check that does
>> #if defined(__clang__) && defined(__i386__) && !defined(__SSE2_MATH__)
>> something-that-fails
>> #endif
>> in an autoconf test, and have configure complain if that
>> fails. Something roughly along the lines of
>> "Compiling PostgreSQL with clang, on 32bit x86, requires SSE2 support. Use -msse2 or use gcc."

> Here's a patch along those lines.

I've been having an off-list discussion with the submitter of bug #14913
[1], in which the percentile_disc regression test returned unexpected
results. The upshot of that is that he's using gcc 3.4.6 on x86 hardware,
and it is doing something that changes the roundoff behavior in this
line in orderedsetaggs.c:

int64 row = (int64) ceil(p * rowcount);

gcc 3.4.6 is too old to have -fexcess-precision=standard of course, but
adding -msse2 to CFLAGS fixes the problem. So it now seems to me that
we were too narrow-minded in thinking that only clang has this issue.

Looking at the buildfarm, our only extant member that is on x86, and
is not using clang, and doesn't have -fexcess-precision=standard, is
dromedary which is using Apple's old toolchain. So the fact that it
isn't showing the problem isn't very good evidence about how widespread
this issue might be with older gcc versions.

I wonder whether we shouldn't remove the clang aspect of the test
you added, ie just make it read "if on x86, you must have either
-fexcess-precision=standard or -msse2". Or should we go so far
as to have configure add -msse2 automatically?

regards, tom lane

[1] https://www.postgresql.org/message-id/20171116224401.1466.68649%40wrigleys.postgresql.org

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Dolgov 2018-12-01 17:24:47 Commitfest 2018-11
Previous Message Peter Eisentraut 2018-12-01 13:41:42 Re: pg_stat_ssl additions