diff options
author | Mat Cross <mathewc@nag.co.uk> | 2021-08-20 11:55:18 +0100 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2021-09-10 16:08:57 -0400 |
commit | 0e86258748b712a9074ebd67e2bf98fe7748c73f (patch) | |
tree | 5a59b92e88d11124cd0a8a4066da98d544838a8e /mesonbuild/linkers/linkers.py | |
parent | 3f796c43df2c218f615d445ad6ffdbc6ca119818 (diff) | |
download | meson-0e86258748b712a9074ebd67e2bf98fe7748c73f.zip meson-0e86258748b712a9074ebd67e2bf98fe7748c73f.tar.gz meson-0e86258748b712a9074ebd67e2bf98fe7748c73f.tar.bz2 |
Implemented some missing operation for the NAG Fortran Compiler.
Diffstat (limited to 'mesonbuild/linkers/linkers.py')
-rw-r--r-- | mesonbuild/linkers/linkers.py | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/mesonbuild/linkers/linkers.py b/mesonbuild/linkers/linkers.py index e84d0a4..58e4324 100644 --- a/mesonbuild/linkers/linkers.py +++ b/mesonbuild/linkers/linkers.py @@ -1045,6 +1045,36 @@ class QualcommLLVMDynamicLinker(LLVMDynamicLinker): id = 'ld.qcld' +class NAGDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker): + + """NAG Fortran linker, ld via gcc indirection.""" + + id = 'nag' + + 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]]: + if not rpath_paths and not install_rpath and not build_rpath: + return ([], set()) + args = [] + origin_placeholder = '$ORIGIN' + processed_rpaths = prepare_rpaths(rpath_paths, build_dir, from_dir) + all_paths = mesonlib.OrderedSet([os.path.join(origin_placeholder, p) for p in processed_rpaths]) + if build_rpath != '': + all_paths.add(build_rpath) + for rp in all_paths: + args.extend(self._apply_prefix('-Wl,-Wl,,-rpath,,' + rp)) + + return (args, set()) + + def get_allow_undefined_args(self) -> T.List[str]: + return [] + + def get_std_shared_lib_args(self) -> T.List[str]: + from ..compilers import NAGFortranCompiler + return NAGFortranCompiler.get_nagfor_quiet(self.version) + ['-Wl,-shared'] + + class PGIDynamicLinker(PosixDynamicLinkerMixin, DynamicLinker): """PGI linker.""" |