libffi: Pass --build and --host to configure script

Without this, building `libffi` would do something horrible when
natively targeting `armv5tel-linux` on an `aarch64-linux` machine using the
32-bit compatibility sub-mode:

```
$ nix-build --system armv5tel-linux -A libffi --check
[...]
checking build system type... aarch64-unknown-linux-gnu
checking host system type... aarch64-unknown-linux-gnu
checking target system type... aarch64-unknown-linux-gnu
[...]

$ file result/lib/libffi.so.8.1.0
result/lib/libffi.so.8.1.0: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, not stripped

$ nm result/lib/libffi.so.8.1.0 | grep ffi_call
         U ffi_call
```

Correct arch-specific code wouldn't be built at all, with the resulting binary subtly broken.
This commit is contained in:
Zhaofeng Li 2021-12-16 21:06:07 -08:00
parent 6919d2ed24
commit 8807cab81b

View File

@ -28,6 +28,8 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
configurePlatforms = [ "build" "host" ];
configureFlags = [
"--with-gcc-arch=generic" # no detection of -march= or -mtune=
"--enable-pax_emutramp"