From 204b2281fa508cf512d343cb1631955a5dfa9e0e Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Mon, 8 Jul 2024 15:49:50 +0200 Subject: Allow disabling ASan instrumentation for globals AddressSanitizer adds instrumentation to global variables unless the [`no_sanitize_address`](https://llvm.org/docs/LangRef.html#global-attributes) attribute is set on them. This commit extends the existing `#[no_sanitize(address)]` attribute to set this; previously it only had the desired effect on functions. --- compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/rustc_codegen_llvm/src/llvm') diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs index 5fad7583e1a..2679d8ba9fe 100644 --- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs +++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs @@ -2474,4 +2474,7 @@ unsafe extern "C" { pub fn LLVMRustIs64BitSymbolicFile(buf_ptr: *const u8, buf_len: usize) -> bool; pub fn LLVMRustIsECObject(buf_ptr: *const u8, buf_len: usize) -> bool; + + pub fn LLVMRustSetNoSanitizeAddress(Global: &Value); + pub fn LLVMRustSetNoSanitizeHWAddress(Global: &Value); } -- cgit 1.4.1-3-g733a5