Re: Use -fvisibility=hidden for shared libraries - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Use -fvisibility=hidden for shared libraries
Date
Msg-id 5b8d48a4-2fee-6764-7eda-a076f544ea33@enterprisedb.com
Whole thread Raw
In response to Re: Use -fvisibility=hidden for shared libraries  (Andres Freund <andres@anarazel.de>)
Responses Re: Use -fvisibility=hidden for shared libraries  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On 11.01.22 03:53, Andres Freund wrote:
> Ugh. In the case of worker_spi it's because -fvisibility=hidden isn't applied
> to worker_spi.c at all. Which in turn is because Makefile.shlib isn't used at
> all for MODULES= style modules just for MODULE_big= ones :(.
> 
> Once that's "fixed" it fails as expected...
> 
> I'm not sure what the best way to deal with this is. Just now I copied the
> logic from Makefile.shlib to pgxs.mk (by the existing CFLAGS_SL use), but that
> doesn't scale - there's other direct uses of CFLAGS_SL.
> 
> Perhaps the best way would be to add the -fvisibility=hidden to CFLAGS_SL, and
> work around the explicit exports issue in Makefile.shlib by adding an explicit
> -fvisibility=default? Or perhaps CFLAGS_SL

The easiest solution would be to change worker_spi's Makefile to use 
MODULE_big.

There are already many cases where MODULE_big is used instead of MODULES 
for seemingly random reasons, so I wouldn't worry too much about it here 
if it helps you move forward.



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Remove an unnecessary errmsg_plural in dependency.c
Next
From: Peter Eisentraut
Date:
Subject: Re: [RFC] building postgres with meson -v6