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,21 +177,33 @@ extraPkgs // {
]; ];
}); });
openssl = prev.openssl.overrideAttrs (o: { openssl = prev.openssl.overrideAttrs (o:
# we want to apply with final;
# https://patch-diff.githubusercontent.com/raw/openssl/openssl/pull/20273.patch"; let cross = stdenv.buildPlatform != stdenv.hostPlatform;
# which disables overriding the -march cflags to the wrong values, in
# but openssl is used for bootstrapping so that's easier said than {
# done. Do it the ugly way.. # we want to apply
postPatch = # https://patch-diff.githubusercontent.com/raw/openssl/openssl/pull/20273.patch";
o.postPatch # which disables overriding the -march cflags to the wrong values,
+ ( # but openssl is used for bootstrapping so that's easier said than
with final; # done. Do it the ugly way..
lib.optionalString ( postPatch =
stdenv.buildPlatform != stdenv.hostPlatform o.postPatch
) "\nsed -i.bak 's/linux.*-mips/linux-mops/' Configure\n" + (
); lib.optionalString cross ''
}); sed -i.bak 's/linux.*-mips/linux-mops/' Configure
''
);
# 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;