Skip to content

Commit 590d9bf

Browse files
authored
Unrolled build for rust-lang#136374
Rollup merge of rust-lang#136374 - saethlin:enzyme-linkage, r=oli-obk Add link attribute for Enzyme's LLVMRust FFI Since rust-lang#133429 landed, the compiler doesn't build with `-Zcross-crate-inline-threshold=always`. I don't expect anyone else to test or fix issues with that goofy configuration, so I'm fixing it. This PR adds a link attribute just like rust-lang#118142 for all the new LLVMRust functions. They were actually added in rust-lang#130060 but weren't used until just now.
2 parents e08cd3c + ce7cb31 commit 590d9bf

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ use libc::{c_char, c_uint};
44

55
use super::ffi::{BasicBlock, Metadata, Module, Type, Value};
66
use crate::llvm::Bool;
7+
8+
#[link(name = "llvm-wrapper", kind = "static")]
79
extern "C" {
810
// Enzyme
911
pub fn LLVMRustHasMetadata(I: &Value, KindID: c_uint) -> bool;
@@ -12,10 +14,13 @@ extern "C" {
1214
pub fn LLVMRustDIGetInstMetadata(I: &Value) -> Option<&Metadata>;
1315
pub fn LLVMRustEraseInstFromParent(V: &Value);
1416
pub fn LLVMRustGetTerminator<'a>(B: &BasicBlock) -> &'a Value;
15-
pub fn LLVMDumpModule(M: &Module);
16-
pub fn LLVMDumpValue(V: &Value);
1717
pub fn LLVMRustVerifyFunction(V: &Value, action: LLVMRustVerifierFailureAction) -> Bool;
18+
}
1819

20+
extern "C" {
21+
// Enzyme
22+
pub fn LLVMDumpModule(M: &Module);
23+
pub fn LLVMDumpValue(V: &Value);
1924
pub fn LLVMGetFunctionCallConv(F: &Value) -> c_uint;
2025
pub fn LLVMGetReturnType(T: &Type) -> &Type;
2126
pub fn LLVMGetParams(Fnc: &Value, parms: *mut &Value);

0 commit comments

Comments
 (0)