[issue34814] makesetup: must link C extensions to libpython when compiled in shared mode

serge-sans-paille report at bugs.python.org
Tue Oct 16 08:13:57 EDT 2018


serge-sans-paille <serge.guelton at telecom-bretagne.eu> added the comment:

Not an expert of Python build, but I've been creating a few « reverse engineer challenge » where I had to ship modified version of the interpreter, so played with it a bit.

I agree consistency is nice to reason about. It looks better to me to *not* link with libpython.so directly. This is probably better as this does not make ``libpython`` an install requirement (e.g. when one wants to embed a minimal version of python)

As a short check, I ran

```
nm libpython3.so | grep ' [tT] ' | cut -d ' ' -f 3 | while read line; do nm python | grep ' [tT] ' | cut -d ' ' -f 3 | grep $line >/dev/null || { echo "bad: $line"; break; }; done
```

and everything looks fine, so all symbols should already be in the interpreter.

I've also checked whether that's an issue or not for user-defined native extensions and everything runs smoothly without the explicit dep.

So the argument would be: why adding this dep when it's not needed?

----------
nosy: +serge-sans-paille

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


More information about the Python-bugs-list mailing list