I've done some more investigating on this and it's not as easy to solve as it first seems.
Gentoo stores libffi.so in /usr/lib/libffi and ffi.h in /usr/include/libffi which is fine, a small change to the build script lets it pick up the right files. The problem is that the libffi provided by Gentoo is out of date with respect to the current stable compiler so the built yhi seg faults.
From what I can gather from the Gentoo bugzilla some people want libffi removed from portage entirely. Libffi *might* be built if you enable to the gcj use flag when compiling gcc, it's a little unclear on that. I will try rebuilding my version of gcc with that flag over the weekend.
As the build system builds it's own libffi on Windows it shouldn't be too hard to do the same on other platforms, and I think that is the way forward. Where is the best place to get libffi from? I don't really want to have to download the whole of the gcc sourcecode...
Andrew