diff options
| author | Wladimir J. van der Laan <[email protected]> | 2018-07-09 15:05:40 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2018-07-09 15:55:32 +0200 |
| commit | b55f0c31d461e9f7d3769adc4f06d1a1bb637086 (patch) | |
| tree | 7871a1f5cce1a1b1a04f0b602cf56331c7dab1c1 /src | |
| parent | Merge #13564: [wallet] loadwallet shouldn't create new wallets. (diff) | |
| parent | Use __cpuid_count for gnu C to avoid gitian build fail. (diff) | |
| download | discoin-b55f0c31d461e9f7d3769adc4f06d1a1bb637086.tar.xz discoin-b55f0c31d461e9f7d3769adc4f06d1a1bb637086.zip | |
Merge #13611: [bugfix] Use __cpuid_count for gnu C to avoid gitian build fail.
63c16ed50770bc3d4f0ecd2ffa971fcfa0688494 Use __cpuid_count for gnu C to avoid gitian build fail. (Chun Kuan Lee)
Pull request description:
Fixes #13538
Tree-SHA512: 161ae4db022288ae8631a166eaea2d08cf2c90bcd27218a094a754276de30b92ca9cfb5a79aa899c5a9d0534c5d7261037e7e915e1b92bc7067ab1539dc2b51e
Diffstat (limited to 'src')
| -rw-r--r-- | src/crypto/sha256.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/crypto/sha256.cpp b/src/crypto/sha256.cpp index e62ddc125..3f02a05aa 100644 --- a/src/crypto/sha256.cpp +++ b/src/crypto/sha256.cpp @@ -9,7 +9,7 @@ #include <string.h> #include <atomic> -#if defined(__x86_64__) || defined(__amd64__) +#if defined(__x86_64__) || defined(__amd64__) || defined(__i386__) #if defined(USE_ASM) #include <cpuid.h> namespace sha256_sse4 @@ -534,7 +534,11 @@ bool SelfTest() { // We can't use cpuid.h's __get_cpuid as it does not support subleafs. void inline cpuid(uint32_t leaf, uint32_t subleaf, uint32_t& a, uint32_t& b, uint32_t& c, uint32_t& d) { +#ifdef __GNUC__ + __cpuid_count(leaf, subleaf, a, b, c, d); +#else __asm__ ("cpuid" : "=a"(a), "=b"(b), "=c"(c), "=d"(d) : "0"(leaf), "2"(subleaf)); +#endif } /** Check whether the OS has enabled AVX registers. */ |