Rollup merge of #138368 - rcvalle:rust-kcfi-arity, r=davidtwco
KCFI: Add KCFI arity indicator support Adds KCFI arity indicator support to the Rust compiler (see https://github.com/rust-lang/rust/issues/138311, https://github.com/llvm/llvm-project/pull/121070, and https://lore.kernel.org/lkml/CANiq72=3ghFxy8E=AU9p+0imFxKr5iU3sd0hVUXed5BA+KjdNQ@mail.gmail.com/).
This commit is contained in:
commit
543160dd62
14 changed files with 148 additions and 0 deletions
19
tests/codegen/sanitizer/kcfi/add-kcfi-arity-flag.rs
Normal file
19
tests/codegen/sanitizer/kcfi/add-kcfi-arity-flag.rs
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Verifies that "kcfi-arity" module flag is added.
|
||||
//
|
||||
//@ add-core-stubs
|
||||
//@ revisions: x86_64
|
||||
//@ [x86_64] compile-flags: --target x86_64-unknown-none
|
||||
//@ [x86_64] needs-llvm-components: x86
|
||||
//@ compile-flags: -Ctarget-feature=-crt-static -Cpanic=abort -Zsanitizer=kcfi -Zsanitizer-kcfi-arity
|
||||
//@ min-llvm-version: 21.0.0
|
||||
|
||||
#![feature(no_core, lang_items)]
|
||||
#![crate_type = "lib"]
|
||||
#![no_core]
|
||||
|
||||
extern crate minicore;
|
||||
use minicore::*;
|
||||
|
||||
pub fn foo() {}
|
||||
|
||||
// CHECK: !{{[0-9]+}} = !{i32 4, !"kcfi-arity", i32 1}
|
Loading…
Add table
Add a link
Reference in a new issue