Skip to content
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

Account for optimization levels other than numbers #743

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Jan 7, 2025

The build script currently panics with opt-level=z or opt-level=s. Account for this here.

This is the compiler-builtins version of 1. This PR also includes the libm submodule update with 1, and a few other small changes.

Fixes: #742

This includes [1], which fixes a bug parsing non-numeric optimization
levels.

[1]: rust-lang/libm#417
The build script currently panics with `opt-level=z` or `opt-level=s`.
Account for this here.

This is the `compiler-builtins` version of [1].

Fixes: rust-lang#742

[1]: rust-lang/libm#417
@tgross35 tgross35 enabled auto-merge January 7, 2025 23:18
@tgross35 tgross35 merged commit 288a33f into rust-lang:master Jan 7, 2025
26 checks passed
@tgross35 tgross35 deleted the fix-opt-level branch January 7, 2025 23:23
@@ -121,7 +121,7 @@ fn configure_libm(target: &Target) {
}

println!("cargo:rustc-check-cfg=cfg(optimizations_enabled)");
if target.opt_level >= 2 {
if !matches!(target.opt_level.as_str(), "0" | "1") {
Copy link

Choose a reason for hiding this comment

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

is "z" optimizations_enabled?

Copy link
Contributor Author

@tgross35 tgross35 Jan 7, 2025

Choose a reason for hiding this comment

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

For this purpose it is fine, the config is only used in libm's test-related code. I only included it here for consistency if we wind up doing something similar in compiler-builtins/testcrate.

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.

Build fails when opt-level = "z"
2 participants