summaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/rust.py
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2025-02-04 18:18:30 +0100
committerDylan Baker <dylan@pnwbakers.com>2025-07-18 09:42:56 -0700
commit08798850c1c2798e55fe7099cbff231e48d52e42 (patch)
treee5ce57ba3b4a23da748f046df3cae340baf6f19f /mesonbuild/compilers/rust.py
parentd5c121e1794781b849702bde3628cb14b8dbc4b5 (diff)
downloadmeson-08798850c1c2798e55fe7099cbff231e48d52e42.tar.gz
compilers: add Rustup libdir even if there is no other rpath argument
RustCompiler.build_rpath_args works by appending the directory to the arguments computed by self.linker.build_rpath_args. This does not work if there is no argument to begin with, which happens for example in program crates. Use the new extra_paths argument to force inclusion of the libdir into the rpath of the binary, even in that case. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'mesonbuild/compilers/rust.py')
-rw-r--r--mesonbuild/compilers/rust.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py
index 5ebb09346..38e70556e 100644
--- a/mesonbuild/compilers/rust.py
+++ b/mesonbuild/compilers/rust.py
@@ -200,15 +200,15 @@ class RustCompiler(Compiler):
def build_rpath_args(self, env: 'Environment', build_dir: str, from_dir: str,
rpath_paths: T.Tuple[str, ...], build_rpath: str,
install_rpath: str) -> T.Tuple[T.List[str], T.Set[bytes]]:
- args, to_remove = super().build_rpath_args(env, build_dir, from_dir, rpath_paths,
- build_rpath, install_rpath)
+ # add rustc's sysroot to account for rustup installations
+ args, to_remove = self.linker.build_rpath_args(env, build_dir, from_dir, rpath_paths,
+ build_rpath, install_rpath,
+ [self.get_target_libdir()])
- # ... but then add rustc's sysroot to account for rustup
- # installations
rustc_rpath_args = []
for arg in args:
rustc_rpath_args.append('-C')
- rustc_rpath_args.append(f'link-arg={arg}:{self.get_target_libdir()}')
+ rustc_rpath_args.append(f'link-arg={arg}')
return rustc_rpath_args, to_remove
def compute_parameters_with_absolute_paths(self, parameter_list: T.List[str],