This article is pretty much our own personal notes for when we inevitably corrupt our installation or write random sectors to a hard drive. In some ways, we treat linux as a canvas that occasionally gets painted over – not a big deal, but it’s painful to try to remember all the little tricks that are needed in order to get from square 1 to where you’d like to be.
So assuming a fresh linux install (here: FC11), and more specifically a live-usb mini install, here’s our notes on getting to a freshly cross-compiled arm toolchain for the spmp3050 processor. Almost everything you see here is done in a terminal window, so if you don’t know how to do that please shut down your PC and install Windows. No, just kidding – in Fedora it’s under
Applications -> System Tools -> Terminal
Step 0 – make yourself passwordless sudo access for the lazy.
Some may complain about security issues, but for a home pc it should not be an issue. You are born with a finite number of keystrokes in each finger, so enlessly typing sudo passwords is just bringing you closer to death. To avoid this untimely demise, you can add yourself as a sudoer with no password required. Use su to get root access, then edit the sudoers file with visudo. Remember, when using vi the i key is used for insert mode and esc gets out. :wq to write and quit. Go down to the section where it gives access to root:
root ALL=(ALL) ALL
and add a second line right below with your username and NOPASSWD:
root ALL=(ALL) ALL
myusername ALL=(ALL) NOPASSWD: ALL
Write, quit, and now you can sudo like mad
Step 1 – Get the required development tools and doodads.
sudo when needed or just root up for Step 1.
yum install gcc
yum install svn
yum install wget
yum install apt
yum install yum-utils
Which should set you up with pretty much everything you need
Step 3 – Build the required GMP and MPFR libraries
Download the bz2 archives of GMP from here and MPFR from here. Save them in a temporary working directory – we will install them after build is done so their present location is not important.
Unpack each into it’s own directory with:
tar -jxf gmp-*.tar.bz2
tar -jxf mpfr-*.tar.bz2
This wil give you a gmp-x.x.x directory and a mpfr-y.y.y directory. cd into the gmp directory and run the following commands. Each one will do a lot of work, so just sit back and enjoy the fact that you’re not doing it manually.
Of course, if anything fails you cannot continue, but let’s assume the configure and make are easy. Pay attention to the make check command, as this will test whether your libraries are built properly or not. Out of the box, we found gmp compiled with no issues.
Once gmp passes make check, then you can install it to the main lib directories by using
sudo make install
And yes – you must be sudo or root to install to those dirs. Done with GMP? Great!
cd back down and now cd into the MPFR directory. In a perfect world, you’d use the same ./configure, make, make check and be done. But in our case, make check failed 2 of 146 tests. Good enough? NO! We eventually found a solution on this page which we will describe here in case that page ever disappears. You will need to set some CFLAGS before the configure, which is done by appending an export onto your configure statement. The modified statements are now:
export CFLAGS=”-fPIC” && ./configure
And if everything passed during the make check, install with
sudo make install
Step 4 – Get libspmp3050 source and Avoozl’s awesome toolchain script
Use SVN to fetch a copy of the libspmp3050 and put it in a directory of your choosing. Assuming you’re in home and you’d like it in /libspmp the SVN command would be
svn checkout http://libspmp3050.googlecode.com/svn/trunk libspmp
This will go and fetch you a copy of the code and write it to ./libspmp.
Step 5 – Start the toolchain build script
First, navigate to the toolchain directory. Assuming you are still in the same directory as when you checked it out the command would be
And fire the build script
This guy will chug away for a while (about 20 minutes on a beater aspire one), so you can go enjoy a cold beer (you’ll need it whether it succeds or fails) or just sit back and marvel at all the work you don’t have to do by hand. At this point, if you’ve gotten no errors, you should have a working toolchain, congrats! If you used the default builder.sh script then you’ll have a path called /install that contains the software in /bin. From home, the quick test would be
To get a gratifying screen full of tasty info to prove your hard work is done, master compiler.