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