@@ -225,6 +225,29 @@ Some functionality may behave subtly differently as a result of our choice
225
225
to link ``libedit `` by default. (We choose ``libedit `` by default to
226
226
avoid GPL licensing requirements of ``readline ``.)
227
227
228
+ Static Linking of musl libc Prevents Extension Module Library Loading
229
+ =====================================================================
230
+
231
+ Our musl libc linked Linux builds link musl libc statically and the resulting
232
+ binaries are completely static and don't have any external dependencies.
233
+
234
+ Due to how Linux/ELF works, a static/non-dynamic binary cannot call
235
+ ``dlopen() `` and therefore it cannot load shared library based Python
236
+ extension modules (``.so `` based extension modules). This significantly
237
+ limits the utility of these Python distributions. (If you want to use
238
+ additional extension modules you can use the build artifacts in the
239
+ distributions to construct a new ``libpython `` with the additional
240
+ extension modules configured as builtin extension modules.)
241
+
242
+ Another consequence of statically linking musl libc is that our musl
243
+ distributions aren't compatible with
244
+ `PEP 656 <https://www.python.org/dev/peps/pep-0656/ >`_. PEP 656
245
+ stipulates that Python and extension modules are linked against a
246
+ dynamic musl. This is what you'll find in Alpine Linux, for example.
247
+
248
+ See https://github.com/indygreg/python-build-standalone/issues/86 for
249
+ a tracking issue to improve the state of musl distributions.
250
+
228
251
.. _quirk_linux_libx11 :
229
252
230
253
Static Linking of ``libX11 `` / Incompatibility with PyQt on Linux
0 commit comments