Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix zstd-sys in thin mode: Replace ZSTD_LIB_MINIFY with actual #defines #197

Merged
merged 1 commit into from
Jan 27, 2023
Merged
Changes from all commits
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
20 changes: 12 additions & 8 deletions zstd-safe/zstd-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,18 @@ fn compile_zstd() {
#[cfg(feature = "thin")]
{
// Here we try to build a lib as thin/small as possible.

// ZSTD_LIB_MINIFY implies:
// - HUF_FORCE_DECOMPRESS_X1
// - ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT
// - ZSTD_NO_INLINE
// - ZSTD_STRIP_ERROR_STRINGS, removes the error messages that are
// otherwise returned by ZSTD_getErrorName
config.define("ZSTD_LIB_MINIFY", Some("1"));
// We cannot use ZSTD_LIB_MINIFY since it is only
// used in Makefile to define other options.

config
.define("HUF_FORCE_DECOMPRESS_X1", Some("1"))
.define("HUF_FORCE_DECOMPRESS_X2", Some("0"))
.define("ZSTD_FORCE_DECOMPRESS_SEQUENCES_SHORT", Some("1"))
.define("ZSTD_FORCE_DECOMPRESS_SEQUENCES_LONG", Some("0"))
.define("ZSTD_NO_INLINE", Some("1"))
// removes the error messages that are
// otherwise returned by ZSTD_getErrorName
.define("ZSTD_STRIP_ERROR_STRINGS", Some("1"));
Comment on lines +168 to +179
Copy link
Contributor Author

Choose a reason for hiding this comment

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


// Disable use of BMI2 instructions since it involves runtime checking
// of the feature and fallback if no BMI2 instruction is detected.
Expand Down