Building your own GNU toolchains
If you want to build your own GNU toolchain for Windows instead of downloading prebuilt ones, follow the steps described in this page.
In this example we will build GCC for embedded ARM (arm-eabi). You can alternatively use any other target supported by GCC.
1. Download MinGW and MSys packages.
2. Create a directory for building the toolchains. E.g. c:\gnu. In MinGW notation this will be /c/gnu.
3. Create a directory where the built toolchain will be installed. E.g. c:\gnu\out
4. Download a recent binutils source package from http://ftp.gnu.org/gnu/binutils/ and save it to c:\gnu.
5. Start MinGW shell from Start Menu.
6. Go to the directory with the binutils by running the following command:
7. Extract the binutils package
8. Create a build directory for binutils:
9. Go to the binutils directory
10. Configure binutils
Change MyToolchainName to any name you want to associate with your toolchain. If you move the toolchain to a different location you'll need to specify the new location in the registry:
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Free Software Foundation\MyToolchainName]
"GCC"="C:\\New-Location"
"BINUTILS"="C:\\New-Location"
"G++"="C:\\New-Location"
11. Build binutils
If you have a multi-core machine, you can speed up the build process by running several parallel build jobs. To do so, instead of "make" type:
Replace 16 with the amount of parallel jobs you want to have.
12. Install binutils to the output directory
The "install-strip" option is similar to "install", but it will remove debugging information from the binaries. Unless you want to debug the toolchain itself, always use it to save disk space.
13. Download GCC source from http://ftp.gnu.org/gnu/gcc/ and unpack it.
14. If you are building the "barebone" toolchain, you will most likely need newlib library. Download and unpack it from ftp://sources.redhat.com/pub/newlib/
15. Create a build directory for gcc and enter it
16. Configure GCC:
17. Build GCC:
18. Install GCC:
19. Create a build directory for newlib and enter it
20. Configure newlib
21. Build newlib:
22. Install newlib
23. Download GDB sources from ftp://sourceware.org/pub/gdb/releases/
24. Unpack GDB, create a build directory for it and enter it.
25. Configure GDB
26. Build GDB
27. Install GDB