From aafa1b2d22a2a9c2e7afbea74c8b4421cd8f35dd Mon Sep 17 00:00:00 2001 From: "L. E. Segovia" Date: Mon, 21 Aug 2023 19:49:38 -0300 Subject: [PATCH] Allow passing -Wl,-u to the linker --- src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 54247fd..62b26f5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -905,6 +905,10 @@ impl Library { iter.next().map(|s| s.to_owned()), ); } + "-u" => { + let meta = format!("rustc-link-arg=-Wl,-u,{}", val); + config.print_metadata(&meta); + } _ => {} } } @@ -931,6 +935,12 @@ impl Library { self.include_paths.push(PathBuf::from(inc)); } } + "-undefined" | "--undefined" => { + if let Some(symbol) = iter.next() { + let meta = format!("rustc-link-arg=-Wl,{},{}", part, symbol); + config.print_metadata(&meta); + } + } _ => { let path = std::path::Path::new(part); if path.is_file() {