build openssl without threads to avoid stdatomic

This commit is contained in:
Daniel Barlow 2024-07-24 21:12:52 +01:00
parent e1ae986cf6
commit 612d6d7a51
1 changed files with 27 additions and 15 deletions

View File

@ -177,7 +177,11 @@ extraPkgs // {
]; ];
}); });
openssl = prev.openssl.overrideAttrs (o: { openssl = prev.openssl.overrideAttrs (o:
with final;
let cross = stdenv.buildPlatform != stdenv.hostPlatform;
in
{
# we want to apply # we want to apply
# https://patch-diff.githubusercontent.com/raw/openssl/openssl/pull/20273.patch"; # https://patch-diff.githubusercontent.com/raw/openssl/openssl/pull/20273.patch";
# which disables overriding the -march cflags to the wrong values, # which disables overriding the -march cflags to the wrong values,
@ -186,11 +190,19 @@ extraPkgs // {
postPatch = postPatch =
o.postPatch o.postPatch
+ ( + (
with final; lib.optionalString cross ''
lib.optionalString ( sed -i.bak 's/linux.*-mips/linux-mops/' Configure
stdenv.buildPlatform != stdenv.hostPlatform ''
) "\nsed -i.bak 's/linux.*-mips/linux-mops/' Configure\n"
); );
# openssl with threads requires stdatomic which drags in libgcc
# as a dependency
configureFlags = []
++ (lib.optional cross "no-threads")
++ o.configureFlags;
# don't need or want this bash script
postInstall = o.postInstall +
(lib.optionalString cross "rm $bin/bin/c_rehash\n");
}); });
pppBuild = prev.ppp; pppBuild = prev.ppp;