Re: [HACKERS] configure can't detect proper pthread flags

2015-07-10 Thread Heikki Linnakangas
On 07/08/2015 08:50 PM, Tom Lane wrote: Heikki Linnakangas hlinn...@iki.fi writes: The only scenario where you might now get warnings if we switch to upstream version, and didn't before, is if one of the flags makes pthreads to work, but also creates compiler warnings, while another flag later

Re: [HACKERS] configure can't detect proper pthread flags

2015-07-08 Thread Heikki Linnakangas
On 03/21/2015 01:06 AM, Max Filippov wrote: On Fri, Mar 20, 2015 at 3:43 PM, Max Filippov jcmvb...@gmail.com wrote: Ok, one more attempt: maybe instead of checking that stderr is empty we could check that stderr has changed in the presence of the option that we test? The patch:

Re: [HACKERS] configure can't detect proper pthread flags

2015-07-08 Thread Tom Lane
Heikki Linnakangas hlinn...@iki.fi writes: I suggest that we revert that work-around for that GCC bug, and stop testing the pthread flags as soon as we find one that works. OK ... Then we can also remove the test for whether the compiler produces any warnings. Don't see how that follows?

Re: [HACKERS] configure can't detect proper pthread flags

2015-07-08 Thread Heikki Linnakangas
On 07/08/2015 04:38 PM, Tom Lane wrote: Heikki Linnakangas hlinn...@iki.fi writes: I suggest that we revert that work-around for that GCC bug, and stop testing the pthread flags as soon as we find one that works. OK ... Then we can also remove the test for whether the compiler produces any

Re: [HACKERS] configure can't detect proper pthread flags

2015-07-08 Thread Tom Lane
Heikki Linnakangas hlinn...@iki.fi writes: The only scenario where you might now get warnings if we switch to upstream version, and didn't before, is if one of the flags makes pthreads to work, but also creates compiler warnings, while another flag later in the list would make it work

Re: [HACKERS] configure can't detect proper pthread flags

2015-04-30 Thread Robert Haas
On Wed, Apr 8, 2015 at 2:31 AM, Max Filippov jcmvb...@gmail.com wrote: On Sat, Mar 21, 2015 at 2:06 AM, Max Filippov jcmvb...@gmail.com wrote: On Fri, Mar 20, 2015 at 3:43 PM, Max Filippov jcmvb...@gmail.com wrote: Ok, one more attempt: maybe instead of checking that stderr is empty we could

Re: [HACKERS] configure can't detect proper pthread flags

2015-04-30 Thread Max Filippov
On Thu, Apr 30, 2015 at 3:51 PM, Robert Haas robertmh...@gmail.com wrote: On Wed, Apr 8, 2015 at 2:31 AM, Max Filippov jcmvb...@gmail.com wrote: On Sat, Mar 21, 2015 at 2:06 AM, Max Filippov jcmvb...@gmail.com wrote: On Fri, Mar 20, 2015 at 3:43 PM, Max Filippov jcmvb...@gmail.com wrote: Ok,

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-20 Thread Max Filippov
On Fri, Mar 20, 2015 at 5:20 AM, Andrew Gierth and...@tao11.riddles.org.uk wrote: Max == Max Filippov jcmvb...@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

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-20 Thread Max Filippov
On Fri, Mar 20, 2015 at 6:08 AM, Tom Lane t...@sss.pgh.pa.us wrote: 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

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-20 Thread Max Filippov
On Fri, Mar 20, 2015 at 3:43 PM, Max Filippov jcmvb...@gmail.com wrote: Ok, one more attempt: maybe instead of checking that stderr is empty we could check that stderr has changed in the presence of the option that we test? The patch:

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-20 Thread Andres Freund
Hi, On 2015-03-20 03:14:48 +0300, Max Filippov wrote: and the toolchain emits the following warning at linking step: libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead. FWIW, I think emitting such errors at link time is utterly pointless and rather annoying. I

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-20 Thread Alvaro Herrera
By the way, acx-pthread.m4 has an outdated link to upstream acx_pthread.m4. The correct link is http://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=history;f=m4/ax_pthread.m4 -- Álvaro Herrerahttp://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA,

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-20 Thread Andres Freund
On 2015-03-20 10:23:51 -0300, Alvaro Herrera wrote: Andres Freund wrote: FWIW, I think emitting such errors at link time is utterly pointless and rather annoying. I can see a point of emitting them them when compiling code that uses deprecated functions. But we quite obviously can't do

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-20 Thread Alvaro Herrera
Andres Freund wrote: On 2015-03-20 10:23:51 -0300, Alvaro Herrera wrote: Andres Freund wrote: FWIW, I think emitting such errors at link time is utterly pointless and rather annoying. I can see a point of emitting them them when compiling code that uses deprecated functions. But we

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-20 Thread Alvaro Herrera
Andres Freund wrote: Hi, On 2015-03-20 03:14:48 +0300, Max Filippov wrote: and the toolchain emits the following warning at linking step: libcrypto.so: warning: gethostbyname is obsolescent, use getnameinfo() instead. FWIW, I think emitting such errors at link time is utterly

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-20 Thread Max Filippov
On Fri, Mar 20, 2015 at 3:05 PM, Robert Haas robertmh...@gmail.com wrote: On Fri, Mar 20, 2015 at 7:01 AM, Max Filippov jcmvb...@gmail.com wrote: On Fri, Mar 20, 2015 at 6:08 AM, Tom Lane t...@sss.pgh.pa.us wrote: We don't want every link step producing a useless warning. Ideally, make -s

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-20 Thread Robert Haas
On Fri, Mar 20, 2015 at 7:01 AM, Max Filippov jcmvb...@gmail.com wrote: On Fri, Mar 20, 2015 at 6:08 AM, Tom Lane t...@sss.pgh.pa.us wrote: We don't want every link step producing a useless warning. Ideally, make -s would print nothing whatsoever; to the extent that tools produce

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-20 Thread Bruce Momjian
On Fri, Mar 20, 2015 at 08:05:48AM -0400, Robert Haas wrote: On Fri, Mar 20, 2015 at 7:01 AM, Max Filippov jcmvb...@gmail.com wrote: On Fri, Mar 20, 2015 at 6:08 AM, Tom Lane t...@sss.pgh.pa.us wrote: We don't want every link step producing a useless warning. Ideally, make -s would print

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-20 Thread Andrew Gierth
Robert == Robert Haas robertmh...@gmail.com writes: Then maybe stderr tests should grep output for a specific option, the one we're currently testing, not just any noise? Robert That sounds awfully fragile to me. It can't really be safe to Robert assume we know precisely what the warning

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-20 Thread Robert Haas
On Fri, Mar 20, 2015 at 2:51 PM, Andrew Gierth and...@tao11.riddles.org.uk wrote: Robert == Robert Haas robertmh...@gmail.com writes: Then maybe stderr tests should grep output for a specific option, the one we're currently testing, not just any noise? Robert That sounds awfully fragile

[HACKERS] configure can't detect proper pthread flags

2015-03-19 Thread Max Filippov
Hi, when PostgreSQL is cross-compiled in the Buildroot with uClibc toolchain it may not correctly detect compiler/linker flags for threading. [1] The reason is that config/acx_pthread.m4:146 uses compiler and linker stdout and stderr to make decision if acx_pthread_ok should be yes or no: if

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-19 Thread Tom Lane
Max Filippov jcmvb...@gmail.com writes: when PostgreSQL is cross-compiled in the Buildroot with uClibc toolchain it may not correctly detect compiler/linker flags for threading. [1] The reason is that config/acx_pthread.m4:146 uses compiler and linker stdout and stderr to make decision if

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-19 Thread Bruce Momjian
On Fri, Mar 20, 2015 at 04:51:55AM +0300, Max Filippov wrote: xtensa-linux-gcc -o conftest -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-19 Thread Max Filippov
On Fri, Mar 20, 2015 at 5:09 AM, Bruce Momjian br...@momjian.us wrote: On Fri, Mar 20, 2015 at 04:51:55AM +0300, Max Filippov wrote: xtensa-linux-gcc -o conftest -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-19 Thread Bruce Momjian
On Fri, Mar 20, 2015 at 05:15:51AM +0300, Max Filippov wrote: On Fri, Mar 20, 2015 at 5:09 AM, Bruce Momjian br...@momjian.us wrote: On Fri, Mar 20, 2015 at 04:51:55AM +0300, Max Filippov wrote: xtensa-linux-gcc -o conftest -Wall -Wmissing-prototypes -Wpointer-arith

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-19 Thread Andrew Gierth
Max == Max Filippov jcmvb...@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

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-19 Thread Tom Lane
Andrew Gierth and...@tao11.riddles.org.uk writes: Max == Max Filippov jcmvb...@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

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-19 Thread Andrew Gierth
if test `(eval $ac_link 21 15)` = test `(eval $ac_compile 21 15)` = ; then FWIW, I happened to run into this recently on IRC with someone having compile problems on FreeBSD (10.1); they were using some nonstandard compile flags, and configure's pthread test was breaking as a result (they

Re: [HACKERS] configure can't detect proper pthread flags

2015-03-19 Thread Max Filippov
Hi Tom, On Fri, Mar 20, 2015 at 3:50 AM, Tom Lane t...@sss.pgh.pa.us wrote: Max Filippov jcmvb...@gmail.com writes: when PostgreSQL is cross-compiled in the Buildroot with uClibc toolchain it may not correctly detect compiler/linker flags for threading. [1] The reason is that