Created attachment 201564 [details] patch The code for big-endian architectures is broken and doesn't compile. #define fix_endian64(dst_, src_) dst_ = ethash_swap_u64(src_ misses ) at the end of line. fix_endian_arr32 and fix_endian_arr64 are broken because of bad "while" placement. Unfortunately, I couldn't find what the issue is, so I just removed do while, which simplifies things. Another error is that for loop in fix_endian_arr{32,64} uses , instead of ;. Also remove const qualifier from nonce since it's actually modified and causes another build error (although Clang for some strange reason accepts it). Tested on powerpc64 and amd64. Hardware sponsored by IntegriCloud.
A commit references this bug: Author: vd Date: Thu Feb 7 19:29:37 UTC 2019 New revision: 492383 URL: https://svnweb.freebsd.org/changeset/ports/492383 Log: net-p2p/qtum: fix compilation on big-endian machines PR: 235358 Submitted by: Piotr Kubaj <pkubaj@anongoth.pl> Changes: head/net-p2p/qtum/files/ head/net-p2p/qtum/files/patch-src__cpp-ethereum__libethash__endian.h head/net-p2p/qtum/files/patch-src__cpp-ethereum__libethash__internal.c
(In reply to Piotr Kubaj from comment #0) I have committed your patch with some modifications. > The code for big-endian architectures is broken and doesn't compile. > > #define fix_endian64(dst_, src_) dst_ = ethash_swap_u64(src_ > misses ) at the end of line. > > fix_endian_arr32 and fix_endian_arr64 are broken because of bad "while" placement. > Unfortunately, I couldn't find what the issue is, so I just removed do while, > which simplifies things. The problem is/was that there was a missing } before the while keyword. The reason for the while is to enforce a ; after the macro call when using it. > Another error is that for loop in fix_endian_arr{32,64} uses , instead of ;. Doh :( > Also remove const qualifier from nonce since it's actually modified and causes > another build error (although Clang for some strange reason accepts it). It needed removing in just one place. Have you submitted these patches upstream? Thanks!
(In reply to Vasil Dimov from comment #2) I have just now sent two PR's with those patches.