cpython/Doc/using
Geoffrey Thomas c88c27b0c1
gh-133312: configure: add --enable-static-libpython-for-interpreter (#133313)
This option changes the behavior of --enable-shared to continue to build
the libpython3.x.so shared library, but not use it for linking the
python3 interpreter executable. Instead, the executable is linked
directly against the libpython .o files as it would be with
--disable-shared.

There are two benefits of this change. First, libpython uses
thread-local storage, which is noticeably slower when used in a loaded
module instead of in the main program, because the main program can take
advantage of constant offsets from the thread state pointer but loaded
modules have to dynamically call a function __tls_get_addr() to
potentially allocate their thread-local storage area. (There is another
thread-local storage model for dynamic libraries which mitigates most of
this performance hit, but it comes at the cost of preventing
dlopen("libpython3.x.so"), which is a use case we want to preserve.)

Second, this improves the user experience around relocatable Python a
little bit, in that we don't need to use an $ORIGIN-relative path to
locate libpython3.x.so, which has some mild benefits around musl (which
does not support $ORIGIN-relative DT_NEEDED, only $ORIGIN-relative
DT_RPATH/DT_RUNPATH), users who want to make the interpreter setuid or
setcap (which prevents processing $ORIGIN), etc.
2026-04-14 16:26:19 +01:00
..
android.rst gh-137242: Mention Android binary releases in documentation (#138305) 2025-09-18 13:25:30 +00:00
cmdline.rst gh-148014: Accept a function name in -X presite option (#148015) 2026-04-07 14:05:39 +00:00
configure.rst gh-133312: configure: add --enable-static-libpython-for-interpreter (#133313) 2026-04-14 16:26:19 +01:00
editors.rst gh-59149: Setup documentation for IDLE on Linux and add section in Editors (#130003) 2025-02-12 03:16:56 -05:00
index.rst gh-116622: Complete Android documentation (#124259) 2024-09-23 23:09:53 +00:00
ios.rst gh-132006: Add support for handling XCPrivacy manifests (#139163) 2025-09-29 05:50:46 +08:00
mac.rst Docs: remove unneeded author attributions (#145002) 2026-02-19 18:45:28 -05:00
mac_installer_01_introduction.png gh-124720: Update "Using Python on a Mac" document (#124721) 2024-09-30 07:39:46 +08:00
mac_installer_02_readme.png gh-124720: Update "Using Python on a Mac" document (#124721) 2024-09-30 07:39:46 +08:00
mac_installer_03_license.png gh-124720: Update "Using Python on a Mac" document (#124721) 2024-09-30 07:39:46 +08:00
mac_installer_04_installation_type.png gh-124720: Update "Using Python on a Mac" document (#124721) 2024-09-30 07:39:46 +08:00
mac_installer_05_custom_install.png gh-124720: Update "Using Python on a Mac" document (#124721) 2024-09-30 07:39:46 +08:00
mac_installer_06_summary.png gh-124720: Update "Using Python on a Mac" document (#124721) 2024-09-30 07:39:46 +08:00
mac_installer_07_applications.png gh-71648: Optimize PNG files (GH-138842) 2025-09-12 20:13:05 +00:00
mac_installer_08_install_certificates.png gh-124720: Update "Using Python on a Mac" document (#124721) 2024-09-30 07:39:46 +08:00
mac_installer_09_custom_install_free_threaded.png gh-124720: Update "Using Python on a Mac" document (#124721) 2024-09-30 07:39:46 +08:00
unix.rst Docs: remove unneeded author attributions (#145002) 2026-02-19 18:45:28 -05:00
win_install_freethreaded.png gh-71648: Optimize PNG files (GH-138842) 2025-09-12 20:13:05 +00:00
win_installer.png gh-71648: Optimize PNG files (GH-138842) 2025-09-12 20:13:05 +00:00
windows.rst Update Python install manager docs (GH-145160) 2026-02-23 22:28:23 +00:00