Cross Compilation of the Windows Toolchain
In re-examining the Windows port of the mc9s12x tool-chain our toolchain packagers (David) discovered differences in the output (s19’s didn’t match, other discrepencies, code appeared to work, but was slower, different arguments to the assembler from GCC). It turns out the Windows port of the ToolChain had some significant issues, specifically that the GCC that was built was missing a key patch that is properly applied to the Linux tool-chains (the Linux Tool-Chains are A-OK).
To build the new toolchain it was necessary to re-setup the Cross compilation environment (You need a good working copy of mingw), so here’s what we did (Done on an Ubuntu 14.04 64 bit system, though this is applicable to any recent 64 bit linux distro).
Follow the instructions from: http://www.blogcompiler.com/2010/07/11/compile-for-windows-on-linux/ for installing the MingW cross-compilers
Specific packages used:
64 bit target: mingw-w64-bin_x86_64-linux_20131227.tar.bz2
32 bit target: mingw-w32-bin_x86_64-linux_20131227.tar.bz2
create /opt/mingw32 and /opt/mingw64 and untar the applicable file from above within each directory.
Our windows toolchain package builder script https://gitlab.com/libreems-suite/mc9s12x-windows-toolchain-builder.git is used to build the toolchain for windows. It is setup mainly for the author’s machine and makes certain assumptions (i.e. it requires Wine and that wine instance needs to have inno-setup (a free tool) installed in it) in order to build the final windows self-extracting exe file.
Pre-built windows toolchain binaries are available at: http://builds.libreems.org/ToolChains/Windows/