2/27/2024 0 Comments No rule to make target clean vimr![]() > bpo-34814 is linked to this use case: is an example of Python embedded in C using dlopen("libpython2.7.so.1.0", RTLD_LOCAL | RTLD_NOW). Patch #1429775: Link Python modules to libpython on linux if IHMO it's a bad usage of dlopen(): libpython must always be loaded with RTLD_GLOBAL.īpo-832799 has been fixed by the following commit which modify distutils to link C extensions to libpython:Ĭommit 10acfd00b28a2aad7b73d35afdbc64b0baebea20 ![]() In this case, these C extensions are not explicitly linked to libpython. On Fedora and RHEL, some C extensions like _struct are built by the "*shared*" section of Modules/Setup. ![]() Problem: some C extensions of the standard library cannot be loaded in this case, like _struct. > (also, the OP didn't mention why he used a shared library build, instead of linking Python statically with the dlopened library)īpo-34814 is linked to this use case: is an example of Python embedded in C using dlopen("libpython2.7.so.1.0", RTLD_LOCAL | RTLD_NOW). The OP there also mentions RTLD_GLOBAL as a workaround (or perhaps the right way of achieving the desired effect). > Hmm, apparently the -l flag was added in #832799, for a rather complicated case where the interpreter is linked with a library dlopened by an embedding application (I suppose for some kind of plugin system). Martin, what do you think about the aforementioned use case? (also, the OP didn't mention why he used a shared library build, instead of linking Python statically with the dlopened library) Hmm, apparently the -l flag was added in #832799, for a rather complicated case where the interpreter is linked with a library dlopened by an embedding application (I suppose for some kind of plugin system). Regardless of libphp5.so, the modules in /usr/lib/php5/20100525 don't link against /usr/lib/apache2/modules/libphp5.so, though the latter is obviously able to load those modules. I wonder how it is on systems that actually use the PHP > /usr/lib/php5/20100525+lfs/) don't link with the shared library. > link against it, and all the PHP modules (in > (in /usr/lib/php5), yet neither /usr/bin/php5 nor the Apache libphp5.so > PHP might be close to our case: Debian includes a libphp5.so I wonder how it is on systems that actually use the PHP shared library. PHP might be close to our case: Debian includes a libphp5.so (in /usr/lib/php5), yet neither /usr/bin/php5 nor the Apache libphp5.so link against it, and all the PHP modules (in /usr/lib/php5/20100525+lfs/) don't link with the shared library - on Debian. Apache modules don't link a shared library, but still refer to apr_ functions as undefined symbols - but then, there isn't an APR shared library in the first place (at least not on Debian - how about Redhat?) It would IMO be useful to research a few comparable systems. Removing the "-lpython3.5m" flag from the linker line works fine under Linux, and allows the resulting extension to be loaded with both a shared libary Python and a statically-linked Python. (AFAIK, systems notorious for providing shared library Pythons are RedHat-alike systems, while Debian/Ubuntu provide statically linked Pythons)Īctually, it's not a -L flag but a -l flag. I don't think the flag is useful under Linux (or perhaps under any other OS at all), since the relevant symbols are already loaded when the interpreter tries to load the C extension. This is probably because of an additional -L flag that is passed when linking a C extension with a shared library Python. ImportError: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory When a C extension is built (using distutils) with a shared library Python, it cannot be loaded with an otherwise identical statically linked Python. Extension built with a shared python cannot be loaded with a static pythonīarry, dstufft, eric.araujo, erik.bray, lemburg, loewis, ncoghlan, piotr.dobrogost, pitrou, reimar, vstinner, xdegaye, zhtw1234Ĭreated on 18:50 by pitrou, last changed 14:58 by admin.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |