about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-11-15 00:21:07 +0000
committerbors <bors@rust-lang.org>2024-11-15 00:21:07 +0000
commit3bc6916f4ca50bb83b211d9013dac38e84618750 (patch)
treecdd3f14e3a222acaed0255c6407b12853eda5923
parente84902d35a4d3039c794e139eb12fba3624c5ff1 (diff)
parent811c1db7157b007f59618cf502b348ca8e63f2ea (diff)
downloadrust-3bc6916f4ca50bb83b211d9013dac38e84618750.tar.gz
rust-3bc6916f4ca50bb83b211d9013dac38e84618750.zip
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
-rw-r--r--compiler/rustc_codegen_llvm/src/context.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs
index ba863d9d74b..3a7c7efe03b 100644
--- a/compiler/rustc_codegen_llvm/src/context.rs
+++ b/compiler/rustc_codegen_llvm/src/context.rs
@@ -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 => {