Skip to content

Fix: expose std.math.ldexp as C ldexp in compiler-rt to address LLVM release-mode simplification #24006

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

Closed
wants to merge 16 commits into from

Conversation

th3james
Copy link

@th3james th3james commented May 28, 2025

Fixes #23358

Adds the ldexp family of functions to compiler_rt, proxying the implementation to std.math.ldexp. Inspired by the approach taken to exp2, which does not appear to handle errno when wrapping std.math.

A duplicate approach appeared as I was running the final tests:
#24005

I have regression tests which may be worth integrating if the above approach is preferred.

@hi7
Copy link
Contributor

hi7 commented May 28, 2025

Ok I close my Pull Request.

The task of removing the entries in src/libs/mingw.zig (MinGW-w64) and src/libs/musl.zig and the corresponding c files are still open (see comment from alexrp in #24005.

@alexrp
Copy link
Member

alexrp commented Jun 1, 2025

As mentioned on #24005, this needs to remove any duplicate C implementations in lib/libc/musl and lib/libc/mingw, and remove those files from the listings in src/libs/musl.zig and src/libs/mingw.zig.

@th3james
Copy link
Author

th3james commented Jun 4, 2025

Converting this to a draft for now - it needs a bit more testing before it's ready for review

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

Successfully merging this pull request may close these issues.

wasm-ld: ....o: undefined symbol: ldexp in Release modes, but works in Debug
3 participants