Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions bzip2-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ fn main() {

let dst = PathBuf::from(env::var_os("OUT_DIR").unwrap());

cfg.flag_if_supported("-ffunction-sections")
.flag_if_supported("-fdata-sections")
.flag_if_supported("-fmerge-all-constants")
.flag_if_supported("-Wl,--gc-sections")
.flag_if_supported("-Wl,--icf=safe");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to have -ffunction-sections and co. -Wl,--gc-sections and -Wl,--icf=safe can be omitted though as those only apply to linking by the cc crate, but we only build a staticlib here. They don't have any effect on linking done by rustc.


cfg.include("bzip2-1.0.8")
.define("_FILE_OFFSET_BITS", Some("64"))
.define("BZ_NO_STDIO", None)
Expand Down