Building binutils for a specific target is pretty straightforward. If binutils is to be hosted on Windows, you will need to install MinGW/GCC and the Msys shell environment. Then from within a Linux bash shell or msys on Windows:
- Create a directory to build the tools ()
- Create a directory to which to install the tools ()
- Extract the binutils package into , hereafter refers to the binutils verion you are building, and is indicated in the package name (binutils-.tar.bz2)
- Working from , configure the package for the appropriate target and host:
../binutils-<version>/configure --target m32c-elf --prefix <installdir>
In Windows you can also add to the configure command line --enable-win32-registry=gnu_m32c
to allow path lookup via the registry. The toolchain name gnu_m32c
is arbitrary - you can call it what you like.
- Run
make
to build the tools.
- Run
make install-strip
to install the tools.
Note:
If you are installing on Windows and used the --enable-win32-registry
option but subsequently choose to move the installation, or are installing your pre-build tools on a new host, you will need to modify the registry to match; this can be done in regedit editing the key HKEY_LOCAL_MACHINE\SOFTWARE\Free Software Foundation\gnu_m32c
, adding/modifying the item:"BINUTILS"="<installdir>"
if you have installed GCC as well there are related keys:
"GCC"="<gccinstalldir>"
"G++"="<gppinstalldir>"