about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorMateusz Mikuła <mati865@gmail.com>2024-10-27 19:34:00 +0100
committerMateusz Mikuła <mati865@gmail.com>2024-11-12 01:18:53 +0100
commit811c1db7157b007f59618cf502b348ca8e63f2ea (patch)
treee32d78cf46f3b62075fd6575693149e70a7058cf /compiler/rustc_codegen_llvm/src
parent81eef2d362a6f03db6f8928f82d94298d31eb81b (diff)
downloadrust-811c1db7157b007f59618cf502b348ca8e63f2ea.tar.gz
rust-811c1db7157b007f59618cf502b348ca8e63f2ea.zip
allow CFGuard on windows-gnullvm
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
-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 => {