Use correct flag on big endian machines.

This will fix `tests::sign` test case on mips/mips64. Verified with
`cross`[1] tool.

    cross test --target mips-unknown-linux-gnu
    cross test --target mips64el-unknown-linux-gnuabi64

Unfortunately this fix doesn't make `tests::test_debug_output` test case
pass, but this is about debug output so its not as critical as this
patch. See #63 for a discussion.

[1]: https://github.com/japaric/rust-cross
This commit is contained in:
Michał Papierski 2018-08-31 10:26:06 +02:00
parent 2f8855f8fd
commit 3b86de9b0f
1 changed files with 6 additions and 0 deletions

View File

@ -61,6 +61,12 @@ fn main() {
.define("ENABLE_MODULE_ECDH", Some("1")) .define("ENABLE_MODULE_ECDH", Some("1"))
.define("ENABLE_MODULE_RECOVERY", Some("1")); .define("ENABLE_MODULE_RECOVERY", Some("1"));
if let Ok(target_endian) = std::env::var("CARGO_CFG_TARGET_ENDIAN") {
if target_endian == "big" {
base_config.define("WORDS_BIGENDIAN", Some("1"));
}
}
if use_64bit_compilation { if use_64bit_compilation {
base_config.define("USE_FIELD_5X52", Some("1")) base_config.define("USE_FIELD_5X52", Some("1"))
.define("USE_SCALAR_4X64", Some("1")) .define("USE_SCALAR_4X64", Some("1"))