From 34f6ec8c7f96e0aa7af8a9571ac93d362b47ed70 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Thu, 5 Oct 2023 15:35:42 -0700 Subject: [PATCH] build.rs: Don't try to set linker flags since we're not linking. First, we were passing `-Wl,--gc-sections` to the compiler regardless of whether it is MSVC, which didn't make any sense on its own. But, even more generally, it doesn't make sense for us to try to tell the linker what to do when we aren't actually linking. (We're building static libraries of the C and assembly code.) --- build.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/build.rs b/build.rs index 234214e9d9..0e4e26968d 100644 --- a/build.rs +++ b/build.rs @@ -509,14 +509,6 @@ fn build_library( // Rebuild the library if necessary. let lib_path = PathBuf::from(out_dir).join(format!("lib{}.a", lib_name)); - match target.os.as_str() { - "macos" => { - let _ = c.flag("-Wl,-dead_strip"); - } - _ => { - let _ = c.flag("-Wl,--gc-sections"); - } - } for o in objs { let _ = c.object(o); }