you have to stick to the very same toolchain from start to end, you must not mix outputs from different compilers. (which is the correct one, depends on the platform you want to run it later. )
maybe pick a lower hanging fruit, than going through this build hell