Uh oh!
There was an error while loading. Please reload this page.
Only add CFGuard on windows-msvc targets - #74103
Conversation
rust-highfive
commented
Jul 6, 2020
(rust_highfive has picked a reviewer for you, use r? to override) |
ollie27
commented
Jul 7, 2020
I think this could do with a couple of // run-pass// compile-flags: -Z control-flow-guard// ignore-msvcfnmain(){println!("Hello, world!");}and // run-pass// compile-flags: -Z control-flow-guard// only-msvcfnmain(){println!("Hello, world!");}to make sure we're actually producing working binaries and the warning is printed when it should be. |
ajpaverd
commented
Jul 7, 2020
Thanks @ollie27, do the new |
ollie27
commented
Jul 7, 2020
Yep, looks good. |
nikomatsakis
commented
Jul 8, 2020
@bors r+ |
bors
commented
Jul 8, 2020
📌 Commit 04a78c6a02db8a70da0fd71f7ad3e878e20c16e7 has been approved by |
@bors r- -- wait, CI looks unhappy? |
Yes, I'm wondering if this is the correct way to test compiler warnings? In the CI, the |
nikomatsakis
commented
Jul 8, 2020
@ajpaverd where is that warning emitted, anyway? I think that with a |
ajpaverd
commented
Jul 8, 2020
@nikomatsakis these warnings are emitted from librustc_codegen_ssa/back/linker.rs. So it looks like the test passes when run normally (L1509), but fails when run with |
nikomatsakis
commented
Jul 8, 2020
@ajpaverd ah, I see, that's annoying. I guess the question then is whether there is some kind of test mode that only runs normally |
ajpaverd
commented
Jul 9, 2020
So I think changing this to a |
You can use Emitting hard-coded warnings is never a good idea though, they've been gradually removed from the compiler in favor of lints or hard errors. |
ajpaverd
commented
Jul 9, 2020
@petrochenkov thanks! I'm actually in favor of removing these warnings to make this cleaner and more in-line with other |
nikomatsakis
commented
Jul 10, 2020
@bors r+ |
bors
commented
Jul 10, 2020
📌 Commit 1ca7bfe has been approved by |
Manishearth
commented
Jul 10, 2020
@bors rollup=iffy |
…atsakis Only add CFGuard on `windows-msvc` targets As @ollie27 pointed out in rust-lang#73893, the `cfguard` module flag causes incorrect behavior on `windows-gnu` targets. This patch restricts rustc to only add this flag for `windows-msvc` targets (this may need to be changed if other linkers gain support for CFGuard).
…atsakis Only add CFGuard on `windows-msvc` targets As @ollie27 pointed out in rust-lang#73893, the `cfguard` module flag causes incorrect behavior on `windows-gnu` targets. This patch restricts rustc to only add this flag for `windows-msvc` targets (this may need to be changed if other linkers gain support for CFGuard).
…atsakis Only add CFGuard on `windows-msvc` targets As @ollie27 pointed out in rust-lang#73893, the `cfguard` module flag causes incorrect behavior on `windows-gnu` targets. This patch restricts rustc to only add this flag for `windows-msvc` targets (this may need to be changed if other linkers gain support for CFGuard).
…arth Rollup of 19 pull requests Successful merges: - rust-lang#71322 (Accept tuple.0.0 as tuple indexing (take 2)) - rust-lang#72303 (Add core::future::{poll_fn, PollFn}) - rust-lang#73862 (Stabilize casts and coercions to `&[T]` in const fn) - rust-lang#73887 (stabilize const mem::forget) - rust-lang#73989 (adjust ub-enum test to be endianess-independent) - rust-lang#74045 (Explain effects of debugging options from config.toml) - rust-lang#74076 (Add `read_exact_at` and `write_all_at` to WASI's `FileExt`) - rust-lang#74099 (Add VecDeque::range* methods) - rust-lang#74100 (Use str::strip* in bootstrap) - rust-lang#74103 (Only add CFGuard on `windows-msvc` targets) - rust-lang#74109 (Only allow `repr(i128/u128)` on enum) - rust-lang#74122 (Start-up clean-up) - rust-lang#74125 (Correctly mark the ending span of a match arm) - rust-lang#74127 (Avoid "whitelist") - rust-lang#74129 (:arrow_up: rust-analyzer) - rust-lang#74135 (Update books) - rust-lang#74145 (Update rust-installer to latest version) - rust-lang#74161 (Fix disabled dockerfiles) - rust-lang#74162 (take self by value in ToPredicate) Failed merges: r? @ghost
ognevny
commented
Aug 10, 2024
did the situation change for non-msvc targets? |
As @ollie27 pointed out in #73893, the
cfguardmodule flag causes incorrect behavior onwindows-gnutargets. This patch restricts rustc to only add this flag forwindows-msvctargets (this may need to be changed if other linkers gain support for CFGuard).