Here is a quick update on where I am with OpenTTD. After doing the first build a few weeks ago I spent some time playing the game and quickly realised there was a show stopping bug. When you wanted to destroy a piece of rail track the cost was several billion, essentially making it impossible for you to remove track. The correct behaviour is that you are refunded ¾ of the build cost.
I have been consulting the OpenTTD developers on their forum here. I managed to find the exact line of code causing the problem, but it has turned out to be a compiler inline optimisation issue. So even if I fix that line of code there would be an unknown number of other places in the code that could produce a similar problem and finding them all would be a nightmare. The thing to do in this situation is to fix the compiler.
The issue is apparently fixed in GCC 4.6, unfortunately 4.5 is only available in the Debian image I am using. I have done a build using 4.5 but with the no inline optimisations flag and this does fix the issue, although performance is slightly compromised. The ideal would be for me to compile on 4.6 using raspbian, but the problem then is dependency issues when trying to run the executable on the popular Debian image. So it’s a bit of a pain right now. But I’ll keep trying.
Explaining what a comiler issue actually is to someone can be difficult, but I have found this image helps a lot.