Skip to content

Commit cc0c6a3

Browse files
authored
Fix mimalloc build failure with musl and release mode
When building with mimalloc as the allocator targeting musl in release mode, the compiler fails due to -Werror=date-time warnings caused by mimalloc's use of __DATE__ and __TIME__ macros. This conflicts with musl's reproducible builds requirements. This commit adds the -Wno-error=date-time flag to the build configuration to downgrade these specific warnings from errors to warnings. This allows successful compilation while maintaining the functionality of mimalloc. The change affects only musl targets in release mode and does not alter behavior for other targets or build profiles. Fixes compilation error: expansion of date/time macro in mimalloc with musl + release combination.
1 parent 44c72c7 commit cc0c6a3

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

libmimalloc-sys/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ fn main() {
66
build.include("c_src/mimalloc/include");
77
build.include("c_src/mimalloc/src");
88
build.file("c_src/mimalloc/src/static.c");
9+
build.flag("-Wno-error=date-time");
910

1011
let target_os = env::var("CARGO_CFG_TARGET_OS").expect("target_os not defined!");
1112
let target_family = env::var("CARGO_CFG_TARGET_FAMILY").expect("target_family not defined!");

0 commit comments

Comments
 (0)