Skip to content

gh-136976: Emscripten: Add _decimal and libmpdec #136997

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

hoodmane
Copy link
Contributor

@hoodmane hoodmane commented Jul 22, 2025

@hoodmane
Copy link
Contributor Author

We'll have to merge python/buildmaster-config#615 before the buildbot will actually use this.

Copy link
Contributor

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+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)

@bedevere-app
Copy link

bedevere-app bot commented Jul 23, 2025

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 I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@hoodmane
Copy link
Contributor Author

Huh I wonder why I didn't get the fPIC problems.

@hoodmane
Copy link
Contributor Author

I added CFLAGS=-fPIC, can you try it again?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants