Issue 28405: Compile error on Modules/_futuresmodule.c (original) (raw)

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:38 admin set github: 72591
2016-10-10 21:56:38 berker.peksag set status: open -> closedresolution: fixedstage: commit review -> resolved
2016-10-10 17:13:05 python-dev set nosy: + python-devmessages: +
2016-10-10 17:07:44 methane set messages: +
2016-10-10 17:07:13 ned.deily set nosy: + ned.deilymessages: +
2016-10-10 17:03:24 masamoto set files: + gc_track-2.patchmessages: +
2016-10-10 15:57:22 methane set messages: +
2016-10-10 15:51:41 methane set files: + 28045-gc_track.patchpriority: normal -> highmessages: + assignee: methanestage: commit review
2016-10-10 14:58:45 xiang.zhang set nosy: + methane, yselivanov
2016-10-10 14:50:01 masamoto set files: + _PyGC_generation0-declaration.patchkeywords: + patchmessages: +
2016-10-10 14:46:48 masamoto create