Uh oh!
There was an error while loading. Please reload this page.
gh-136976: Emscripten: Add _decimal and libmpdec - #136997
Conversation
Goes together with: python/cpython#136997
hoodmane
commented
Jul 22, 2025
We'll have to merge python/buildmaster-config#615 before the buildbot will actually use this. |
freakboy3742
left a comment
There was a problem hiding this comment.
+1 to the general approach (although see my comments on the buildmaster-config PR for a possible direction for minimising the need for re-builds).
However, testing this manually yielded an compilation error on the mpdec build:
wasm-ld: error: /Users/rkm/projects/python/cpython/cross-build/wasm32-emscripten/prefix/lib/libmpdec.a(context.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol `mpd_setminalloc.minalloc_is_set`; recompile with -fPIC
wasm-ld: error: /Users/rkm/projects/python/cpython/cross-build/wasm32-emscripten/prefix/lib/libmpdec.a(context.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol `.L.str.1`; recompile with -fPIC
wasm-ld: error: /Users/rkm/projects/python/cpython/cross-build/wasm32-emscripten/prefix/lib/libmpdec.a(context.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol `stderr`; recompile with -fPIC
wasm-ld: error: /Users/rkm/projects/python/cpython/cross-build/wasm32-emscripten/prefix/lib/libmpdec.a(context.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol `.L.str`; recompile with -fPIC
wasm-ld: error: /Users/rkm/projects/python/cpython/cross-build/wasm32-emscripten/prefix/lib/libmpdec.a(context.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol `.L.str.2`; recompile with -fPIC
wasm-ld: error: /Users/rkm/projects/python/cpython/cross-build/wasm32-emscripten/prefix/lib/libmpdec.a(context.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol `mpd_setminalloc.minalloc_is_set`; recompile with -fPIC
wasm-ld: error: /Users/rkm/projects/python/cpython/cross-build/wasm32-emscripten/prefix/lib/libmpdec.a(context.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol `MPD_MINALLOC`; recompile with -fPIC
wasm-ld: error: /Users/rkm/projects/python/cpython/cross-build/wasm32-emscripten/prefix/lib/libmpdec.a(context.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol `.L.str.1`; recompile with -fPIC
wasm-ld: error: /Users/rkm/projects/python/cpython/cross-build/wasm32-emscripten/prefix/lib/libmpdec.a(context.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol `stderr`; recompile with -fPIC
wasm-ld: error: /Users/rkm/projects/python/cpython/cross-build/wasm32-emscripten/prefix/lib/libmpdec.a(context.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol `.L.str.3`; recompile with -fPIC
wasm-ld: error: /Users/rkm/projects/python/cpython/cross-build/wasm32-emscripten/prefix/lib/libmpdec.a(context.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol `.L.str.4`; recompile with -fPIC
wasm-ld: error: /Users/rkm/projects/python/cpython/cross-build/wasm32-emscripten/prefix/lib/libmpdec.a(basearith.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol `.L.str.1`; recompile with -fPIC
wasm-ld: error: /Users/rkm/projects/python/cpython/cross-build/wasm32-emscripten/prefix/lib/libmpdec.a(basearith.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol `stderr`; recompile with -fPIC
wasm-ld: error: /Users/rkm/projects/python/cpython/cross-build/wasm32-emscripten/prefix/lib/libmpdec.a(basearith.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol `.L.str`; recompile with -fPIC
wasm-ld: error: /Users/rkm/projects/python/cpython/cross-build/wasm32-emscripten/prefix/lib/libmpdec.a(basearith.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol `.L.str.2`; recompile with -fPIC
wasm-ld: error: /Users/rkm/projects/python/cpython/cross-build/wasm32-emscripten/prefix/lib/libmpdec.a(basearith.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol `mpd_free`; recompile with -fPIC
wasm-ld: error: /Users/rkm/projects/python/cpython/cross-build/wasm32-emscripten/prefix/lib/libmpdec.a(basearith.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol `mpd_free`; recompile with -fPIC
wasm-ld: error: /Users/rkm/projects/python/cpython/cross-build/wasm32-emscripten/prefix/lib/libmpdec.a(basearith.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol `mpd_pow10`; recompile with -fPIC
wasm-ld: error: /Users/rkm/projects/python/cpython/cross-build/wasm32-emscripten/prefix/lib/libmpdec.a(basearith.o): relocation R_WASM_MEMORY_ADDR_LEB cannot be used against symbol `mpd_pow10`; recompile with -fPIC
wasm-ld: error: /Users/rkm/projects/python/cpython/cross-build/wasm32-emscripten/prefix/lib/libmpdec.a(convolute.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol `mpd_moduli`; recompile with -fPIC
wasm-ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
hoodmane
commented
Jul 23, 2025
Huh I wonder why I didn't get the fPIC problems. |
hoodmane
commented
Jul 23, 2025
I added |
freakboy3742
left a comment
There was a problem hiding this comment.
One minor typo, but otherwise the fPIC fix has done the job.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Thanks @hoodmane for the PR, and @freakboy3742 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Adds tooling to build mpdec (and thus _decimal) as part of an Emscripten build. (cherry picked from commit ecb3f23) Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com>
GH-137066 is a backport of this pull request to the 3.14 branch. |
Adds tooling to build mpdec (and thus _decimal) as part of an Emscripten build.
Adds tooling to build mpdec (and thus _decimal) as part of an Emscripten build.
…GH-136997) (python#137066) Co-authored-by: Hood Chatham <roberthoodchatham@gmail.com> Co-authored-by: Zachary Ware <zach@python.org>
_decimal,_uuid,_sslor_hashlib#136976