Re: Use -fvisibility=hidden for shared libraries

From: Andres Freund <andres(at)anarazel(dot)de>
To: Justin Pryzby <pryzby(at)telsasoft(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Use -fvisibility=hidden for shared libraries
Date: 2022-01-11 03:31:33
Message-ID: 20220111033133.k5cj63ywz64oxj4y@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2022-01-10 21:11:07 -0600, Justin Pryzby wrote:
> On Mon, Jan 10, 2022 at 07:01:36PM -0500, Tom Lane wrote:
> > Andres Freund <andres(at)anarazel(dot)de> writes:
> > > [ v2-0001-Use-hidden-visibility-for-shared-libraries-where-.patch ]
> >
> > This seems like a good idea, but it's failing to apply right now,
> > mainly because of some cleanup I did in e04a8059a. As far as I can
> > tell given the now-clarified meanings of PGDLLIMPORT/PGDLLEXPORT,
> > this patch shouldn't be touching PGDLLIMPORT. The attached revision
> > works for me under gcc 8.5 and clang 13.
> >
> > Also, it seemed like you'd maybe been more enthusiastic than necessary
> > about plastering PGDLLEXPORT on things. I got through check-world
> > cleanly without the diffs in either ltree.h or worker_spi.c (although
> > I confess being confused why I didn't need the latter). I didn't try
> > individually removing other diffs. Those diffs are still in v3 below,
> > but we should clarify exactly which functions need marking.
>
> Without the patch, it fails under windows like:
>
> https://cirrus-ci.com/task/6171477065072640
> [01:44:45.399] c:\cirrus\contrib\ltree\ltree.h(193): message : see declaration of '_ltree_isparent' [c:\cirrus\ltree.vcxproj]
> [01:44:45.399] c:\cirrus\contrib\ltree\_ltree_op.c(16,1): error C2375: '_ltree_risparent': redefinition; different linkage [c:\cirrus\ltree.vcxproj]

Ah, yea. It's about matching the declarations in ltree.h with the
PG_FUNCTION_INFO_V1() one.

What is bugging me is that I am fairly sure that my local compilers at some
point complained about such mismatches on linux as well. But I can't reproduce
that right now :/

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2022-01-11 04:13:30 Re: row filtering for logical replication
Previous Message Masahiko Sawada 2022-01-11 03:22:08 Re: Skipping logical replication transactions on subscriber side