-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rust: enable Control Flow Guard on gnullvm
- Loading branch information
Showing
3 changed files
with
41 additions
and
3 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
mingw-w64-rust/0002-allow-CFGuard-on-windows-gnullvm.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
From 5d434118afbb3d56e358cc4ab45ea4ff2865a3c0 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= <mati865@gmail.com> | ||
Date: Sun, 27 Oct 2024 19:34:00 +0100 | ||
Subject: [PATCH] allow CFGuard on windows-gnullvm | ||
|
||
--- | ||
compiler/rustc_codegen_llvm/src/context.rs | 16 ++++++++++------ | ||
1 file changed, 10 insertions(+), 6 deletions(-) | ||
|
||
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs | ||
index 3fc153c6cd4..7634d3c88ad 100644 | ||
--- a/compiler/rustc_codegen_llvm/src/context.rs | ||
+++ b/compiler/rustc_codegen_llvm/src/context.rs | ||
@@ -280,8 +280,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 the 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") | ||
+ { | ||
unsafe { | ||
match sess.opts.cg.control_flow_guard { | ||
CFGuard::Disabled => {} | ||
-- | ||
2.43.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters