But there is a feature of the PE executable file format used by Windows
to define hooks also in the case of static linking. Ramiro Polla sent a
patch that uses this approach. See
<http://sourceware.org/ml/pthreads-win32/2010/msg00006.html>.
If we're lucky, this already solves the problem. Can someone test this?
One problem might be that libraries which already call attach/detach
might run into problems, so we might need to be careful about the
PTW32_STATIC_LIB flag being defined in the header files.