aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/linkers/linkers.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/linkers/linkers.py')
-rw-r--r--mesonbuild/linkers/linkers.py30
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."""