[Python-Dev] Unable to build regex module against Python 3.5 32-bit

MRAB python at mrabarnett.plus.com
Tue May 26 01:34:35 CEST 2015


On 2015-05-25 22:59, Paul Moore wrote:
 > On 25 May 2015 at 21:06, MRAB <python at mrabarnett.plus.com> wrote:
 > > As the subject says, I've been unable to build the regex module against
 > > Python 3.5b1 for 32-bit. MingGW says:
 > >
 > >     skipping incompatible .../libpython35.a when searching for 
-lpython35
 > >
 > > It builds without a problem against Python 3.5 for 64-bit.
 > >
 > > Any ideas? Should I just wait until beta 2?
 >
 > MinGW is (and always has been) only marginally supported,
 > unfortunately. I'd rather it didn't break totally for 3.5, but I am
 > anticipating some difficulties (there have been a lot of
 > compiler-related changes with 3.5).
 >
 > Could you raise a bug, including details of precisely how you tried to
 > build the module (presumably
 > https://pypi.python.org/pypi/regex/2015.05.10) and assign it to me?
 > I'll try to take a look and reproduce the issue. With luck, it may be
 > as simple as the wrong version of libpython35.a being picked up
 > somewhere.
 >
 > Just to check the obvious - you *are* using 32-bit Python 3.5b1 and a
 > 32-bit Mingw to build the 32-bit version, and 64-bit Python 3.5b1 and
 > a 64-bit Mingw to build the 64-bit one? (I.e., two installations of
 > Python and two of Mingw)
 >
I'm not sure what happened, but I'm now getting this for Python 3.5 
(32-bit):

C:\Python35(32-bit)\libs/libpython35.a(dsxbs01290.o):(.idata$7+0x0): 
undefined reference to `_head_C__build_cpython_PCBuild_win32_libpython35_a'
C:\Python35(32-bit)\libs/libpython35.a(dsxbs00283.o):(.idata$7+0x0): 
undefined reference to `_head_C__build_cpython_PCBuild_win32_libpython35_a'
C:\Python35(32-bit)\libs/libpython35.a(dsxbs00291.o):(.idata$7+0x0): 
undefined reference to `_head_C__build_cpython_PCBuild_win32_libpython35_a'
C:\Python35(32-bit)\libs/libpython35.a(dsxbs00273.o):(.idata$7+0x0): 
undefined reference to `_head_C__build_cpython_PCBuild_win32_libpython35_a'
C:\Python35(32-bit)\libs/libpython35.a(dsxbs00255.o):(.idata$7+0x0): 
undefined reference to `_head_C__build_cpython_PCBuild_win32_libpython35_a'
C:\Python35(32-bit)\libs/libpython35.a(dsxbs01280.o):(.idata$7+0x0): 
more undefined references to 
`_head_C__build_cpython_PCBuild_win32_libpython35_a' follow
collect2: ld returned 1 exit status


All other builds, from Python 2.5 to Python 3.4, both 32-bit and 64-bit, 
and also Python 3.5 (64-bit), work.

The 32-bit Python says it's 32-bit and the 64-bit Python says it's 64-bit.

---8<---

C:

rem Compile for Python 3.5 (64-bit) [works]
cd C:\MinGW64\bin
"C:\MinGW64\bin\gcc.exe" -mdll -m64 -DMS_WIN64 -O2 -Wall -Wsign-compare 
-Wconversion -I"C:\Python35\include" -c 
"D:\projects\mrab-regex\regex_3\regex\_regex_unicode.c" -o 
"D:\projects\mrab-regex\regex_3\Release(3.5)\_regex_unicode.o"
"C:\MinGW64\bin\gcc.exe" -mdll -m64 -DMS_WIN64 -O2 -Wall -Wsign-compare 
-Wconversion -I"C:\Python35\include" -c 
"D:\projects\mrab-regex\regex_3\regex\_regex.c" -o 
"D:\projects\mrab-regex\regex_3\Release(3.5)\_regex.o"
"C:\MinGW64\bin\gcc.exe" -m64 -shared -s 
"D:\projects\mrab-regex\regex_3\Release(3.5)\_regex_unicode.o" 
"D:\projects\mrab-regex\regex_3\Release(3.5)\_regex.o" 
-L"C:\Python35\libs" -lpython35 -o 
"D:\projects\mrab-regex\regex_3\Release(3.5)\_regex.pyd"

rem Compile for Python 3.5 (32-bit) [fails]
cd C:\MinGW\bin
"C:\MinGW\bin\gcc.exe" -mdll -m32  -O2 -Wall -Wsign-compare -Wconversion 
-I"C:\Python35(32-bit)\include" -c 
"D:\projects\mrab-regex\regex_3\regex\_regex_unicode.c" -o 
"D:\projects\mrab-regex\regex_3\Release(3.5)(32-bit)\_regex_unicode.o"
"C:\MinGW\bin\gcc.exe" -mdll -m32  -O2 -Wall -Wsign-compare -Wconversion 
-I"C:\Python35(32-bit)\include" -c 
"D:\projects\mrab-regex\regex_3\regex\_regex.c" -o 
"D:\projects\mrab-regex\regex_3\Release(3.5)(32-bit)\_regex.o"
"C:\MinGW\bin\gcc.exe" -m32 -shared -s 
"D:\projects\mrab-regex\regex_3\Release(3.5)(32-bit)\_regex_unicode.o" 
"D:\projects\mrab-regex\regex_3\Release(3.5)(32-bit)\_regex.o" 
-L"C:\Python35(32-bit)\libs" -lpython35 -o 
"D:\projects\mrab-regex\regex_3\Release(3.5)(32-bit)\_regex.pyd"

---8<---




More information about the Python-Dev mailing list