diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2020-08-25 23:58:17 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-25 23:58:17 +0300 |
commit | 3a25efc056c00da3fe10240757e3ae538fd57435 (patch) | |
tree | 1c6256b0445f8ef49a230fc02a3c1eb396e60c68 /mesonbuild/linkers.py | |
parent | 1de1cc22e2fcc56860ee8174e375070c062f5b30 (diff) | |
parent | 1b2708eb79a5475dae23b6911021a490b52ea9fc (diff) | |
download | meson-3a25efc056c00da3fe10240757e3ae538fd57435.zip meson-3a25efc056c00da3fe10240757e3ae538fd57435.tar.gz meson-3a25efc056c00da3fe10240757e3ae538fd57435.tar.bz2 |
Merge pull request #7581 from peterh/aix
Add AIX support
Diffstat (limited to 'mesonbuild/linkers.py')
-rw-r--r-- | mesonbuild/linkers.py | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/mesonbuild/linkers.py b/mesonbuild/linkers.py index 505aef6..3f65da1 100644 --- a/mesonbuild/linkers.py +++ b/mesonbuild/linkers.py @@ -247,6 +247,18 @@ class C2000Linker(StaticLinker): return ['-r'] +class AIXArLinker(ArLinker): + + def __init__(self, exelist: T.List[str]): + StaticLinker.__init__(self, exelist) + self.id = 'aixar' + self.std_args = ['-csr', '-Xany'] + + def can_linker_accept_rsp(self) -> bool: + # AIXAr can't accept arguments using the @rsp syntax + return False + + def prepare_rpaths(raw_rpaths: str, build_dir: str, from_dir: str) -> T.List[str]: # The rpaths we write must be relative if they point to the build dir, # because otherwise they have different length depending on the build @@ -1145,6 +1157,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.""" |