Merge pull request #212303 from amjoseph-nixpkgs/pr/build-rust-crate/ilp32

build-rust-crate: handle ILP32 platforms correctly
This commit is contained in:
superherointj
2023-01-31 23:48:22 -03:00
committed by GitHub
@@ -130,7 +130,7 @@ in ''
export CARGO_CFG_UNIX=1
export CARGO_CFG_TARGET_ENV="gnu"
export CARGO_CFG_TARGET_ENDIAN=${if stdenv.hostPlatform.parsed.cpu.significantByte.name == "littleEndian" then "little" else "big"}
export CARGO_CFG_TARGET_POINTER_WIDTH=${toString stdenv.hostPlatform.parsed.cpu.bits}
export CARGO_CFG_TARGET_POINTER_WIDTH=${with stdenv.hostPlatform; toString (if isILP32 then 32 else parsed.cpu.bits)}
export CARGO_CFG_TARGET_VENDOR=${stdenv.hostPlatform.parsed.vendor.name}
export CARGO_MANIFEST_DIR=$(pwd)