Re: V14 and later build the backend with -lpthread

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: V14 and later build the backend with -lpthread
Date: 2022-08-25 21:34:49
Message-ID: 20220825213449.4xvkp3uzjj7uggmz@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2022-08-25 21:39:35 Re: Strip -mmacosx-version-min options from plperl build
Previous Message Tom Lane 2022-08-25 21:33:14 Re: V14 and later build the backend with -lpthread