summary refs log tree commit diff
path: root/pkgs/development/libraries/openssl
diff options
context:
space:
mode:
authorAdam Joseph <adam@westernsemico.com>2022-03-25 01:41:25 -0700
committerAdam Joseph <adam@westernsemico.com>2022-04-11 11:23:19 -0700
commit77d6781cdc7b472bc5d6991b5afc5b6c0928d3d6 (patch)
treefc21f1092a08eb35e2e977e6dffe39e4512274ed /pkgs/development/libraries/openssl
parent9fcf18081ce1c9b2d54d2be9906fd5aa1279eb66 (diff)
downloadnixpkgs-77d6781cdc7b472bc5d6991b5afc5b6c0928d3d6.tar
nixpkgs-77d6781cdc7b472bc5d6991b5afc5b6c0928d3d6.tar.gz
nixpkgs-77d6781cdc7b472bc5d6991b5afc5b6c0928d3d6.tar.bz2
nixpkgs-77d6781cdc7b472bc5d6991b5afc5b6c0928d3d6.tar.lz
nixpkgs-77d6781cdc7b472bc5d6991b5afc5b6c0928d3d6.tar.xz
nixpkgs-77d6781cdc7b472bc5d6991b5afc5b6c0928d3d6.tar.zst
nixpkgs-77d6781cdc7b472bc5d6991b5afc5b6c0928d3d6.zip
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
Diffstat (limited to 'pkgs/development/libraries/openssl')
-rw-r--r--pkgs/development/libraries/openssl/default.nix6
1 files changed, 6 insertions, 0 deletions
diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix
index 33ddbf7018c..e364cc3dd76 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"