Re: V14 and later build the backend with -lpthread - Mailing list pgsql-hackers

From Andres Freund
Subject Re: V14 and later build the backend with -lpthread
Date
Msg-id 20220825213449.4xvkp3uzjj7uggmz@awork3.anarazel.de
Whole thread Raw
In response to Re: V14 and later build the backend with -lpthread  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

On 2022-08-25 17:04:37 -0400, Tom Lane wrote:
> (I'm also still struggling to explain why mamba, with the *exact*
> same NetBSD code on a different hardware platform, isn't showing
> the same failures as chickadee.  More news if I figure that out.)

I'd guess it's because of the different dependencies that are enabled. On my
netbsd VM libxml2 pulls in -lpthread, for example. We add xml2's dependencies
to LIBS, so if that's enabled, we end up indirectly pulling in libxml2 in as
well.


> > How should I have done that, by the way?  Is the attached the right trick?
>
> I think that'd do for preventing side-effects on LIBS, but I'm not
> sure if we'd have to back-fill something in pgbench's link options.
> Anyway, as I said to Robert, I'm content to watch and wait for now.

Given that linking in pthreads support fixes things, that seems the right
course... I wonder if we shouldn't even be more explicit about it and just add
it - who knows what extension libraries pull in. It'd not be good if we end up
with non-reentrant versions of functions just because initially the backend
isn't threaded etc.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: V14 and later build the backend with -lpthread
Next
From: Andrew Dunstan
Date:
Subject: Re: Strip -mmacosx-version-min options from plperl build