[issue32232] building extensions as builtins is broken in 3.7

Matthias Klose report at bugs.python.org
Wed Dec 6 08:03:40 EST 2017


New submission from Matthias Klose <doko at debian.org>:

building extensions statically in linking these into the python binary is currently broken on 3.7.

I'm attaching the change that worked for me in 3.7alpha2, but doesn't work anymore with alpha3. Currently investigating.  When building extensions as builtins, these should benefit from the knowledge about the core interpreter.

x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -g -fdebug-prefix-map=/home/packages/python/3.7/python3.7-3.7.0~a3=. -fstack-protector-strong -Wformat -Werror=format-security    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration  -IObjects -IInclude -IPython -I. -I../Include -Wdate-time -D_FORTIFY_SOURCE=2   -DPy_BUILD_CORE  -c ../Modules/_elementtree.c -o Modules/_elementtree.o
In file included from ../Include/pyatomic.h:10:0,
                 from ../Include/Python.h:53,
                 from ../Modules/_elementtree.c:16:
../Modules/_elementtree.c: In function 'element_dealloc':
../Include/pystate.h:314:34: error: '_PyRuntime' undeclared (first use in this function); did you mean 'PyRun_File'?
 #  define _PyThreadState_Current _PyRuntime.gilstate.tstate_current
                                  ^
../Include/pyatomic.h:533:5: note: in expansion of macro '_Py_atomic_load_explicit'
     _Py_atomic_load_explicit(ATOMIC_VAL, _Py_memory_order_relaxed)
     ^~~~~~~~~~~~~~~~~~~~~~~~
../Include/pystate.h:316:31: note: in expansion of macro '_Py_atomic_load_relaxed'
              ((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current))
                               ^~~~~~~~~~~~~~~~~~~~~~~
../Include/pystate.h:316:56: note: in expansion of macro '_PyThreadState_Current'
              ((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current))
                                                        ^~~~~~~~~~~~~~~~~~~~~~
../Include/object.h:1069:34: note: in expansion of macro 'PyThreadState_GET'
         PyThreadState *_tstate = PyThreadState_GET(); \
                                  ^~~~~~~~~~~~~~~~~
../Modules/_elementtree.c:634:5: note: in expansion of macro 'Py_TRASHCAN_SAFE_BEGIN'
     Py_TRASHCAN_SAFE_BEGIN(self)
     ^~~~~~~~~~~~~~~~~~~~~~
../Include/pystate.h:314:34: note: each undeclared identifier is reported only once for each function it appears in
 #  define _PyThreadState_Current _PyRuntime.gilstate.tstate_current
                                  ^
../Include/pyatomic.h:533:5: note: in expansion of macro '_Py_atomic_load_explicit'
     _Py_atomic_load_explicit(ATOMIC_VAL, _Py_memory_order_relaxed)
     ^~~~~~~~~~~~~~~~~~~~~~~~
../Include/pystate.h:316:31: note: in expansion of macro '_Py_atomic_load_relaxed'
              ((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current))
                               ^~~~~~~~~~~~~~~~~~~~~~~
../Include/pystate.h:316:56: note: in expansion of macro '_PyThreadState_Current'
              ((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current))
                                                        ^~~~~~~~~~~~~~~~~~~~~~
../Include/object.h:1069:34: note: in expansion of macro 'PyThreadState_GET'
         PyThreadState *_tstate = PyThreadState_GET(); \
                                  ^~~~~~~~~~~~~~~~~
../Modules/_elementtree.c:634:5: note: in expansion of macro 'Py_TRASHCAN_SAFE_BEGIN'
     Py_TRASHCAN_SAFE_BEGIN(self)
     ^~~~~~~~~~~~~~~~~~~~~~
../Include/pyatomic.h:56:5: error: '__atomic_load_ptr' undeclared (first use in this function); did you mean '__atomic_load_n'?
     atomic_load_explicit(&(ATOMIC_VAL)->_value, ORDER)
     ^
../Include/pyatomic.h:533:5: note: in expansion of macro '_Py_atomic_load_explicit'
     _Py_atomic_load_explicit(ATOMIC_VAL, _Py_memory_order_relaxed)
     ^~~~~~~~~~~~~~~~~~~~~~~~
../Include/pystate.h:316:31: note: in expansion of macro '_Py_atomic_load_relaxed'
              ((PyThreadState*)_Py_atomic_load_relaxed(&_PyThreadState_Current))
                               ^~~~~~~~~~~~~~~~~~~~~~~

----------
components: Build
messages: 307735
nosy: doko
priority: normal
severity: normal
status: open
title: building extensions as builtins is broken in 3.7
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32232>
_______________________________________


More information about the Python-bugs-list mailing list