Bug 281216
Summary: | [musl] Missing roundevenf and roundeven Function Support on Non-glibc Platforms | ||
---|---|---|---|
Product: | WebKit | Reporter: | Pablo Saavedra <psaavedra> |
Component: | JavaScriptCore | Assignee: | Pablo Saavedra <psaavedra> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | angelos, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Pablo Saavedra
While building WPEWebKit 2.46.1 for musl-based systems, compilation errors occur due to the absence of the `roundevenf` and `roundeven` functions. These functions are not available on platforms that do not use glibc, including musl [1]. This issue impacts platforms such as musl-based distributions, Android, FreeBSD, and others that do not provide the `roundeven` and the `roundevenf` functions, as it is not part of the standard C libraries in these environments.
The build failure occurs in the `MathCommon.cpp` file in JavaScriptCore, specifically at:
```
2024-10-10T07:04:15.8564050Z | /home/bot/yocto-webkit-scarthgap/builds/raspberrypi3-mesa-wpe-musl/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-musleabi/wpewebkit/2.46.1/wpewebkit-2.46.1/Source/JavaScriptCore/runtime/MathCommon.cpp:638:83: error: 'roundevenf' was not declared in this scope; did you mean 'roundf'?
2024-10-10T07:04:15.8566368Z | 638 | JSC_DEFINE_NOEXCEPT_JIT_OPERATION(f32_roundeven, float, (float operand)) { return roundevenf(operand); }
2024-10-10T07:04:15.8567237Z | | ^~~~~~~~~~
2024-10-10T07:04:15.8567826Z | | roundf
2024-10-10T07:04:15.8570085Z | /home/bot/yocto-webkit-scarthgap/builds/raspberrypi3-mesa-wpe-musl/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-musleabi/wpewebkit/2.46.1/wpewebkit-2.46.1/Source/JavaScriptCore/runtime/MathCommon.cpp: In function 'double JSC::Math::f64_roundeven(double)':
2024-10-10T07:04:15.8573709Z | /home/bot/yocto-webkit-scarthgap/builds/raspberrypi3-mesa-wpe-musl/tmp/work/cortexa7t2hf-neon-vfpv4-poky-linux-musleabi/wpewebkit/2.46.1/wpewebkit-2.46.1/Source/JavaScriptCore/runtime/MathCommon.cpp:639:85: error: 'roundeven' was not declared in this scope; did you mean 'f64_roundeven'?
2024-10-10T07:04:15.8576102Z | 639 | JSC_DEFINE_NOEXCEPT_JIT_OPERATION(f64_roundeven, double, (double operand)) { return roundeven(operand); }
2024-10-10T07:04:15.8576970Z | | ^~~~~~~~~
2024-10-10T07:04:15.8577574Z | | f64_roundeven
```
This issue blocks the compilation of WPEWebKit for musl and requires either a fallback to `roundf` and similar alternatives or a platform-specific implementation of the `roundevenf` and `roundeven` functions for non-glibc platforms.
[1] https://www.gnu.org/software/gnulib/manual/gnulib.html
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Pablo Saavedra
Pull request: https://github.com/WebKit/WebKit/pull/34972
Angelos Oikonomopoulos
Oops, thanks for fixing this!
EWS
Committed 285058@main (cbd68e2d4822): <https://commits.webkit.org/285058@main>
Reviewed commits have been landed. Closing PR #34972 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/137791968>