rbx needs to be stashed in a 64bit register on 64bit platforms. With this crash in particular, it was holding a stack canary which was not properly restored after the cpuid.
Split out the x86+PIC case so that x86_64 doesn't have to worry about it.
utACK b9b87481fd69e5caa15f580a19a5e0a58ad5f6a6
rbx needs to be stashed in a 64bit register on 64bit platforms. With this crash
in particular, it was holding a stack canary which was not properly restored
after the cpuid.
Split out the x86+PIC case so that x86_64 doesn't have to worry about it.
72 | @@ -73,9 +73,15 @@ static constexpr uint32_t CPUID_F1_ECX_RDRAND = 0x40000000;
73 | static void RDRandInit()
74 | {
75 | //! When calling cpuid function #1, ecx register will have this set if RDRAND is available.
While you're at it, can you move this comment down to after the #endif? It's intended to clarify the CPUID_F1_ECX_RDRAND constant.
Done
tested ACK 9af207c810b5c4b09ccbdec75582b3e34e32e8cc (OSX 10.12 only) full static build via gitian: https://bitcoin.jonasschnelli.ch/build/181 Confirmed that it fixes #10611
utACK 9af207c810b5c4b09ccbdec75582b3e34e32e8cc
utACK