Skip to content

Commit

Permalink
build.rs: Don't try to set linker flags since we're not linking.
Browse files Browse the repository at this point in the history
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.)
  • Loading branch information
briansmith committed Oct 5, 2023
1 parent 2eea794 commit 34f6ec8
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 34f6ec8

Please sign in to comment.