BUG #7816: test for compiler output produces bogus results

From: seebs(at)seebs(dot)net
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #7816: test for compiler output produces bogus results
Date: 2013-01-20 05:26:47
Message-ID: E1TwnQd-0006iq-Sk@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 7816
Logged by: Peter Seebach
Email address: seebs(at)seebs(dot)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...

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Magnus Hagander 2013-01-20 10:26:19 Re: BUG #7809: Running pg_dump on slave w/ streaming replication fails if there are unlogged tables
Previous Message wln 2013-01-20 03:38:57