Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Digest fallback when using llvm-mingw on Windows #88

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
nimcache
*.exe
build/
*.paths
4 changes: 4 additions & 0 deletions config.nims
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# begin Nimble config (version 1)
when fileExists("nimble.paths"):
include "nimble.paths"
# end Nimble config
7 changes: 5 additions & 2 deletions ssz_serialization/digest.nim
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
# at your option. This file may not be copied, modified, or distributed except according to those terms.

import nimcrypto/[hash, sha2], stew/ptrops, ./types
import std/strutils, nimcrypto/[hash, sha2], stew/ptrops, ./types

# Depending on platform, we have several SHA256 implementations to choose from:
# * nimcrypto is pure nim and used for compile-time evaluation and fallback
Expand Down Expand Up @@ -39,7 +39,10 @@ else:
type DigestCtx* = sha2.sha256

when PREFER_HASHTREE_SHA256 and (defined(arm64) or defined(amd64)) and (
((defined(linux) or defined(windows)) and defined(gcc)) or
(defined(linux) and defined(gcc)) or
# llvm-mingw doesn't support hashtree well even with "-fno-integrated-as"
# this is true with clang-17(19th June 2024).
(defined(windows) and defined(gcc) and "clang" notin staticExec("gcc --version")) or
(defined(linux) and defined(clang)) or
(defined(macosx) and defined(clang) and defined(arm64))
):
Expand Down
Loading