-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Rearrange default_configuration
and CheckCfg::fill_well_known
.
#118494
Rearrange default_configuration
and CheckCfg::fill_well_known
.
#118494
Conversation
cc @Urgau There are some
Any suggestions how to handle these are welcome. |
compiler/rustc_session/src/config.rs
Outdated
|
||
// Target specific values | ||
// njn: sym::sanitizer_cfi_normalize_integers missing! | ||
// njn: sym::sanitizer_cfi_normalize_pointers missing! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be added I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rcvalle What is the story about the configs sanitizer_cfi_normalize_integers
and sanitizer_cfi_normalize_pointers
? Are they expected to be used by users ? or just std
/core
?
If it's only for core
/std
, it shouldn't be added, since it's not user-facing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're expected to be used by users with the cfi_encoding
attribute. For example, they're currently used by the cfi_types crate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, in that case let's define them like this:
// njn: sym::sanitizer_cfi_normalize_pointers missing! | |
ins!(sym::sanitizer_cfi_normalize_integers, no_values); | |
ins!(sym::sanitizer_cfi_generalize_pointers, no_values); |
EDIT: Oops, I meant generalize_pointers
not normalize_integers
. Sorry
Btw, I don't see those cfgs in GATED_CFGS
, the list of unstable cfgs. I think they should be added there since they are unstable, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you're right. Would you mind also adding them as part of this PR? Thank you!
6da79b5
to
afeb3e6
Compare
I have added new comments to the |
Not sure either. |
I would leave them for now. I don't think they're meant to be used outside of |
Please keep these as they're expected to be used by users with the |
Rest assured that we have no plans to remove them. We were just puzzled by the fact that these cfgs were not defined in the well known check-cfg list. |
Thank you! That was probably an oversight on my part when I added them. |
afeb3e6
to
634ae81
Compare
I have added the I haven't touched @bjorn3: should be ready for final review now, thanks. |
This comment has been minimized.
This comment has been minimized.
634ae81
to
cf59759
Compare
I pushed an update that fixes the compile error, addresses @Urgau's comment, and updates expected output for the |
☔ The latest upstream changes (presumably #118687) made this pull request unmergeable. Please resolve the merge conflicts. |
…own, r=nnethercote Strengthen well known check-cfg names and values test rust-lang#118494 is changing the implementation of how we expect well known check-cfg names and values, but we currently don't have a test that checks every well known only some of them. This PR therefore strengthen our well known names/values test to include all of the configs to at least avoid unintended regressions and validate new entry. *this PR also contains some drive-by consolidation of unexpected `target_os`, `target_arch` into a single file* r? `@nnethercote` (maybe? feel free to re-assign)
…own, r=nnethercote Strengthen well known check-cfg names and values test rust-lang#118494 is changing the implementation of how we expect well known check-cfg names and values, but we currently don't have a test that checks every well known only some of them. This PR therefore strengthen our well known names/values test to include all of the configs to at least avoid unintended regressions and validate new entry. *this PR also contains some drive-by consolidation of unexpected `target_os`, `target_arch` into a single file* r? ``@nnethercote`` (maybe? feel free to re-assign)
…own, r=nnethercote Strengthen well known check-cfg names and values test rust-lang#118494 is changing the implementation of how we expect well known check-cfg names and values, but we currently don't have a test that checks every well known only some of them. This PR therefore strengthen our well known names/values test to include all of the configs to at least avoid unintended regressions and validate new entry. *this PR also contains some drive-by consolidation of unexpected `target_os`, `target_arch` into a single file* r? ```@nnethercote``` (maybe? feel free to re-assign)
…own, r=nnethercote Strengthen well known check-cfg names and values test rust-lang#118494 is changing the implementation of how we expect well known check-cfg names and values, but we currently don't have a test that checks every well known only some of them. This PR therefore strengthen our well known names/values test to include all of the configs to at least avoid unintended regressions and validate new entry. *this PR also contains some drive-by consolidation of unexpected `target_os`, `target_arch` into a single file* r? `@nnethercote` (maybe? feel free to re-assign)
…own, r=nnethercote Strengthen well known check-cfg names and values test rust-lang#118494 is changing the implementation of how we expect well known check-cfg names and values, but we currently don't have a test that checks every well known only some of them. This PR therefore strengthen our well known names/values test to include all of the configs to at least avoid unintended regressions and validate new entry. *this PR also contains some drive-by consolidation of unexpected `target_os`, `target_arch` into a single file* r? `@nnethercote` (maybe? feel free to re-assign)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me
Rollup merge of rust-lang#118702 - Urgau:check-cfg-strengthen-well-known, r=nnethercote Strengthen well known check-cfg names and values test rust-lang#118494 is changing the implementation of how we expect well known check-cfg names and values, but we currently don't have a test that checks every well known only some of them. This PR therefore strengthen our well known names/values test to include all of the configs to at least avoid unintended regressions and validate new entry. *this PR also contains some drive-by consolidation of unexpected `target_os`, `target_arch` into a single file* r? `@nnethercote` (maybe? feel free to re-assign)
There are comments saying these two functions should be kept in sync, but they have very different structures, process symbols in different orders, and there are some inconsistencies. This commit reorders them so they're both mostly processing symbols in alphabetical order, which makes cross-checking them a lot easier. The commit also adds some macros to factor out repetitive code patterns. Plus it adds `sanitizer_cfi_normalize_{integers,pointers}` to `fill_well_known`, which were missing. The commit also moves the handling of `sym::test` out of `build_configuration` into `default_configuration`, where all the other symbols are handled.
cf59759
to
22b534d
Compare
I rebased. @bors r=Mark-Simulacrum |
☀️ Test successful - checks-actions |
Finished benchmarking commit (c13187c): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 668.003s -> 669.249s (0.19%) |
…aKO8Ki Add all known `target_feature` configs to check-cfg This PR adds all the known `target_feature` from ~~`rustc_codegen_ssa`~~ `rustc_target` to the well known list of check-cfg. It does so by moving the list from `rustc_codegen_ssa` to `rustc_target` ~~`rustc_session` (I not sure about this, but some of the moved function take a `Session`)~~, then using it the `fill_well_known` function. This already proved to be useful since portable-simd had a bad cfg. cc `@nnethercote` (since we discussed it in rust-lang#118494)
…=TaKO8Ki,GuillaumeGomez,workingjubilee Add all known `target_feature` configs to check-cfg This PR adds all the known `target_feature` from ~~`rustc_codegen_ssa`~~ `rustc_target` to the well known list of check-cfg. It does so by moving the list from `rustc_codegen_ssa` to `rustc_target` ~~`rustc_session` (I not sure about this, but some of the moved function take a `Session`)~~, then using it the `fill_well_known` function. This already proved to be useful since portable-simd had a bad cfg. cc `@nnethercote` (since we discussed it in rust-lang#118494)
Rollup merge of rust-lang#118908 - Urgau:check-cfg-target-features, r=TaKO8Ki,GuillaumeGomez,workingjubilee Add all known `target_feature` configs to check-cfg This PR adds all the known `target_feature` from ~~`rustc_codegen_ssa`~~ `rustc_target` to the well known list of check-cfg. It does so by moving the list from `rustc_codegen_ssa` to `rustc_target` ~~`rustc_session` (I not sure about this, but some of the moved function take a `Session`)~~, then using it the `fill_well_known` function. This already proved to be useful since portable-simd had a bad cfg. cc `@nnethercote` (since we discussed it in rust-lang#118494)
…er-cfi-cfgs, r=Nilstrieb Add missing feature gate for sanitizer CFI cfgs Found during the review of rust-lang#118494 in rust-lang#118494 (comment). cc `@rcvalle`
Rollup merge of rust-lang#119235 - Urgau:missing-feature-gate-sanitizer-cfi-cfgs, r=Nilstrieb Add missing feature gate for sanitizer CFI cfgs Found during the review of rust-lang#118494 in rust-lang#118494 (comment). cc `@rcvalle`
There are comments saying these two functions should be kept in sync, but they have very different structures, process symbols in different orders, and there are some inconsistencies.
This commit reorders them so they're both mostly processing symbols in alphabetical order, which makes cross-checking them a lot easier. The commit also adds some macros to factor out repetitive code patterns.
The commit also moves the handling of
sym::test
out ofbuild_configuration
intodefault_configuration
, where all the other symbols are handled.r? @bjorn3