Re: configure can't detect proper pthread flags

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Max Filippov <jcmvbkbc(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(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 02:22:31
Message-ID: 20150320022231.GA6317@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Mar 20, 2015 at 05:15:51AM +0300, Max Filippov wrote:
> On Fri, Mar 20, 2015 at 5:09 AM, Bruce Momjian <bruce(at)momjian(dot)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 -fno-strict-aliasing
> >> -fwrapv -fexcess-precision=standard -D_LARGEFILE_SOURCE
> >> -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -mlongcalls
> >> -mtext-section-literals -Os -pthread -D_LARGEFILE_SOURCE
> >> -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE conftest.c
> >> -lssl -lcrypto -lz -lreadline -lrt -lcrypt -ldl -lm
> >>
> >> and if I drop irrelevant libraries from that command its stdout+stderr
> >> will probably be empty.
> >>
> >> But I was curious why this test is written *that* way.
> >
> > Threading compiles are different for every platform so the code just
> > tries everything --- we didn't anticipate that adding a useless library
> > would actually cause a failure.
>
> Sorry, I must be not clear enough: why checking compiler/linker output
> instead of checking their exit code or presence of produced object/
> executable files?

Oh, uh, I don't rember the answer to that one. I think the code is in
config/acx_pthread.m4 and I assume we are just checking using the
configure macros that are provided.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ Everyone has their own god. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2015-03-20 02:36:04 Re: ERRCODE_T_R_DEADLOCK_DETECTED
Previous Message Andrew Gierth 2015-03-20 02:20:24 Re: configure can't detect proper pthread flags