world leader in high performance signal processing
Trace: » windows

Making a Windows Toolchain Release

This page is a subsection of the main release-creation page. So you should read & be familiar with all that content first.

We only create 32bit Windows toolchain packages at the moment. This is because it is only userspace programs, and Windows itself supports 32bit just fine in a 64bit install. The 64bit Windows cross-toolchain isn't as stable as the 32bit Windows cross-toolchain. It isn't worth the effort today to worry about a 64bit userspace port.

Also, while the normal toolchain build involves an old distro chroot to preserve binary compatibility, compilation of the Windows toolchain does not have that same limitation. The mingw cross-toolchain and Windows itself provides the backwards compatibility, and we avoid using shared libraries (dlls), so all the 3rd party packages are statically linked in. Quite the opposite actually; an up-to-date distribution is recommended.

Overview

The Windows toolchain requires a few steps:

  • install the standard Blackfin toolchain in /opt/uClinux-linux (can be anywhere but /opt/uClinux)
  • install the mingw packages (toolchain and nsis)
  • get 3rd party library sources
  • tweak the standard .spec file
  • run rpm on the modified .spec file
  • turn the RPMs into tarballs
  • unpack the tarballs into the nsis build dir
  • gather eclipse and usb drivers in the nsis build dir
  • build the nsis installer
  • upload it the website

Setup

Host

With the Blackfin Linux toolchain compiled, install it into /opt/uClinux-linux/. This exact path doesn't matter, but it cannot be /opt/uClinux/ as the Windows binaries will be installed there during the RPM build process.

You will need to install the mingw cross-compiler. If your distribution does not provide them for you (all major distros should), then you'll need to build and/or download a binary one yourself. Doing either is outside of the scope of this document and not worth the hassle of learning. In the rest of the document we'll assume the toolchain has a prefix of mingw32, but if your distro uses something else like i586-mingw32msvc, substitute as appropriate.

You will also need to install nsis as this program is used to build the Windows installer (the .exe people run under Windows). Again, all major distros should already provide a package for you. If yours doesn't, install a real distribution.

Mingw Setup

There are a few 3rd party packages you will need to obtain:

  • expat
  • libusb-winusb
  • pdcurses
  • pthreads

The other libraries (gmp, mpfr, libftdi, readline, and zlib) are already integrated into the normal toolchain sources.

You can get the correct tarballs by going into the root of the toolchain svn tree and running:

tar jcf libusb-winusb.tar.bz2 libusb-winusb --exclude=.svn
wget 'http://blackfin.uclinux.org/git/?p=users/vapier/pthreads-win32.git;a=snapshot;h=64bit;sf=tbz2' -O pthreads-windows.tar.bz2

Then move all of these into the build chroot like the normal source tarballs:

mv *.tar.bz2 </path/to/chroot>/usr/src/rpm/SOURCES/
cp distribution/windows/Prerequisites/*.tar.gz </path/to/chroot>/usr/src/rpm/SOURCES/

Spec Tweaking

The RPM .spec file has a few tweaks at the top of it to assist with Windows compilation. You should only need to change windows_build to 1 and mingw_prefix to match the toolchain prefix your distro is using for the Windows cross-compiler.

RPM Creation

Now run RPM like normal. See release-creation.

Once the RPMs are created, convert them to tarballs with rpm2targz.

Unpack those tarballs into the toolchain scm tree at distributions/windows/. You will want the toolchain dirs to be like distributions/windows/bfin-elf/ and such.

USB Drivers

We include Windows drivers for some ICEs. When you build the NSIS installer in the next step (see below), the gnICE-drivers.zip archive will be created automatically for you by the Makefile in the distributions/windows/ tree.

NSIS Installer

With the toolchain in place, you can build the NSIS installer:

make VERSION=2010R1

This will create the standalone exe in the working dir named like blackfin-toolchain-win32-2010R1.exe. Move this over to a Windows system and test it out.

Upload

Upload this file like other toolchain releases; see release-creation.