Auto merge of #132965 - mati865:cfguard-gnullvm, r=wesleywiser

allow CFGuard on windows-gnullvm

No unit tests because of https://github.com/rust-lang/rust/issues/132278
This commit is contained in:
bors 2024-11-15 00:21:07 +00:00
commit 3bc6916f4c

View File

@ -274,8 +274,12 @@ pub(crate) unsafe fn create_module<'ll>(
} }
} }
// Control Flow Guard is currently only supported by the MSVC linker on Windows. // Control Flow Guard is currently only supported by MSVC and LLVM on Windows.
if sess.target.is_like_msvc { 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 { match sess.opts.cg.control_flow_guard {
CFGuard::Disabled => {} CFGuard::Disabled => {}
CFGuard::NoChecks => { CFGuard::NoChecks => {