solaris: Use versioning scripts instead of -Bsymbolic
authorAndres Freund <[email protected]>
Thu, 25 Aug 2022 03:37:54 +0000 (20:37 -0700)
committerAndres Freund <[email protected]>
Thu, 25 Aug 2022 03:37:54 +0000 (20:37 -0700)
-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.

Reviewed-by: Peter Eisentraut <[email protected]>
Discussion: https://postgr.es/m/20220823083436[email protected]
Discussion: https://postgr.es/m/7dae5979-c6c0-cec5-7a36-76a85aa8053d@enterprisedb.com

src/Makefile.shlib

index e4658320f8b5dc0c9f235630fd258afd80245ee6..b868c8cea6b4b8f14a85e7aca1ead4c0b00ef74a 100644 (file)
@@ -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)