Building Kernel API Headers in the Cygwin VM

  1. Update C:\Cygwin\opt\crosstool\src\build_cross_toolchain.sh :

    #!/bin/bash
    export TARGET=arm-linux-gnueabihf
    export PREFIX=/opt/crosstool/gcc-4.9.2-glibc-2.19/$TARGET
    export PATH=$PATH:$PREFIX/bin
    
    cd /opt/crosstool/src
    rm -rf build-linux
    cp -r linux-4.1.19 build-linux
    cd build-linux
    make ARCH=arm CROSS_COMPILE=$TARGET- \
        INSTALL_HDR_PATH=$PREFIX/usr headers_install
    find $PREFIX/usr/include -name '..install.cmd' -delete
    find $PREFIX/usr/include -name '.install' -delete
    
    echo "=== build script: OK ==="
    

  2. Run C:\Cygwin\opt\crosstool\src\build_cross_toolchain.cmd and wait until it completes.
  3. (Additional step to support SoftFP ABI): copy contents of C:\Cygwin\opt\crosstool\gcc-4.9.2-glibc-2.19\arm-linux-gnueabihf\usr\include folder to C:\Cygwin\opt\crosstool\gcc-4.9.2-glibc-2.19\arm-linux-gnueabi\usr\include
  4. If there are no errors, shutdown the Cygwin VM and make snapshot "SNAP-6".


>> Read next section or buy already prepared cross-compiler (€10) to save your time.