riscv64: Keep hard-float fenv functions private - #360
Merged
Conversation
Openlibm uses FreeBSD-style shifted rounding-mode constants on RISC-V, while Linux uses raw frm encodings. Exporting openlibm's hard-float fenv functions can therefore interpose an incompatible implementation and break directed rounding. Keep hard-float definitions private, as on AArch64 and PowerPC, preserve external soft-float definitions, and test through the system fenv interface.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #360 +/- ##
=======================================
Coverage 72.11% 72.11%
=======================================
Files 233 233
Lines 6139 6139
Branches 1609 1609
=======================================
Hits 4427 4427
Misses 1419 1419
Partials 293 293 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
maleadt
added a commit
to maleadt/Yggdrasil
that referenced
this pull request
Sep 2, 2026
Picks up JuliaMath/openlibm#360, which stops the riscv64 build from exporting fenv functions that shadowed glibc's with incompatible rounding-mode constants. Request LLVMCompilerRT_jll by version string, as Pkg no longer resolves a bare 13.0.1 now that 13.0.1+1 exists. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
maleadt
added a commit
to JuliaLang/julia
that referenced
this pull request
Sep 3, 2026
Picks up JuliaMath/openlibm#360, which stops the riscv64 port from exporting its fenv functions. Those symbols shadowed glibc's through the dynamic linker while carrying FreeBSD's pre-shifted `FE_*` encodings, so `fesetround` rejected every constant a caller had compiled against the system header and left the rounding mode untouched. Julia's own rounding path stopped going through that symbol in `6081d7ceb7`, but anything else linked against the bundled library still did. The release also carries three riscv64 fixes that never reached the 0.8.7 build: JuliaMath/openlibm#324 (`feholdexcept` always returned -1), and JuliaMath/openlibm#330 and JuliaMath/openlibm#349 for the lp64f ABI. Assisted-by: Claude Code (Opus 5)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Openlibm uses FreeBSD-style shifted rounding-mode constants on RISC-V, while Linux uses raw frm encodings. Exporting openlibm's hard-float fenv functions can therefore interpose an incompatible implementation and break directed rounding.
Keep hard-float definitions private, as on AArch64 and PowerPC, preserve external soft-float definitions, and test through the system fenv interface.