On 26 Oct 2004 at 0:05, Adriaan van Os wrote:
To my surprise and joy, I managed to build a Mac OS X hosted cross compiler targeting Windows (MingW).
I used the information found at (or through) http://www.mingw.org/mingwfaq.shtml, more specifically http://www.libsdl.org/extras/win32/cross/README.txt. With some necessary modifications, the http://www.libsdl.org/extras/win32/cross/build-cross.sh script was able to build cross binutils, as well as gcc and gpc cross compilers.
The actual build was done with gpc 20041017 and gcc-3.3.3-200402017-1 (mingw special).
With Mingw, you'd be advised to stick with gcc-3.2.3 until the predefines issue is sorted out.
I hope, I will find time (in a few weeks) to add binaries, sources and a build script for the cross compiler to my website.
The cross compiler swallows hello.pas and the resulting binary actually does say "Hello, World" at the other side of the fence. However, the question arises how reliable the cross-compiler is, as the testsuite says "if this is a cross-compiler, you can't run the test suite easily".
AFAICS you can only build a Mingw GNU compiler with a cross compiler. Even the Mingw-MSYS environment is a cross compiler, since, it is simply a fork of the Cygwin project, relies on a (large) DLL to provide the POSIX emulation, and has its own "native" binaries (i.e., that rely on the DLL). So whether a cross-compiler is reliable or not depends on which cross compiler. Some (e.g., MSYS) are reliable, and I am sure that there are some that are not.
Is it reasonable to rely on native testsuite results on both the host and the target ?
AFAIK you cannot run a "native" Mingw testsuite, since the testsuite (from what I can see - I may be wrong) requires at least (ba)sh and one or two things, for which there are no native Windows versions that can hack it.
As far as "cross compilers" go, I once handcrafted one for building Mingw compilers (simple job of replacing the files in the 'include' and 'lib' directories, and 'libgcc.a' and such, with the Mingw versions. Worked like a dream - and it only took me a few minutes to achieve. Maybe it was so easy because it was a Cygwin toolchain that I emasculated so - but I doubt it.
Best regards, The Chief --------- Prof. Abimbola Olowofoyeku (The African Chief) Web: http://www.greatchief.plus.com/