Skip to content

PEP 776: RPATH is fully supported as of Emscripten 4.0.8 #4423

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions peps/pep-0776.rst
Original file line number Diff line number Diff line change
Expand Up @@ -305,31 +305,6 @@ In the long term, we hope to implement stack switching ``stdin`` devices, but
that is out of scope for this PEP.


Missing RPATH Support
---------------------

An important limitation of the Emscripten dynamic loader is that it does not
currently have RPATH support. Pyodide's present workaround is as follows:
``auditwheel-emscripten`` places shared library dependencies that are vendored
into a package in a ``${package}.libs`` folder, following auditwheel's
convention. Pyodide patches the dynamic loader to treat this ``${package}.libs``
folder as if it were on the RPATH of all of the dynamic libraries in the wheel.

In Emscripten 4.0.5, we have updated the shared object file format, ``wasm-ld``
and ``emcc`` to accept an ``-rpath`` flag. We are still working on updating the
dynamic loader to respect the rpath, but we expect this will be finished soon.
Pyodide will then switch to using the RPATH and drop the patch on the dynamic
loader.

Emscripten Python currently uses the unpatched dynamic loader and so cannot load
extension modules that depend on vendored dynamic libraries via DT_NEEDED.
Extension modules can load dynamic libraries via DT_NEEDED if they are in the
system ``lib`` directory. We will wait to resolve this until we have fixed the
Emscripten dynamic loader upstream. When Emscripten Python is built with a
compatible version of Emscripten, it will automatically pick up support for
wheels with vendored dynamic libraries.


Traps and Uncaught Exceptions
-----------------------------

Expand Down