From bb69ce496801807bffcb8f0cc1c6b2bd6d66ad72 Mon Sep 17 00:00:00 2001 From: sofia Date: Wed, 23 Jul 2025 19:01:24 +0300 Subject: [PATCH] Fix LD-environment variable --- reid/examples/cli.rs | 3 ++- reid/src/ld.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/reid/examples/cli.rs b/reid/examples/cli.rs index 1e7ad10..6dc9974 100644 --- a/reid/examples/cli.rs +++ b/reid/examples/cli.rs @@ -55,7 +55,8 @@ fn main() -> Result<(), std::io::Error> { ); println!("Linking {:?}", &object_path); - let linker = option_env!("LD").unwrap_or("ld").to_owned(); + + let linker = std::env::var("LD").unwrap_or("ld".to_owned()); let mut linker = LDRunner::from_command(linker).with_library("c".to_owned()); for library in libraries { linker = linker.with_library(library); diff --git a/reid/src/ld.rs b/reid/src/ld.rs index bf7edda..d540167 100644 --- a/reid/src/ld.rs +++ b/reid/src/ld.rs @@ -1,4 +1,4 @@ -use std::{io::Read, path::PathBuf, process::Command}; +use std::{path::PathBuf, process::Command}; pub struct LDRunner { command: String,