UB encountered a bad interaction where artifacts from the host environment cross-pollinated into the cross-compile environment. It resulted in a failed compile.
The fix is to actually set the variables in the setenv-*.sh scripts, and modify GNUmakefile-cross to use those variables. It will avoid host environment cross-pollination by setting all variables to a known state.
We made that change at https://github.com/weidai11/cryptopp/issues/1014. As a side effect, you can use the setenv-*.sh for any project, and not just Crypto++. For example, it will work with Autotools projects.
Jeff