This will fix the crypto_tests failure on 32-bits platforms.
Backport of core PR15983:
https://github.com/bitcoin/bitcoin/pull/15983/files
With CMake the flag is set for C++ as well as C, while autotools only
has the C++ flag. This is on purpose as the bug is also affecting gcc
and not only g++. I ran the benchmarks and this caused no noticeable
runtime difference.
Fun fact: you can also get rid of the bug by disabling the optimizations
(i.e. build with debug enabled).