libtommath: expose mp_set_double on darwin

This commit is contained in:
amusingimpala75
2026-06-19 13:42:57 -07:00
parent 1d7700a745
commit fffd9ef94f
2 changed files with 18 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
diff --git a/bn_mp_set_double.c b/bn_mp_set_double.c
index a42fc70..4a13539 100644
--- a/bn_mp_set_double.c
+++ b/bn_mp_set_double.c
@@ -3,7 +3,8 @@
/* LibTomMath, multiple-precision integer library -- Tom St Denis */
/* SPDX-License-Identifier: Unlicense */
-#if defined(__STDC_IEC_559__) || defined(__GCC_IEC_559)
+#if defined(__STDC_IEC_559__) || defined(__GCC_IEC_559) || \
+ (defined(__APPLE__) && defined(__aarch64__))
mp_err mp_set_double(mp_int *a, double b)
{
uint64_t frac;

View File

@@ -14,6 +14,10 @@ stdenv.mkDerivation (finalAttrs: {
sha256 = "sha256-KWJy2TQ1mRMI63NgdgDANLVYgHoH6CnnURQuZcz6nQg=";
};
patches = [
./force_mp_set_double.patch
];
postPatch = ''
substituteInPlace makefile.shared \
--replace-fail glibtool libtool \