I am attempting to cross compile from Windows to Linux using gcc-arm-9.2-2019.12-mingw-w64-i686-arm-none-linux-gnueabihf. We are building with static runtime lib using -static-libgcc and -static-libstdc++. Everything builds and appears to run, however, the static variables that should be initialized to a value appear to all still be 0. I assume that the initialization of the crt isn't occurring, but I'm not sure how to fix that. We've been building this same setup on Linux directly with distro provided arm-linux-gnueabihf toolchains without issue in the past. This is our first attempt to build with this toolchain from Windows. Does anyone have experience with something similar?
Apologies. I thought the difference was just between the toolchains, but there was a very subtle difference in the link order between how the two versions were being built that lead to an initialization order conflict.