Skip to content

Commit 1c0c425

Browse files
authored
Merge pull request zcash#6953 from str4d/6922-fix-windows-build
Fix Windows build
2 parents b5505ea + 8c8df86 commit 1c0c425

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

depends/packages/libcxx.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package=libcxx
22
$(package)_version=$(if $(native_clang_version_$(host_arch)_$(host_os)),$(native_clang_version_$(host_arch)_$(host_os)),$(if $(native_clang_version_$(host_os)),$(native_clang_version_$(host_os)),$(native_clang_default_version)))
3-
$(package)_msys2_version=18.1.8-1
3+
$(package)_msys2_version=18.1.6-1
44

55
ifneq ($(canonical_host),$(build))
66
ifneq ($(host_os),mingw32)
@@ -30,7 +30,7 @@ else
3030
$(package)_download_path=https://repo.msys2.org/mingw/x86_64
3131
$(package)_download_file=mingw-w64-x86_64-libc++-$($(package)_msys2_version)-any.pkg.tar.zst
3232
$(package)_file_name=mingw-w64-x86_64-libcxx-$($(package)_msys2_version)-any.pkg.tar.zst
33-
$(package)_sha256_hash=4673dba0e8c4bac3c4d645a4a64b947855228b21c82f6366b201e7636a78bc1a
33+
$(package)_sha256_hash=6857cc24cbe326c0cd571e52872bffe95f64ab67a8c5032c04875a9778fdece7
3434

3535
define $(package)_stage_cmds
3636
mkdir -p $($(package)_staging_prefix_dir)/lib && \

depends/packages/libsodium.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@ $(package)_download_path=https://download.libsodium.org/libsodium/releases/
44
$(package)_file_name=$(package)-$($(package)_version).tar.gz
55
$(package)_sha256_hash=ebb65ef6ca439333c2bb41a0c1990587288da07f6c7fd07cb3a18cc18d30ce19
66
$(package)_dependencies=
7-
$(package)_patches=1.0.15-pubkey-validation.diff 1.0.15-signature-validation.diff
7+
$(package)_patches=1.0.15-pubkey-validation.diff 1.0.15-signature-validation.diff 1.0.20-immintrin-conflict.diff
88
$(package)_config_opts=
99

1010
define $(package)_preprocess_cmds
1111
patch -p1 < $($(package)_patch_dir)/1.0.15-pubkey-validation.diff && \
1212
patch -p1 < $($(package)_patch_dir)/1.0.15-signature-validation.diff && \
13+
patch -p1 < $($(package)_patch_dir)/1.0.20-immintrin-conflict.diff && \
1314
cd $($(package)_build_subdir); DO_NOT_UPDATE_CONFIG_SCRIPTS=1 ./autogen.sh
1415
endef
1516

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
diff -ur libsodium-1.0.20-orig/src/libsodium/randombytes/internal/randombytes_internal_random.c libsodium-1.0.20/src/libsodium/randombytes/internal/randombytes_internal_random.c
2+
--- libsodium-1.0.20-orig/src/libsodium/randombytes/internal/randombytes_internal_random.c 2024-05-25 12:15:18.000000000 +0000
3+
+++ libsodium-1.0.20/src/libsodium/randombytes/internal/randombytes_internal_random.c 2024-09-26 18:11:50.173273070 +0000
4+
@@ -44,14 +44,6 @@
5+
#ifdef BLOCK_ON_DEV_RANDOM
6+
# include <poll.h>
7+
#endif
8+
-#ifdef HAVE_RDRAND
9+
-# ifdef __clang__
10+
-# pragma clang attribute push(__attribute__((target("rdrnd"))), apply_to = function)
11+
-# elif defined(__GNUC__)
12+
-# pragma GCC target("rdrnd")
13+
-# endif
14+
-# include <immintrin.h>
15+
-#endif
16+
17+
#include "core.h"
18+
#include "crypto_core_hchacha20.h"
19+
@@ -109,6 +101,15 @@
20+
# endif
21+
#endif
22+
23+
+#ifdef HAVE_RDRAND
24+
+# ifdef __clang__
25+
+# pragma clang attribute push(__attribute__((target("rdrnd"))), apply_to = function)
26+
+# elif defined(__GNUC__)
27+
+# pragma GCC target("rdrnd")
28+
+# endif
29+
+# include <immintrin.h>
30+
+#endif
31+
+
32+
typedef struct InternalRandomGlobal_ {
33+
int initialized;
34+
int random_data_source_fd;

0 commit comments

Comments
 (0)