aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/linkers.py
diff options
context:
space:
mode:
authorPeter Harris <pharris@opentext.com>2020-08-10 19:03:09 -0400
committerPeter Harris <pharris@opentext.com>2020-08-12 21:13:07 -0400
commitabe72d5c8415c83f268d01b266e2fa5f5892de46 (patch)
tree8585e31d8a26dab72c8b10a78237be165de16c63 /mesonbuild/linkers.py
parent45a12d28b9e6c9df454611e7286e06d91ec7617f (diff)
downloadmeson-abe72d5c8415c83f268d01b266e2fa5f5892de46.zip
meson-abe72d5c8415c83f268d01b266e2fa5f5892de46.tar.gz
meson-abe72d5c8415c83f268d01b266e2fa5f5892de46.tar.bz2
aix: detect and support the AIX dynamic linker
Diffstat (limited to 'mesonbuild/linkers.py')
-rw-r--r--mesonbuild/linkers.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/mesonbuild/linkers.py b/mesonbuild/linkers.py
index 3ce7111..84c6538 100644
--- a/mesonbuild/linkers.py
+++ b/mesonbuild/linkers.py
@@ -1141,6 +1141,38 @@ class SolarisDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
return self._apply_prefix('-soname,{}{}.{}{}'.format(prefix, shlib_name, suffix, sostr))
+class AIXDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker):
+
+ """Sys-V derived linker used on AIX"""
+
+ def __init__(self, *args, **kwargs):
+ super().__init__('ld.aix', *args, **kwargs)
+
+ def get_always_args(self) -> T.List[str]:
+ return self._apply_prefix(['-bsvr4', '-bnoipath', '-bbigtoc']) + super().get_always_args()
+
+ def no_undefined_args(self) -> T.List[str]:
+ return self._apply_prefix(['-z', 'defs'])
+
+ def get_allow_undefined_args(self) -> T.List[str]:
+ return self._apply_prefix(['-z', 'nodefs'])
+
+ def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str,
+ rpath_paths: str, build_rpath: str,
+ install_rpath: str) -> T.Tuple[T.List[str], T.Set[bytes]]:
+ all_paths = mesonlib.OrderedSet(['/opt/freeware/lib']) # for libgcc_s.a
+ for p in rpath_paths:
+ all_paths.add(os.path.join(build_dir, p))
+ if build_rpath != '':
+ all_paths.add(build_rpath)
+ if install_rpath != '':
+ all_paths.add(install_rpath)
+ return (self._apply_prefix([x for p in all_paths for x in ('-R', p)]), set())
+
+ def thread_flags(self, env: 'Environment') -> T.List[str]:
+ return ['-pthread']
+
+
class OptlinkDynamicLinker(VisualStudioLikeLinkerMixin, DynamicLinker):
"""Digital Mars dynamic linker for windows."""