From 54de2749b03e330fe747846b23e5725ff7b0f5b8 Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Mon, 1 May 2017 04:51:17 +0300 Subject: [PATCH] Try fixing bigendian metadata serialisation I compiled this on PPC to check and it seems to work, but not sure whether I didn't mess up anything in a major way. Maybe a good shot at #41443 --- src/librustc_metadata/index.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_metadata/index.rs b/src/librustc_metadata/index.rs index 970a401177ba5..ebf9910e9c99c 100644 --- a/src/librustc_metadata/index.rs +++ b/src/librustc_metadata/index.rs @@ -58,7 +58,7 @@ impl Index { let pos = buf.position(); // First we write the length of the lower range ... - buf.write_all(words_to_bytes(&[self.positions[0].len() as u32])).unwrap(); + buf.write_all(words_to_bytes(&[(self.positions[0].len() as u32).to_le()])).unwrap(); // ... then the values in the lower range ... buf.write_all(words_to_bytes(&self.positions[0][..])).unwrap(); // ... then the values in the higher range.