Hi,

On 2022-09-11 11:19:25 -0700, Andres Freund wrote:
> We could also try to fall back to using -Wl,b,expall for extension modules.

expall doesn't work, because of our use of identifiers in reserved namespaces,
e.g. _PG_init:

       expall
            Exports all global symbols, except imported symbols, unreferenced 
symbols defined in archive members, and symbols beginning with an underscore
            (_). You can export additional symbols by listing them in an export 
file or using the expfull option. This option does not affect symbols
            exported by the autoexp option.

However, there also is 'expfull' - IIRC that causes problems when used for
postgres, but appears to be fine for .so's.

So we could work around the xlc 12.1 issue with something like the attached
patch. It passes at some of the tests, with both 32 and 64bit xlc 12.1, will
have to wait a while to see more

I think it'd be considerably better to just not support xlc < 13.1 though.


This won't fix sungazer, that just needs the perl wrapper removed...

Greetings,

Andres Freund
>From 0f7503d7ef1053eeaa37e9aeb020502cc9078d57 Mon Sep 17 00:00:00 2001
From: Andres Freund <and...@anarazel.de>
Date: Tue, 13 Sep 2022 10:55:03 -0700
Subject: [PATCH] wip

---
 configure    | 5 +++++
 configure.ac | 5 +++++
 2 files changed, 10 insertions(+)

diff --git a/configure b/configure
index fd2a782454b..82fce7eccc4 100755
--- a/configure
+++ b/configure
@@ -7101,6 +7101,11 @@ if test x"$pgac_cv_prog_CXX_cxxflags__qvisibility_hidden" = x"yes"; then
 fi
 
   have_visibility_attribute=$pgac_cv_prog_CC_cflags__qvisibility_hidden
+  # Old xlc versions (<13.1) don't have support for -qvisibility. Use expfull to force
+  # all extension module symbols to be exported.
+  if test "$pgac_cv_prog_CC_cflags__qvisibility_hidden" != "yes"; then
+    CFLAGS_SL_MODULE='-Wl,-b,expfull'
+  fi
 fi
 
 if test "$have_visibility_attribute" = "yes"; then
diff --git a/configure.ac b/configure.ac
index 7792ae5bad3..93c015d6e0b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -592,6 +592,11 @@ elif test "$PORTNAME" = "aix"; then
   PGAC_PROG_CC_VAR_OPT(CFLAGS_SL_MODULE, [-qvisibility=hidden])
   PGAC_PROG_VARCXX_VARFLAGS_OPT(CXX, CXXFLAGS_SL_MODULE, [-qvisibility=hidden])
   have_visibility_attribute=$pgac_cv_prog_CC_cflags__qvisibility_hidden
+  # Old xlc versions (<13.1) don't have support for -qvisibility. Use expfull to force
+  # all extension module symbols to be exported.
+  if test "$pgac_cv_prog_CC_cflags__qvisibility_hidden" != "yes"; then
+    CFLAGS_SL_MODULE='-Wl,-b,expfull'
+  fi
 fi
 
 if test "$have_visibility_attribute" = "yes"; then
-- 
2.37.3.542.gdd3f6c4cae

Reply via email to