Index: compiler-rt/lib/profile/GCDAProfiling.c =================================================================== diff --git a/compiler-rt/lib/profile/GCDAProfiling.c b/compiler-rt/lib/profile/GCDAProfiling.c --- a/compiler-rt/lib/profile/GCDAProfiling.c +++ b/compiler-rt/lib/profile/GCDAProfiling.c @@ -619,7 +619,7 @@ fn_list_insert(&flush_fn_list, fn); } -void __gcov_flush() { +void __custom_llvm_gcov_flush() { struct fn_node* curr = flush_fn_list.head; while (curr) { diff --git a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp index 9af64ed332c..bcebe303ff4 100644 --- a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp @@ -647,7 +647,7 @@ for (auto I : ForkAndExecs) { IRBuilder<> Builder(I); FunctionType *FTy = FunctionType::get(Builder.getVoidTy(), {}, false); - FunctionCallee GCOVFlush = M->getOrInsertFunction("__gcov_flush", FTy); + FunctionCallee GCOVFlush = M->getOrInsertFunction("__custom_llvm_gcov_flush", FTy); Builder.CreateCall(GCOVFlush); I->getParent()->splitBasicBlock(I); } diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp index e113f9a679..b3a07b18c0 100644 --- a/clang/lib/Driver/ToolChains/Darwin.cpp +++ b/clang/lib/Driver/ToolChains/Darwin.cpp @@ -1122,7 +1122,7 @@ // runtime's functionality. if (hasExportSymbolDirective(Args)) { if (needsGCovInstrumentation(Args)) { - addExportedSymbol(CmdArgs, "___gcov_flush"); + addExportedSymbol(CmdArgs, "___custom_llvm_gcov_flush"); addExportedSymbol(CmdArgs, "_flush_fn_list"); addExportedSymbol(CmdArgs, "_writeout_fn_list"); } else {