Hi,

On 2022-08-23 01:34:36 -0700, Andres Freund wrote:
> On 2019-04-23 06:23:13 +0100, Andrew Gierth wrote:
> > I wonder if it's the use of -Bsymbolic that causes this (buildfarm logs
> > don't seem to go back far enough to check). (Note to original poster:
> > -Bsymbolic is there for a reason, you can't just remove it - but see
> > below.)
> 
> For the record, yes, the "ld: warning: symbol referencing errors" warnings are
> due to -Bsymbolic while linking extensions. The man page says:
> "The link-editor issues warnings for undefined symbols  unless -z defs 
> overrides"
> 
> 
> > Since this is an ELF platform - arguably the closest thing to the
> > original reference ELF platform, at least by descent - it should not
> > require the kinds of tricks used on macOS and AIX; but we haven't done
> > the work needed to test using version scripts in place of -Bsymbolic for
> > fixing the symbol conflict problems. That ought to be a relatively
> > straightforward project for someone with access to a system to test on
> > (and I'm happy to advise on it).
> 
> It's indeed trivial - the only change needed from linux is to replace
> -Wl,--version-script=... with -Wl,-M...

Patch attached. Passed check-world (without tap tests, didn't install the perl
mods) on solaris.  Does anybody see a reason not to apply? Even just having
less noisy build logs seem like an advantage.

Greetings,

Andres Freund
>From 176c8c31a74e01d3005cc7df6bae5fcd951b2f0c Mon Sep 17 00:00:00 2001
From: Andres Freund <and...@anarazel.de>
Date: Tue, 23 Aug 2022 01:50:29 -0700
Subject: [PATCH v1] solaris: Use versioning scripts instead of -Bsymbolic

-Bsymbolic causes a lot of "ld: warning: symbol referencing errors"
warnings. It's quite easy to add the symbol versioning script, we just need a
slightly different parameter name.

Discussion: https://postgr.es/m/20220823083436.whtntk3bn3qpn...@awork3.anarazel.de
---
 src/Makefile.shlib | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/Makefile.shlib b/src/Makefile.shlib
index 2af6192f0f3..3202b2e67de 100644
--- a/src/Makefile.shlib
+++ b/src/Makefile.shlib
@@ -188,10 +188,15 @@ ifeq ($(PORTNAME), linux)
 endif
 
 ifeq ($(PORTNAME), solaris)
-  LINK.shared		= $(COMPILER) -shared -Wl,-Bsymbolic
+  LINK.shared		= $(COMPILER) -shared
   ifdef soname
     LINK.shared	+= -Wl,-soname,$(soname)
   endif
+  BUILD.exports		= ( echo '{ global:'; $(AWK) '/^[^\#]/ {printf "%s;\n",$$1}' $<; echo ' local: *; };' ) >$@
+  exports_file		= $(SHLIB_EXPORTS:%.txt=%.list)
+  ifneq (,$(exports_file))
+    LINK.shared		+= -Wl,-M$(exports_file)
+  endif
 endif
 
 ifeq ($(PORTNAME), cygwin)
-- 
2.37.0.3.g30cc8d0f14

Reply via email to