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 | |
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')
-rw-r--r-- | mesonbuild/linkers/__init__.py | 2 | ||||
-rw-r--r-- | mesonbuild/linkers/linkers.py | 30 |
2 files changed, 32 insertions, 0 deletions
diff --git a/mesonbuild/linkers/__init__.py b/mesonbuild/linkers/__init__.py index 9182fa1..2e5217e 100644 --- a/mesonbuild/linkers/__init__.py +++ b/mesonbuild/linkers/__init__.py @@ -53,6 +53,7 @@ from .linkers import ( QualcommLLVMDynamicLinker, PGIDynamicLinker, NvidiaHPC_DynamicLinker, + NAGDynamicLinker, VisualStudioLikeLinkerMixin, MSVCDynamicLinker, @@ -110,6 +111,7 @@ __all__ = [ 'QualcommLLVMDynamicLinker', 'PGIDynamicLinker', 'NvidiaHPC_DynamicLinker', + 'NAGDynamicLinker', 'VisualStudioLikeLinkerMixin', 'MSVCDynamicLinker', 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.""" |