@@ -2720,81 +2720,9 @@ config RUST_OVERFLOW_CHECKS
2720
2720
2721
2721
If unsure, say Y.
2722
2722
2723
- choice
2724
- prompt "Optimization level"
2725
- default RUST_OPT_LEVEL_SIMILAR_AS_CHOSEN_FOR_C
2726
- depends on RUST
2727
- help
2728
- Controls rustc's `-Copt-level` codegen option.
2729
-
2730
- This flag controls the optimization level.
2731
-
2732
- If unsure, say "Similar as chosen for C".
2733
-
2734
- config RUST_OPT_LEVEL_SIMILAR_AS_CHOSEN_FOR_C
2735
- bool "Similar as chosen for C"
2736
- help
2737
- This choice will pick a similar optimization level as chosen in
2738
- the "Compiler optimization level" for C:
2739
-
2740
- -O2 is currently mapped to -Copt-level=2
2741
- -O3 is currently mapped to -Copt-level=3
2742
- -Os is currently mapped to -Copt-level=s
2743
-
2744
- The mapping may change over time to follow the intended semantics
2745
- of the choice for C as sensibly as possible.
2746
-
2747
- This is the default.
2748
-
2749
- config RUST_OPT_LEVEL_0
2750
- bool "No optimizations (-Copt-level=0)"
2751
- help
2752
- Not recommended for most purposes. It may come in handy for debugging
2753
- suspected optimizer bugs, unexpected undefined behavior, etc.
2754
-
2755
- Note that this level will *not* enable debug assertions nor overflow
2756
- checks on its own (like it happens when interacting with rustc
2757
- directly). Use the corresponding configuration options to control
2758
- that instead, orthogonally.
2759
-
2760
- Note this level may cause excessive stack usage, which can lead to stack
2761
- overflow and subsequent crashes.
2762
-
2763
- config RUST_OPT_LEVEL_1
2764
- bool "Basic optimizations (-Copt-level=1)"
2765
- help
2766
- Useful for debugging without getting too lost, but without
2767
- the overhead and boilerplate of no optimizations at all.
2768
-
2769
- Note this level may cause excessive stack usage, which can lead to stack
2770
- overflow and subsequent crashes.
2771
-
2772
- config RUST_OPT_LEVEL_2
2773
- bool "Some optimizations (-Copt-level=2)"
2774
- help
2775
- The sensible choice in most cases.
2776
-
2777
- config RUST_OPT_LEVEL_3
2778
- bool "All optimizations (-Copt-level=3)"
2779
- help
2780
- Yet more performance (hopefully).
2781
-
2782
- config RUST_OPT_LEVEL_S
2783
- bool "Optimize for size (-Copt-level=s)"
2784
- help
2785
- Smaller kernel, ideally without too much performance loss.
2786
-
2787
- config RUST_OPT_LEVEL_Z
2788
- bool "Optimize for size, no loop vectorization (-Copt-level=z)"
2789
- help
2790
- Like the previous level, but also turn off loop vectorization.
2791
-
2792
- endchoice
2793
-
2794
2723
choice
2795
2724
prompt "Build-time assertions"
2796
- default RUST_BUILD_ASSERT_ALLOW if RUST_OPT_LEVEL_0
2797
- default RUST_BUILD_ASSERT_DENY if !RUST_OPT_LEVEL_0
2725
+ default RUST_BUILD_ASSERT_DENY
2798
2726
depends on RUST
2799
2727
help
2800
2728
Controls how are `build_error!` and `build_assert!` handled during build.
@@ -2822,7 +2750,6 @@ config RUST_BUILD_ASSERT_WARN
2822
2750
2823
2751
config RUST_BUILD_ASSERT_DENY
2824
2752
bool "Deny"
2825
- depends on !RUST_OPT_LEVEL_0
2826
2753
help
2827
2754
Unoptimized calls to `build_error!` will abort compilation.
2828
2755
0 commit comments