From f917e169abcc69b8ed7e5c7aa95ad035db08356c Mon Sep 17 00:00:00 2001 From: Johannes Brechtmann Date: Tue, 14 Jan 2020 22:57:23 +0100 Subject: [PATCH] Fix wrong directories in host_libdir. This fixes a regression from #7475 where the sysroot_target_libdir leaks into the host libdir. This can cause problems when the dynamic linker does not ignore the target libraries but tries to load them instead. This happens for example when building on x86_64-musl for aarch64-musl. --- src/cargo/core/compiler/compilation.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cargo/core/compiler/compilation.rs b/src/cargo/core/compiler/compilation.rs index 0fa25ab5856..c3a3593f388 100644 --- a/src/cargo/core/compiler/compilation.rs +++ b/src/cargo/core/compiler/compilation.rs @@ -101,7 +101,7 @@ impl<'cfg> Compilation<'cfg> { root_output: PathBuf::from("/"), deps_output: PathBuf::from("/"), host_deps_output: PathBuf::from("/"), - host_dylib_path: bcx.info(default_kind).sysroot_host_libdir.clone(), + host_dylib_path: bcx.info(CompileKind::Host).sysroot_host_libdir.clone(), target_dylib_path: bcx.info(default_kind).sysroot_target_libdir.clone(), tests: Vec::new(), binaries: Vec::new(),