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) *  |
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) *  |
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) *  |
Date: 2016-10-10 17:07 |
revised patch LGTM |
|
|
msg278432 - (view) |
Author: Inada Naoki (methane) *  |
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)  |
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 |
|
|