We need this as the rust-installer tool would otherwise generate corrupt tarballs on big endian targets. This matters when generating bootstrap tar.xz tarballs. From f01c8060310ab3456f93567cb819384c4ae4e117 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 22 Aug 2019 22:46:47 -0700 Subject: [PATCH] Fix tests on big-endian targets Turns out liblzma wants to be compiled with options to indicate that it's big endian! --- lzma-sys/build.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lzma-sys/build.rs b/lzma-sys/build.rs index 7366d9c..a1e28b4 100644 --- a/vendor/lzma-sys/build.rs +++ b/vendor/lzma-sys/build.rs @@ -56,6 +56,12 @@ fn main() { build.flag("-std=c99").flag("-pthread"); } + if let Ok(s) = env::var("CARGO_CFG_TARGET_ENDIAN") { + if s == "big" { + build.define("WORDS_BIGENDIAN", None); + } + } + build.compile("liblzma.a"); }