This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new a135410369 [Fix][LLVM] Keep packed init callbacks local on Mach-O 
(#20052)
a135410369 is described below

commit a1354103693882adfb7767599efd614df0e1bbbe
Author: Akaash Parthasarathy <[email protected]>
AuthorDate: Sun Jul 26 15:05:59 2026 -0700

    [Fix][LLVM] Keep packed init callbacks local on Mach-O (#20052)
    
    Packed-function initialization callbacks already use internal linkage.
    Marking them hidden additionally causes LLVM ORCJIT to reject the
    resulting private-external Mach-O symbols as unexpected definitions.
    This PR removes the redundant hidden visibility.
---
 src/target/llvm/codegen_cpu.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/target/llvm/codegen_cpu.cc b/src/target/llvm/codegen_cpu.cc
index f6dcb29cec..232ef19ca0 100644
--- a/src/target/llvm/codegen_cpu.cc
+++ b/src/target/llvm/codegen_cpu.cc
@@ -714,10 +714,10 @@ llvm::Function* CodeGenCPU::CreatePackedFuncInit(const 
std::string& fname) {
   llvm::IRBuilderBase::InsertPoint saved_ip = builder_->saveIP();
   llvm::Function* saved_function = function_;
   llvm::LLVMContext* ctx = llvm_target_->GetContext();
+  // Internal linkage is sufficient and avoids an ORCJIT error on Mach-O.
   llvm::Function* init_func =
       llvm::Function::Create(ftype_tvm_ffi_handle_init_callback_, 
llvm::Function::InternalLinkage,
                              "__tvm_func_handle_init." + fname, module_.get());
-  init_func->setVisibility(llvm::GlobalValue::HiddenVisibility);
   SetTargetAttributes(init_func);
   function_ = init_func;
   builder_->SetInsertPoint(llvm::BasicBlock::Create(*ctx, "entry", init_func));

Reply via email to