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: Compile error on Modules/_futuresmodule.c
Type: compile error Stage: resolved
Components: Build, Extension Modules Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: methane Nosy List: bquinlan, masamoto, methane, ned.deily, python-dev, yselivanov
Priority: high Keywords: patch

Created on 2016-10-10 14:46 by masamoto, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
_PyGC_generation0-declaration.patch masamoto, 2016-10-10 14:50 review
28045-gc_track.patch methane, 2016-10-10 15:51 review
gc_track-2.patch masamoto, 2016-10-10 17:03 review
Messages (8)
msg278418 - (view) Author: Masayuki Yamamoto (masamoto) * Date: 2016-10-10 14:46
I tried to build cpython on cygwin (vista x86).
Core interpretor has built to success, but '_futures' extension module has failed (compile error on Modules/_futuresmodule.c:946 ). It has occured since f8815001a390

part of build log:
$ uname -a
CYGWIN_NT-6.0 masayuki-PC 2.6.0(0.304/5/3) 2016-08-31 14:27 i686 Cygwin
$ ./configure --without-threads --prefix=/opt/py37
$ LANG=C make
(snip)
building '_futures' extension
gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -I./Include -I/opt/py37/include -I. -I/usr/local/include -I/home/masayuki/var/repos/py37-work01/Include -I/home/masayuki/var/repos/py37-work01 -c /home/masayuki/var/repos/py37-work01/Modules/_futuresmodule.c -o build/temp.cygwin-2.6.0-i686-3.7/home/masayuki/var/repos/py37-work01/Modules/_futuresmodule.o
gcc -shared -Wl,--enable-auto-image-base build/temp.cygwin-2.6.0-i686-3.7/home/masayuki/var/repos/py37-work01/Modules/_futuresmodule.o -L. -L/opt/py37/lib -L/usr/local/lib -L. -lpython3.7m -o build/lib.cygwin-2.6.0-i686-3.7/_futures.dll
build/temp.cygwin-2.6.0-i686-3.7/home/masayuki/var/repos/py37-work01/Modules/_futuresmodule.o: In function `new_future_iter':
/home/masayuki/var/repos/py37-work01/Modules/_futuresmodule.c:946: undefined reference to `_PyGC_generation0'
/home/masayuki/var/repos/py37-work01/Modules/_futuresmodule.c:946: undefined reference to `_PyGC_generation0'
/home/masayuki/var/repos/py37-work01/Modules/_futuresmodule.c:946: undefined reference to `_PyGC_generation0'
collect2: error: ld returned 1 exit status
(snip)
msg278419 - (view) Author: Masayuki Yamamoto (masamoto) * Date: 2016-10-10 14:50
I searched declaration for _PyGC_generation0, And it has be found at Include/objimpl.h:259
The found declaration hasn't used PyAPI_DATA macro. Hence, I wrote a patch to wrap declaration by the macro. I has succeeded to build _futures module using the patch.

By the way, I has found similar declarations and defines. I'd like to report them, but Should I create each another issues by places?
msg278422 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2016-10-10 15:51
Thank you for reporting.

C-API doc [https://docs.python.org/3.7/c-api/gcsupport.html#c._PyObject_GC_TRACK] says:

> A macro version of PyObject_GC_Track(). It should not be used for extension modules.

So simply replacing it to PyObject_GC_Track() may solve the issue.
msg278423 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2016-10-10 15:57
I need another LGTM from core developer before committing.
Yury, could you see it?  This is one line patch.
msg278429 - (view) Author: Masayuki Yamamoto (masamoto) * Date: 2016-10-10 17:03
Thanks, INADA.
I confirmed your solution, and has succeeded to build _futures extension. Your patch has a little misspell. I fixed it.
msg278431 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2016-10-10 17:07
revised patch LGTM
msg278432 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2016-10-10 17:07
Oh! Thanks, While I ran make, I had missed error message somehow.
msg278433 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-10-10 17:13
New changeset a8dd18e375c8 by INADA Naoki in branch '3.6':
Issue #28405: Fix compile error for _futuresmodule.c on Cygwin.
https://hg.python.org/cpython/rev/a8dd18e375c8

New changeset d2a313d13542 by INADA Naoki in branch 'default':
Issue #28405: Fix compile error for _futuresmodule.c on Cygwin.
https://hg.python.org/cpython/rev/d2a313d13542
History
Date User Action Args
2022-04-11 14:58:38adminsetgithub: 72591
2016-10-10 21:56:38berker.peksagsetstatus: open -> closed
resolution: fixed
stage: commit review -> resolved
2016-10-10 17:13:05python-devsetnosy: + python-dev
messages: + msg278433
2016-10-10 17:07:44methanesetmessages: + msg278432
2016-10-10 17:07:13ned.deilysetnosy: + ned.deily
messages: + msg278431
2016-10-10 17:03:24masamotosetfiles: + gc_track-2.patch

messages: + msg278429
2016-10-10 15:57:22methanesetmessages: + msg278423
2016-10-10 15:51:41methanesetfiles: + 28045-gc_track.patch
priority: normal -> high
messages: + msg278422

assignee: methane
stage: commit review
2016-10-10 14:58:45xiang.zhangsetnosy: + methane, yselivanov
2016-10-10 14:50:01masamotosetfiles: + _PyGC_generation0-declaration.patch
keywords: + patch
messages: + msg278419
2016-10-10 14:46:48masamotocreate