Skip to content

Commit

Permalink
Merge pull request zcash#6953 from str4d/6922-fix-windows-build
Browse files Browse the repository at this point in the history
Fix Windows build
  • Loading branch information
str4d authored Sep 26, 2024
2 parents b5505ea + 8c8df86 commit 1c0c425
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 3 deletions.
4 changes: 2 additions & 2 deletions depends/packages/libcxx.mk
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package=libcxx
$(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)))
$(package)_msys2_version=18.1.8-1
$(package)_msys2_version=18.1.6-1

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

define $(package)_stage_cmds
mkdir -p $($(package)_staging_prefix_dir)/lib && \
Expand Down
3 changes: 2 additions & 1 deletion depends/packages/libsodium.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ $(package)_download_path=https://download.libsodium.org/libsodium/releases/
$(package)_file_name=$(package)-$($(package)_version).tar.gz
$(package)_sha256_hash=ebb65ef6ca439333c2bb41a0c1990587288da07f6c7fd07cb3a18cc18d30ce19
$(package)_dependencies=
$(package)_patches=1.0.15-pubkey-validation.diff 1.0.15-signature-validation.diff
$(package)_patches=1.0.15-pubkey-validation.diff 1.0.15-signature-validation.diff 1.0.20-immintrin-conflict.diff
$(package)_config_opts=

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

Expand Down
34 changes: 34 additions & 0 deletions depends/patches/libsodium/1.0.20-immintrin-conflict.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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
--- libsodium-1.0.20-orig/src/libsodium/randombytes/internal/randombytes_internal_random.c 2024-05-25 12:15:18.000000000 +0000
+++ libsodium-1.0.20/src/libsodium/randombytes/internal/randombytes_internal_random.c 2024-09-26 18:11:50.173273070 +0000
@@ -44,14 +44,6 @@
#ifdef BLOCK_ON_DEV_RANDOM
# include <poll.h>
#endif
-#ifdef HAVE_RDRAND
-# ifdef __clang__
-# pragma clang attribute push(__attribute__((target("rdrnd"))), apply_to = function)
-# elif defined(__GNUC__)
-# pragma GCC target("rdrnd")
-# endif
-# include <immintrin.h>
-#endif

#include "core.h"
#include "crypto_core_hchacha20.h"
@@ -109,6 +101,15 @@
# endif
#endif

+#ifdef HAVE_RDRAND
+# ifdef __clang__
+# pragma clang attribute push(__attribute__((target("rdrnd"))), apply_to = function)
+# elif defined(__GNUC__)
+# pragma GCC target("rdrnd")
+# endif
+# include <immintrin.h>
+#endif
+
typedef struct InternalRandomGlobal_ {
int initialized;
int random_data_source_fd;

0 comments on commit 1c0c425

Please sign in to comment.