BUG #7816: test for compiler output produces bogus results - Mailing list pgsql-bugs

From seebs@seebs.net
Subject BUG #7816: test for compiler output produces bogus results
Date
Msg-id E1TwnQd-0006iq-Sk@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #7816: test for compiler output produces bogus results
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      7816
Logged by:          Peter Seebach
Email address:      seebs@seebs.net
PostgreSQL version: 9.1.4
Operating system:   Linux
Description:        =


Your modified acx_pthread.m4 tests for any compiler output to stderr at all,
and considers it evidence that a flag is invalid.

This test is not actually correct, although it usually works.

The reason this bit me is that I have cause to build stuff with a patched
gcc which has a check for possible licensing-related stuff (not for gcc
itself, but because gcc's in the usage path; long story), and if that fails
or can't be run, it prints a diagnostic to stderr. This is not an error, and
it does not prevent successful compilation.

But if it happens during the postgresql configure, it results in configure
deciding that -lpthread isn't available, and dying.

In general, it is Bad Mojo to assume that all messages on stderr indicate
failures. If there is an error, the compiler is expected to exit with a
non-zero exit status. If it doesn't exit non-zero, you should assume that it
worked. This is why configure doesn't normally fail tests just because there
is some message on stderr...

pgsql-bugs by date:

Previous
From: "wln"
Date:
Subject:
Next
From: George Machitidze
Date:
Subject: Re: BUG #7815: Upgrading PostgreSQL from 9.1 to 9.2 with pg_upgrade/postgreql-setup fails - invalid status retrieve