Skip to content

Commit

Permalink
openssl: specify the ABI explicitly on mips64
Browse files Browse the repository at this point in the history
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.

#165746 (review)
  • Loading branch information
Adam Joseph committed Apr 11, 2022
1 parent 9fcf180 commit 77d6781
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkgs/development/libraries/openssl/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 77d6781

Please sign in to comment.