This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: _io build fails on cygwin
Type: compile error Stage: resolved
Components: Extension Modules Versions: Python 3.2, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, luch, pitrou, python-dev
Priority: normal Keywords:

Created on 2012-03-29 10:42 by luch, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (8)
msg157024 - (view) Author: Alexey Luchko (luch) Date: 2012-03-29 10:42
$ make
...
gcc -shared -Wl,--enable-auto-image-base build/temp.cygwin-1.7.11-i686-2.7/Python-2.7.3rc2/Modules/_io/bufferedio.o build/temp.cygwin-1.7.11-i686-2.7/Python-2.7.3rc2/Modules/_io/bytesio.o build/temp.cygwin-1.7.11-i686-2.7/Python-2.7.3rc2/Modules/_io/fileio.o build/temp.cygwin-1.7.11-i686-2.7/Python-2.7.3rc2/Modules/_io/iobase.o build/temp.cygwin-1.7.11-i686-2.7/Python-2.7.3rc2/Modules/_io/_iomodule.o build/temp.cygwin-1.7.11-i686-2.7/Python-2.7.3rc2/Modules/_io/stringio.o build/temp.cygwin-1.7.11-i686-2.7/Python-2.7.3rc2/Modules/_io/textio.o -L/usr/local/lib -L. -lpython2.7 -o build/lib.cygwin-1.7.11-i686-2.7/_io.dll
build/temp.cygwin-1.7.11-i686-2.7/Python-2.7.3rc2/Modules/_io/bufferedio.o: In function `_set_BlockingIOError':
/Python-2.7.3rc2/Modules/_io/bufferedio.c:579: undefined reference to `__imp__PyExc_BlockingIOError'
/Python-2.7.3rc2/Modules/_io/bufferedio.c:579: undefined reference to `__imp__PyExc_BlockingIOError'
build/temp.cygwin-1.7.11-i686-2.7/Python-2.7.3rc2/Modules/_io/bufferedio.o: In function `_buffered_check_blocking_error':
/Python-2.7.3rc2/Modules/_io/bufferedio.c:595: undefined reference to `__imp__PyExc_BlockingIOError'
collect2: ld returned 1 exit status 


CYGWIN_NT-6.1-WOW64 ... 1.7.11(0.260/5/3) 2012-02-24 14:05 i686 Cygwin
gcc version 4.5.3 (GCC)
msg157025 - (view) Author: Alexey Luchko (luch) Date: 2012-03-29 10:43
The error got building Python 2.7.2 & 2.7.3rc2
msg157029 - (view) Author: Alexey Luchko (luch) Date: 2012-03-29 11:08
Checked solution by David Robinow
http://mail.python.org/pipermail/python-list/2012-March/1290038.html

It works.  Diff follows: """
--- Modules/_io/_iomodule.h.orig        2012-03-16 03:26:36.000000000 +0200
+++ Modules/_io/_iomodule.h     2012-03-29 13:54:07.094187600 +0300
@@ -72,7 +72,7 @@
     PyObject *filename; /* Not used, but part of the IOError object */
     Py_ssize_t written;
 } PyBlockingIOErrorObject;
-PyAPI_DATA(PyObject *) PyExc_BlockingIOError;
+PyObject * PyExc_BlockingIOError;

 /*
  * Offset type for positioning.
"""
msg157035 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2012-03-29 11:42
The proposed patch is correct; no extension module should use PyAPI_ for its own symbols.
msg157231 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-03-31 21:58
New changeset f96b603278cc by Antoine Pitrou in branch '3.2':
Issue #14437: Fix building the _io module under Cygwin.
http://hg.python.org/cpython/rev/f96b603278cc

New changeset 6f8dd543d80a by Antoine Pitrou in branch '2.7':
Issue #14437: Fix building the _io module under Cygwin.
http://hg.python.org/cpython/rev/6f8dd543d80a
msg157232 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-03-31 21:58
Fix committed in 2.7 and 3.2. 3.3 shouldn't be affected. Thank you!
msg158461 - (view) Author: Alexey Luchko (luch) Date: 2012-04-16 15:06
Final 2.7.3 didn't get the fix.
Checked http://python.org/ftp/python/2.7.3/Python-2.7.3.tar.xz
msg158475 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2012-04-16 15:49
Yes, the 2.7.3 branch was cut long before the fix (end of February) so it was not included.
History
Date User Action Args
2022-04-11 14:57:28adminsetgithub: 58642
2012-04-16 15:49:29amaury.forgeotdarcsetmessages: + msg158475
2012-04-16 15:06:14luchsetmessages: + msg158461
2012-03-31 21:58:47pitrousetstatus: open -> closed

versions: - Python 3.3
nosy: + pitrou

messages: + msg157232
resolution: fixed
stage: commit review -> resolved
2012-03-31 21:58:16python-devsetnosy: + python-dev
messages: + msg157231
2012-03-29 16:06:52pitrousetstage: commit review
versions: + Python 3.2, Python 3.3
2012-03-29 11:42:40amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg157035
2012-03-29 11:08:36luchsetmessages: + msg157029
2012-03-29 10:43:47luchsetmessages: + msg157025
2012-03-29 10:42:09luchcreate