rust/compiler/rustc_codegen_llvm/src
Manish Goregaokar 38bbc39895
Rollup merge of #105452 - rcvalle:rust-cfi-3, r=bjorn3
Add cross-language LLVM CFI support to the Rust compiler

This PR adds cross-language LLVM Control Flow Integrity (CFI) support to the Rust compiler by adding the `-Zsanitizer-cfi-normalize-integers` option to be used with Clang `-fsanitize-cfi-icall-normalize-integers` for normalizing integer types (see https://reviews.llvm.org/D139395).

It provides forward-edge control flow protection for C or C++ and Rust -compiled code "mixed binaries" (i.e., for when C or C++ and Rust -compiled code share the same virtual address space). For more information about LLVM CFI and cross-language LLVM CFI support for the Rust compiler, see design document in the tracking issue #89653.

Cross-language LLVM CFI can be enabled with -Zsanitizer=cfi and -Zsanitizer-cfi-normalize-integers, and requires proper (i.e., non-rustc) LTO (i.e., -Clinker-plugin-lto).

Thank you again, ``@bjorn3,`` ``@nikic,`` ``@samitolvanen,`` and the Rust community for all the help!
2023-05-03 16:42:48 -07:00
..
back replace LLVMRustAppendModuleInlineAsm with LLVMAppendModuleInlineAsm, LLVMRustMetadataTypeInContext with LLVMMetadataTypeInContext 2023-04-04 15:12:35 +03:00
coverageinfo Use IntoIterator for mk_fn_sig. 2023-02-17 22:24:34 +11:00
debuginfo rename needs_subst to has_param 2023-04-27 08:35:19 +01:00
llvm Recognize AIX style archive kind 2023-04-19 11:10:47 +08:00
abi.rs Remove double spaces after dots in comments 2023-01-17 08:09:33 +00:00
allocator.rs Revert "Remove #[alloc_error_handler] from the compiler and library" 2023-04-25 00:08:35 +02:00
asm.rs Rollup merge of #105452 - rcvalle:rust-cfi-3, r=bjorn3 2023-05-03 16:42:48 -07:00
attributes.rs Add kernel-address sanitizer support for freestanding targets 2023-02-14 20:54:25 -05:00
base.rs Remove several unused methods from MiscMethods 2022-10-01 16:45:07 +00:00
builder.rs Add cross-language LLVM CFI support to the Rust compiler 2023-05-03 22:41:29 +00:00
callee.rs rename needs_infer to has_infer 2023-04-27 08:35:19 +01:00
common.rs Store hashes in special types so they aren't accidentally encoded as numbers 2023-04-18 10:52:47 -04:00
consts.rs review 2023-04-05 15:08:17 +03:00
context.rs Add cross-language LLVM CFI support to the Rust compiler 2023-05-03 22:41:29 +00:00
declare.rs Add cross-language LLVM CFI support to the Rust compiler 2023-05-03 22:41:29 +00:00
errors.rs errors: generate typed identifiers in each crate 2023-02-22 09:15:53 +00:00
intrinsic.rs Add cross-language LLVM CFI support to the Rust compiler 2023-05-03 22:41:29 +00:00
lib.rs Revert "Remove #[alloc_error_handler] from the compiler and library" 2023-04-25 00:08:35 +02:00
llvm_util.rs More general captures 2023-03-22 15:39:24 +01:00
mono_item.rs rename needs_infer to has_infer 2023-04-27 08:35:19 +01:00
type_.rs Add cross-language LLVM CFI support to the Rust compiler 2023-05-03 22:41:29 +00:00
type_of.rs Remove type-traversal trait aliases 2023-02-22 17:04:58 +00:00
va_arg.rs Implement va_list and va_arg for s390x FFI 2022-12-19 21:07:57 +01:00
value.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00