-
Notifications
You must be signed in to change notification settings - Fork 137
MIPS binutils
For creating MIPS test traces we use GNU binutils: assembler, linker, and objdump. Usually they are provided for the same architecture as a host machine, but we can build them for cross-compiling, ie generating MIPS programs on x86 machines.
This cheat-sheet is based on this following instruction: http://www.linux-mips.org/wiki/Toolchains#Roll-your-own. See it if you have any problem or need more information.
Note: this instruction works only for Linux machines. It was verified on Ubuntu 12.04.1 LTS (GNU/Linux 2.6.32-042stab084.26 x86_64) . |
---|
- Binutils sources are available as submodule in MIPT-MIPS:
git submodule init
git submodule update
cd binutils
- Create a folder where the binutils will be installed (can be any):
mkdir /opt/cross
- Create a folder for a build process (can be any):
cd /tmp
mkdir build-binutils && cd build-binutils
- Configure build (can dump a lot of info):
/path/to/binutils/configure --target=mipsel-unknown-linux-gnu --prefix=/opt/cross --disable-gprof --disable-gdb
Note that we disabled build of gprof
and gdb
as we do not use them.
- Make sources (can dump a lot of info):
make
- Install (can dump a lot of info):
make install
After that you should now have the cross-binutils installed under /opt/cross/bin/
with names prefixed by mipsel-unknown-linux-gnu-
.
It is convenient to give a short name to MIPS Binutils binaries. We suggest to put a short symlink into /usr/bin/
, which also make the tools visible without modification of the $PATH
.
For example:
cd /usr/bin
ln -s /opt/cross/bin/mipsel-unknown-linux-gnu-as mips-as
ln -s /opt/cross/bin/mipsel-unknown-linux-gnu-ld mips-ld
ln -s /opt/cross/bin/mipsel-unknown-linux-gnu-objdump mips-objdump
MIPT-V / MIPT-MIPS — Cycle-accurate pre-silicon simulation.