diff --git a/src/Makefile.shlib b/src/Makefile.shlib index e4658320f8..b868c8cea6 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)