Skip to content

Commit

Permalink
Rollup merge of rust-lang#116037 - wesleywiser:stack_protector_test_w…
Browse files Browse the repository at this point in the history
…indows, r=cuviper

Add `-Zstack-protector` test for Windows targets

Add variants of the `stack-protector-heuristics-effect.rs` test for 32-bit and 64-bit MSVC Windows and update the original test to run on GNU Windows targets.

I added two tests instead of trying to modify the original because:
  - MSVC uses a different function name (`__security_check_cookie` to perform the test rather than doing the test inline and calling `__stack_chk_fail`).
  - LLVM's stack protection pass doesn't currently support generating checks for [frames with funclet based EH personality](https://github.com/llvm/llvm-project/blob/37fd3c96b917096d8a550038f6e61cdf0fc4174f/llvm/lib/CodeGen/StackProtector.cpp#L103C1-L109C4).
  - 32-bit Windows uses classic EH while 64-bit Windows uses table-based EH which results in slightly different codegen.

[CI run with test passing on {i686,x86_64}-{msvc,mingw}](https://github.com/rust-lang/rust/actions/runs/6275450644/job/17042958375?pr=116037)
  • Loading branch information
fmease authored Oct 19, 2023
2 parents 89432aa + 316c9a9 commit 0e17e5b
Show file tree
Hide file tree
Showing 3 changed files with 821 additions and 1 deletion.
Loading

0 comments on commit 0e17e5b

Please sign in to comment.