Re: configure can't detect proper pthread flags - Mailing list pgsql-hackers

From Tom Lane
Subject Re: configure can't detect proper pthread flags
Date
Msg-id 9101.1426820918@sss.pgh.pa.us
Whole thread Raw
In response to Re: configure can't detect proper pthread flags  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Responses Re: configure can't detect proper pthread flags
List pgsql-hackers
Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> "Max" == Max Filippov <jcmvbkbc@gmail.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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: ERRCODE_T_R_DEADLOCK_DETECTED
Next
From: Bruce Momjian
Date:
Subject: Re: Patch: Add launchd Support