Skip to content

Fix math libraries not being linked on some platforms - #594

Merged
ChrisDenton merged 3 commits into
rust-lang:masterfrom
Amjad50:fix_libm_weak_link
Apr 30, 2024
Merged

ChrisDenton merged 3 commits into
rust-lang:masterfrom
Amjad50:fix_libm_weak_link

Conversation

@Amjad50

@Amjad50 Amjad50 commented Apr 15, 2024 •

Copy link
Copy Markdown
Contributor

This is a continuation/fix of 018616e. In that commit, we made it add the math functions to all platforms (except apple-targets and windows), and use weak linking, so that it can be used if the system doesn't have those functions.

Didn't notice mod math was behind another set of cfg, so removed it as well here.

There is an issue with clippy, so disabled it on the file as a whole

@Amjad50
Amjad50 force-pushed the fix_libm_weak_link branch from 75eb6ec to 00baf68 Compare April 15, 2024 12:07
@Amanieu

Amanieu commented Apr 16, 2024

Copy link
Copy Markdown
Member

Rather than messing with clippy attributes, just disable it in CI for now.

Though this should be fixed properly by updating the libm crate.

@Amjad50

Amjad50 commented Apr 30, 2024

Copy link
Copy Markdown
Contributor Author

Updated libm

Amjad50 added 3 commits April 30, 2024 23:28
This is a continuation/fix of 018616e. In that commit, we made it add
the math functions to all platforms (except apple-targets and windows),
and use `weak` linking, so that it can be used if the system doesn't
have those functions.

Didn't notice `mod math` was behind another set of `cfg`, so removed it
as well here.
The solution is not pretty, but not sure why we still get clippy
warning from one of the files in `libm` even though we use
`allow(clippy::all)`
@Amanieu
Amanieu force-pushed the fix_libm_weak_link branch from acee57a to dd85395 Compare April 30, 2024 21:28
@Amanieu
Amanieu enabled auto-merge April 30, 2024 21:28
@ChrisDenton
ChrisDenton disabled auto-merge April 30, 2024 21:30
@ChrisDenton
ChrisDenton enabled auto-merge April 30, 2024 21:31
@ChrisDenton

Copy link
Copy Markdown
Member

Oops sorry for the noise. I accidentally tapped a button when scrolling on mobile. Hopefully I undid my mistake.

@ChrisDenton
ChrisDenton merged commit 2cbde5b into rust-lang:master Apr 30, 2024
tgross35 added a commit to tgross35/compiler-builtins that referenced this pull request Jun 18, 2024
In <rust-lang#594>, symbols
for the Rust port of libm were made always weakly available. This seems
to be causing problems on platforms with ABI issues, as explained at
<rust-lang/rust#125016 (comment)>.

Disable Rust libm on x86 without sse2 to mitigate this.
tgross35 added a commit to tgross35/rust that referenced this pull request Jun 3, 2025
In <rust-lang/compiler-builtins#594>, symbols
for the Rust port of libm were made always weakly available. This seems
to be causing problems on platforms with ABI issues, as explained at
<rust-lang#125016 (comment)>.

Disable Rust libm on x86 without sse2 to mitigate this.
tautschnig pushed a commit to model-checking/verify-rust-std that referenced this pull request Jun 17, 2025
In <rust-lang/compiler-builtins#594>, symbols
for the Rust port of libm were made always weakly available. This seems
to be causing problems on platforms with ABI issues, as explained at
<rust-lang#125016 (comment)>.

Disable Rust libm on x86 without sse2 to mitigate this.
tgross35 pushed a commit that referenced this pull request Jan 31, 2026
Fix math libraries not being linked on some platforms
tgross35 added a commit that referenced this pull request Jan 31, 2026
In <#594>, symbols
for the Rust port of libm were made always weakly available. This seems
to be causing problems on platforms with ABI issues, as explained at
<rust-lang/rust#125016 (comment)>.

Disable Rust libm on x86 without sse2 to mitigate this.
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.

3 participants