summaryrefslogtreecommitdiff
path: root/src/Makefile.shlib
diff options
context:
space:
mode:
authorNoah Misch2021-09-06 18:27:59 +0000
committerNoah Misch2021-09-06 18:28:02 +0000
commitaae398a87cfafcb1d62fd1e464b2c4d2525a039a (patch)
tree9dd679f19d6196be4c7875d09641be44908e3ebf /src/Makefile.shlib
parentd8a266c5e1bd50785d4619ecb3e686f86771685f (diff)
AIX: Fix missing libpq symbols by respecting SHLIB_EXPORTS.
We make each AIX shared library export all globals found in .o files that originate in the library. That doesn't include symbols acquired by -lpgcommon_shlib. That is good on average, but it became a problem for libpq when commit e6afa8918c461c1dd80c5063a950518fa4e950cd moved five official libpq API symbols into src/common. Fix this by implementing the SHLIB_EXPORTS mechanism for AIX, so affected libraries export the same symbols that they export on Linux. This reintroduces symbols pg_encoding_to_char, pg_utf_mblen, pg_char_to_encoding, pg_valid_server_encoding, and pg_valid_server_encoding_id. Back-patch to v13, where the aforementioned commit first appeared. While a minor release is usually the wrong time to add or remove symbol exports in libpq or libecpg, we should expect users to want each documented symbol. Tony Reix Discussion: https://postgr.es/m/PR3PR02MB6396742E2FC3E77D37A920BC86C79@PR3PR02MB6396.eurprd02.prod.outlook.com
Diffstat (limited to 'src/Makefile.shlib')
-rw-r--r--src/Makefile.shlib4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Makefile.shlib b/src/Makefile.shlib
index 1e08698b497..b8cbc96b28b 100644
--- a/src/Makefile.shlib
+++ b/src/Makefile.shlib
@@ -329,7 +329,11 @@ $(shlib): $(OBJS) | $(SHLIB_PREREQS)
rm -f $(stlib)
$(LINK.static) $(stlib) $^
$(RANLIB) $(stlib)
+ifeq (,$(SHLIB_EXPORTS))
$(MKLDEXPORT) $(stlib) $(shlib) >$(exports_file)
+else
+ ( echo '#! $(shlib)'; $(AWK) '/^[^#]/ {printf "%s\n",$$1}' $(SHLIB_EXPORTS) ) >$(exports_file)
+endif
$(COMPILER) -o $(shlib) $(stlib) -Wl,-bE:$(exports_file) $(LDFLAGS) $(LDFLAGS_SL) $(SHLIB_LINK)
rm -f $(stlib)
$(AR) $(AROPT) $(stlib) $(shlib)