aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/minstall.py
diff options
context:
space:
mode:
authorAditya Vidyadhar Kamath <Aditya.Kamath1@ibm.com>2023-10-10 08:13:14 -0500
committerEli Schwartz <eschwartz93@gmail.com>2023-10-31 19:18:17 -0400
commitf4d19db25e3183833a5e2d77ef5ab40b9b523144 (patch)
tree0669d882c388e8a0a256402dc4b4519a37ec3a45 /mesonbuild/minstall.py
parentce691f8c98aeb72a246c4d6e9d60ed9ec88a6afd (diff)
downloadmeson-f4d19db25e3183833a5e2d77ef5ab40b9b523144.zip
meson-f4d19db25e3183833a5e2d77ef5ab40b9b523144.tar.gz
meson-f4d19db25e3183833a5e2d77ef5ab40b9b523144.tar.bz2
Use target.aix_so_archive to decide to archive shared library in AIX
Previously, AIX support was updated to archive shared libraries per AIX platform conventions, which expect .a files that contain .so files. This is usually correct, but an edge case occurs for loadable plugins, e.g. what meson creates for `shared_module()`. A notable example is python extensions (SciPy, for example). These should *not* be archived, because the .so file itself needs to be loaded as a plugin. For example, SciPy fails to import in the python interpreter. Handle this by differentiating between plugins and regular libraries, and only archiving when safe to do so. Fixes #12219
Diffstat (limited to 'mesonbuild/minstall.py')
-rw-r--r--mesonbuild/minstall.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py
index bf6f7a1..297afb4 100644
--- a/mesonbuild/minstall.py
+++ b/mesonbuild/minstall.py
@@ -722,8 +722,9 @@ class Installer:
# In AIX, we archive our shared libraries. When we install any package in AIX we need to
# install the archive in which the shared library exists. The below code does the same.
# We change the .so files having lt_version or so_version to archive file install.
+ # If .so does not exist then it means it is in the archive. Otherwise it is a .so that exists.
if is_aix():
- if '.so' in t.fname:
+ if not os.path.exists(t.fname) and '.so' in t.fname:
t.fname = re.sub('[.][a]([.]?([0-9]+))*([.]?([a-z]+))*', '.a', t.fname.replace('.so', '.a'))
if not self.should_install(t):
continue