[Numpy-discussion] Cross compile flags for tdm-gcc on mingw

Jonathan Wright jonathan.wright.public@gmail....
Wed Mar 9 02:59:28 CST 2011


Hi folks,

I was compiling some extensions for 32-bit python 2.5 on windows using a 64
bit gcc compiler (4.5.1). After a bit of head scratching it seems that I
needed to patch numpy/distutils/mingw32ccompiler.py to add the following
flags around where it says "set_executables":

 -m32 -static-libgcc

The first flag means I want 32 bit code, the second one is to link lib-gcc
as a static library. Seems the static library part might prevent C++
exceptions being passed across dll boundaries, but I don't really know about
that, and I have an irrational fear of missing dlls.

Anyway, the -m32 option could be useful for other folks when it is
appropriate. The static versus dynamic libgcc story would depend on what the
actual answer is for exception passing. My vote would be static; since this
didn't work in the past, what will be broken?

Do these seem to be worth fixing? Python2.5 is quite old now...

Cheers,

Jon
---


C:\Users\wright\Programming\fable\ImageD11\test\demo>gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=c:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.5.1/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../../src/gcc-4.5.1/configure
--prefix=/crossdev/prefix-tdm64 -
-build=x86_64-w64-mingw32 --enable-targets=all --enable-libgomp --enable-lto
--e
nable-libstdcxx-debug --enable-languages=c,c++,fortran,objc,obj-c++
--disable-we
rror --disable-nls --disable-win32-registry
--enable-version-specific-runtime-li
bs --enable-fully-dynamic-string --with-pkgversion=tdm64-1
--with-bugurl=http://
tdm-gcc.tdragon.net/bugs
Thread model: win32
gcc version 4.5.1 (tdm64-1)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20110309/28bd05fe/attachment-0001.html 


More information about the NumPy-Discussion mailing list