Adriaan van Os wrote:
To my surprise and joy, I managed to build a Mac OS X hosted cross compiler targeting Windows (MingW).
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". Is it reasonable to rely on native testsuite results on both the host and the target ?
I would expect the cross-compiler to be reasonbly reliable. First, if "native" MingW compiler works correcty the remaining problems come from non-portablity of gcc/gpc code and things like mixing host and target characteristics. Gcc is frequently used as a cross-compiler, so I would expect only few problems in the backend. I know of two things which are not "right" in the gpc front end, but both should be harmless for you (ppc/Mac OS X is similar enough to i386/MingW :).
Still, if you have Windows machine handy (and enough disk space) you can run the compilation on Mac OS X and then run the resulting executables on Windows. Some time ago I modified the test script to use wine (or dosemu) to run the executables so I could test cross-compilers on i386/Linux. I had to skip tests which used custom "compile/run" script, but it was easy to handle the rest. On Mac OS X you could just copy the MingW executables to some safe place and later run them on Windows. There is a little work since you want to check for failed compilation on host. Also on target you still need the test script to set up input and check for correct output.
My change to 'test_run' was basically to call a hook (shell function) to run exectables (intead of invoking them directly). Maybe we should include such change in reased version? By default the testsuite would run the same as now, but (say) setting environment variable we could change the behaviour.