help for MIPS cross compiler

David Morris
Thu Jun 7 09:21:00 GMT 2001

I recently struggled mightily with getting a mips cross-compile
working.  While it was on Solaris instead of Cygwin, the script I came
up with is still probably of use to you...

My setup:

I extracted each of gcc, binutils, and newlib to the /usr/src
directory, from where I run the script.  Note that I use zsh for the
script which you probably don't have installed, so I changed the
script to bash.  This will break the logging, so you might want to
remove the use of log files (delete appropriate lines from the


I generally use the folloing invocation:

./ -G 2.95.3 -N 1.9.0 -B 2.10.1 -t target -p /usr/gnu/target -a#

Where you replace 'target' in the -t and -p options with the target
for your build, and replace "#" for a build number as defined in the
script (at the very bottom).

Generally, there are 12 steps to the full build:

Configure, Make, Install Binutils
Configure, Make, Install Core GCC (C only)
Configure, Make, Install Newlib (make fully functional C Compiler)
Configure, Make, Install Full GCC (I use only C & C++)

I have labeled these steps as a1 through a12 for purposes of the build
script, while the parameter "-a0" will run all 12 steps.

This script works for all mips-* targets I have tried, and should work
for all most other targets as well.

Remember, this script is primitive, and was not written with public
use in mind...merely to make my own life easier.  However, it does
list all the steps I needed to build a working compiler, and provide
a script to easily automate the task.

Note that to get the final step to build (C/C++ compiler "make all"
step), I had to play arround with a bit with file locations in the
gcc-2.95.3/gcc/cp directory, and gcc-2.95.3/libstdc++/stl directory.
If anyone is interested, I can post details on what went wrong and on
what I needed to do to fix it all...

Hope this helps...


More information about the crossgcc mailing list