Skip to content

Use our libm on windows-gnu targets #900

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 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions compiler-builtins/src/math/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,13 @@ pub mod full_availability {
}

/* Weak linkage is unreliable on Windows and Apple, so we don't expose symbols that we know
* the system libc provides in order to avoid conflicts. */
* the system libc provides in order to avoid conflicts.
*
* Windows+GNU is an exception since we _do_ want to use our `fma` to avoid the inaccurate
* system implementation. see the issue: https://github.com/rust-lang/rust/issues/140515.
*/

#[cfg(all(not(windows), not(target_vendor = "apple")))]
#[cfg(all(not(all(windows, target_env = "gnu")), not(target_vendor = "apple")))]
Copy link

Choose a reason for hiding this comment

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

Can we guard against llvm abi in case of windows-gnu? So, windows-gnullvm is not affected.

libm_intrinsics! {
/* f32 */
fn cbrtf(n: f32) -> f32;
Expand Down