[issue38980] Compile libpython with -fno-semantic-interposition

Serhiy Storchaka report at bugs.python.org
Fri Dec 6 03:48:39 EST 2019


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

In case of malloc, every memory allocating code need to use malloc/calloc/realloc. This is official and the only way to allocate a memory. But we do not guarantee that Python core uses only public C API like PyErr_Occurred(). It can use more low-level and efficient but less safer C API internally. It can replace the function with a macro which access internal structures directly (for compiling the core only). And this is actually the case. Overridding the public C API functions not always has an effect on the core.

So I think that adding -fno-semantic-interposition will likely not break many things which were not broken before.

But this should be discussed on Python-Dev. I am sure some C API functions are purposed to be overridden.

----------

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


More information about the Python-bugs-list mailing list