From 0901733f9bc63fc64c137680b8c5bed246be1da6 Mon Sep 17 00:00:00 2001 From: "Brian R. Bondy" Date: Sun, 28 Feb 2021 09:45:46 -0500 Subject: [PATCH] Fix keccak build for Windows --- third_party/ethash/BUILD.gn | 17 ++++------------- third_party/ethash/keccak_override.c | 10 ++++++++++ 2 files changed, 14 insertions(+), 13 deletions(-) create mode 100644 third_party/ethash/keccak_override.c diff --git a/third_party/ethash/BUILD.gn b/third_party/ethash/BUILD.gn index 8f3a8d55ca9..4264f8db24a 100644 --- a/third_party/ethash/BUILD.gn +++ b/third_party/ethash/BUILD.gn @@ -1,19 +1,10 @@ -source_set("ethash") { +static_library("ethash") { configs -= [ "//build/config/compiler:chromium_code" ] configs += [ "//build/config/compiler:no_chromium_code" ] include_dirs = [ "src/include" ] sources = [ - "src/lib/ethash/bit_manipulation.h", - "src/lib/ethash/builtins.h", - "src/lib/ethash/endianness.hpp", - "src/lib/ethash/ethash-internal.hpp", - "src/lib/ethash/ethash.cpp", - "src/lib/ethash/kiss99.hpp", - "src/lib/ethash/managed.cpp", - "src/lib/ethash/primes.c", - "src/lib/ethash/primes.h", - "src/lib/ethash/progpow.cpp", - "src/lib/keccak/keccak.c", - "src/lib/support/attributes.h", + "keccak_override.c", + "src/include/ethash/hash_types.h", + "src/include/ethash/keccak.h", ] } diff --git a/third_party/ethash/keccak_override.c b/third_party/ethash/keccak_override.c new file mode 100644 index 00000000000..bbdc01172e4 --- /dev/null +++ b/third_party/ethash/keccak_override.c @@ -0,0 +1,10 @@ +#include "build/build_config.h" + +// The use of __builtin_cpu_init is wrapped around an __X86_64__ ifdef. +// Since this isn't available in vc++ and since it's only needd on macOS, +// we exclude this block with the following hack. +#if defined(OS_WIN) +#undef __x86_64__ +#endif + +#include "src/lib/keccak/keccak.c"