From 811c1db7157b007f59618cf502b348ca8e63f2ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Sun, 27 Oct 2024 19:34:00 +0100 Subject: [PATCH] allow CFGuard on windows-gnullvm --- compiler/rustc_codegen_llvm/src/context.rs | 8 ++++++-- 1 file 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 => {