Skip to content

Commit 29eebb4

Browse files
committed
Fix call to rustc-objcopy to strip binary on Linux
Signed-off-by: Nico Burns <[email protected]>
1 parent 46b1639 commit 29eebb4

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

packages/cli/src/build/request.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3979,7 +3979,9 @@ impl BuildRequest {
39793979
};
39803980
if let Some(strip_arg) = strip_arg {
39813981
let rustc_objcopy = self.workspace.rustc_objcopy();
3982+
let dylib_path = self.workspace.rustc_objcopy_dylib_path();
39823983
let mut command = Command::new(rustc_objcopy);
3984+
command.env("LD_LIBRARY_PATH", &dylib_path);
39833985
command.arg(strip_arg).arg(exe).arg(exe);
39843986
let output = command.output().await?;
39853987
if !output.status.success() {

packages/cli/src/workspace.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,11 @@ impl Workspace {
285285
.join("rust-objcopy")
286286
}
287287

288+
// ./rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib
289+
pub fn rustc_objcopy_dylib_path(&self) -> PathBuf {
290+
self.sysroot.join("lib")
291+
}
292+
288293
/// Find the "main" package in the workspace. There might not be one!
289294
pub fn find_main_package(&self, package: Option<String>) -> Result<NodeId> {
290295
if let Some(package) = package {

0 commit comments

Comments
 (0)