Skip to content

Commit

Permalink
allow CFGuard on windows-gnullvm
Browse files Browse the repository at this point in the history
  • Loading branch information
mati865 committed Nov 12, 2024
1 parent 81eef2d commit 811c1db
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions compiler/rustc_codegen_llvm/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,8 +274,12 @@ pub(crate) unsafe fn create_module<'ll>(
}
}

// Control Flow Guard is currently only supported by the MSVC linker on Windows.
if sess.target.is_like_msvc {
// Control Flow Guard is currently only supported by MSVC and LLVM on Windows.
if sess.target.is_like_msvc
|| (sess.target.options.os == "windows"
&& sess.target.options.env == "gnu"
&& sess.target.options.abi == "llvm")
{
match sess.opts.cg.control_flow_guard {
CFGuard::Disabled => {}
CFGuard::NoChecks => {
Expand Down

0 comments on commit 811c1db

Please sign in to comment.