Re: configure can't detect proper pthread flags

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>
Cc: Max Filippov <jcmvbkbc(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-hackers(at)postgresql(dot)org, Peter Seiderer <ps(dot)report(at)gmx(dot)net>
Subject: Re: configure can't detect proper pthread flags
Date: 2015-03-20 03:08:38
Message-ID: 9101.1426820918@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk> writes:
> "Max" == Max Filippov <jcmvbkbc(at)gmail(dot)com> writes:
> Max> Sorry, I must be not clear enough: why checking compiler/linker
> Max> output instead of checking their exit code or presence of produced
> Max> object/ executable files?

> Going by the comment some lines above, my guess would be "because some
> compilers accept some option like -pthreads and issue a warning message
> saying that it is ignored, and pg wants to not treat such options as
> valid"

Precisely. We don't want every link step producing a useless warning.
Ideally, "make -s" would print nothing whatsoever; to the extent that
tools produce unsuppressable routine chatter, that's evil because it
makes it harder to notice actually-useful warnings.

(My current ambition in this area is to shut up clang from complaining
like so:
clang: warning: argument unused during compilation: '-pthread'
clang: warning: argument unused during compilation: '-pthread'
clang: warning: argument unused during compilation: '-pthread'
clang: warning: argument unused during compilation: '-pthread'
clang: warning: argument unused during compilation: '-pthread'
which is another bit of entirely useless pedantry, but rather hard to work
around because we assume that CFLAGS should be included when linking.)

It's tempting to consider avoiding Max's problem by doing the ACX_PTHREAD
test before picking up any other libraries. But I'm worried that that
would cause more problems than it solves. It's worth noting that the
Autoconf documentation specifically recommends testing for libraries
before testing for compiler characteristics.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2015-03-20 03:11:40 Re: Performance improvement for joins where outer side is unique
Previous Message Tom Lane 2015-03-20 02:47:40 Re: ERRCODE_T_R_DEADLOCK_DETECTED