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:
Matthias Krüger 2025-04-05 10:18:03 +02:00 committed by GitHub
commit 543160dd62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 148 additions and 0 deletions

View 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}