I study microprocessor architectures for fun. One of the steps necessary to studying microprocessors is to have the necessary compilers to compile software for the microprocessor. The nature of the code generated reveals quite a lot of underlying detail about a microprocessor.
In order to compile software for another processor architecture, what is needed is a ‘cross-compiler’. Such a thing will allow a computer running on an Intel/AMD machine to compile software for other non-Intel/non-AMD processors (like the ARM processor that runs software for your mobile phone).
So, I have wasted the last few days trying to compile a number of cross-compilers for several microprocessor architectures. For some reason, they fail to compile and the failure is often due to a ‘buffer overflow’ error.
*** buffer overflow detected ***: mb-ar terminated
======= Backtrace: =========
Turns out, that the problem is due to a new feature introduced in the GCC compiler used in Ubuntu 8.10. It checks things during compilation to prevent potential problems when running the software. The simplest fix was to down-grade the GCC compiler on the system, which did the trick.
The reason that it took me so long to spot this problem was because, compiling cross-compilers has always been a tricky issue. It is sensitive to the combination of tools and versions selected, as well as the target and host architectures. So, I didn’t realise that something was amiss until something that should have worked right out of the box, did not.
So, it wasn’t a problem on my end at all. I guess that I’ll have to try to compile the cross compilers again. I’m trying to compile cross-compilers for the MIPS and M68K architectures (in addition to the one above). If it all works, I’ll be terribly happy.