From 77d6781cdc7b472bc5d6991b5afc5b6c0928d3d6 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Fri, 25 Mar 2022 01:41:25 -0700 Subject: [PATCH] openssl: specify the ABI explicitly on mips64 When *not* cross-compiling, OpenSSL will not attempt to detect the host ABI. For mips64, the OpenSSL authors have chosen to assume that the n32 ABI is used. Since nixpkgs knows the correct ABI based on stdenv.hostPlatform, let's pass this information to OpenSSL explicitly. At the moment (bootstrappable) nixpkgs on mips64 can only be used with the n64 ABI due to the fact that boost-context (required by nix) does not support the n32 ABI. Without this commit the openssl expression can be cross-compiled to a mips64 host, but a mips64 host cannot self-compile the expression due to OpenSSL's incorrect assumption. https://github.com/NixOS/nixpkgs/pull/165746#pullrequestreview-924423243 --- pkgs/development/libraries/openssl/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index 33ddbf7018c5052..e364cc3dd76ee10 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -69,6 +69,12 @@ let x86_64-linux = "./Configure linux-x86_64"; x86_64-solaris = "./Configure solaris64-x86_64-gcc"; riscv64-linux = "./Configure linux64-riscv64"; + mips64el-linux = + if stdenv.hostPlatform.isMips64n64 + then "./Configure linux64-mips64" + else if stdenv.hostPlatform.isMips64n32 + then "./Configure linux-mips64" + else throw "unsupported ABI for ${stdenv.hostPlatform.system}"; }.${stdenv.hostPlatform.system} or ( if stdenv.hostPlatform == stdenv.buildPlatform then "./config"