Building binutils

  1. Change the current directory to the ~/cygwin/src directory:

user@crosshost ~/cygwin $ cd ~/cygwin/src/
  2. Extract the binutils archive:

user@crosshost ~/cygwin/src $ tar jxf binutils-2.20.51-2-src.tar.bz2
  3. Create a ~/cygwin/build/binutils-2.20.51-2/ directory and change the current directory to that directory:

user@crosshost ~/cygwin/src $ mkdir -p ~/cygwin/build/binutils-2.20.51-2
    user@crosshost ~/cygwin/src $ cd -p ~/cygwin/build/binutils-2.20.51-2
  4. Configure binutils:

user@crosshost ~/cygwin/build/binutils-2.20.51-2/build $ ../../src/binutils-2.20.51-2/configure --prefix=/home/user/cygwin --target=i686-pc-cygwin 2>&1 | tee configure.log
    • The Cygwin binutils source tarball doesn't seem to record the configuration used to build the Cygwin binary package.

  5. Build binutils:

user@crosshost ~/cygwin/build/binutils-2.20.51-2/build $ make all 2>&1 | tee all.log
  6. Install binutils:

user@crosshost ~/cygwin/build/binutils-2.20.51-2/build $ make install 2>&1 | tee install.log
  7. Modify the PATH environment variable to include the directories that the binutils executables were installed in, so they are available when we build GCC:

user@crosshost ~/cygwin/build/binutils-2.20.51-2/build $ export PATH=~/cygwin/bin:$PATH