llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-clang @llvm/pr-subscribers-clang-driver Author: Ethan Luis McDonough (EthanLuisMcDonough) <details> <summary>Changes</summary> This PR partially reverts 83e180c and instead opts to hide the GPU entry point on Darwin platforms. Marking `__llvm_write_custom_profile` as used was causing issues on embedded platforms. --- Full diff: https://github.com/llvm/llvm-project/pull/132966.diff 3 Files Affected: - (modified) clang/lib/Driver/ToolChains/Darwin.cpp (+5-9) - (modified) compiler-rt/lib/profile/InstrProfilingFile.c (+5-7) - (modified) compiler-rt/lib/profile/InstrProfilingPort.h (+2) ``````````diff diff --git a/clang/lib/Driver/ToolChains/Darwin.cpp b/clang/lib/Driver/ToolChains/Darwin.cpp index e67997314da36..4c88722730598 100644 --- a/clang/lib/Driver/ToolChains/Darwin.cpp +++ b/clang/lib/Driver/ToolChains/Darwin.cpp @@ -1481,15 +1481,11 @@ void Darwin::addProfileRTLibs(const ArgList &Args, // If we have a symbol export directive and we're linking in the profile // runtime, automatically export symbols necessary to implement some of the // runtime's functionality. - if (hasExportSymbolDirective(Args)) { - if (ForGCOV) { - addExportedSymbol(CmdArgs, "___gcov_dump"); - addExportedSymbol(CmdArgs, "___gcov_reset"); - addExportedSymbol(CmdArgs, "_writeout_fn_list"); - addExportedSymbol(CmdArgs, "_reset_fn_list"); - } else { - addExportedSymbol(CmdArgs, "___llvm_write_custom_profile"); - } + if (hasExportSymbolDirective(Args) && ForGCOV) { + addExportedSymbol(CmdArgs, "___gcov_dump"); + addExportedSymbol(CmdArgs, "___gcov_reset"); + addExportedSymbol(CmdArgs, "_writeout_fn_list"); + addExportedSymbol(CmdArgs, "_reset_fn_list"); } // Align __llvm_prf_{cnts,bits,data} sections to the maximum expected page diff --git a/compiler-rt/lib/profile/InstrProfilingFile.c b/compiler-rt/lib/profile/InstrProfilingFile.c index 19467429cf4c3..9f75ce5ef97d1 100644 --- a/compiler-rt/lib/profile/InstrProfilingFile.c +++ b/compiler-rt/lib/profile/InstrProfilingFile.c @@ -1273,13 +1273,11 @@ COMPILER_RT_VISIBILITY int __llvm_profile_set_file_object(FILE *File, return 0; } -int __llvm_write_custom_profile(const char *Target, - const __llvm_profile_data *DataBegin, - const __llvm_profile_data *DataEnd, - const char *CountersBegin, - const char *CountersEnd, const char *NamesBegin, - const char *NamesEnd, - const uint64_t *VersionOverride) { +COMPILER_RT_GPU_ENTRYPOINT int __llvm_write_custom_profile( + const char *Target, const __llvm_profile_data *DataBegin, + const __llvm_profile_data *DataEnd, const char *CountersBegin, + const char *CountersEnd, const char *NamesBegin, const char *NamesEnd, + const uint64_t *VersionOverride) { int ReturnValue = 0, FilenameLength, TargetLength; char *FilenameBuf, *TargetFilename; const char *Filename; diff --git a/compiler-rt/lib/profile/InstrProfilingPort.h b/compiler-rt/lib/profile/InstrProfilingPort.h index 66d697885eaee..ed56beb6577a3 100644 --- a/compiler-rt/lib/profile/InstrProfilingPort.h +++ b/compiler-rt/lib/profile/InstrProfilingPort.h @@ -43,8 +43,10 @@ #if defined(__APPLE__) #define COMPILER_RT_SEG "__DATA," +#define COMPILER_RT_GPU_ENTRYPOINT COMPILER_RT_VISIBILITY #else #define COMPILER_RT_SEG "" +#define COMPILER_RT_GPU_ENTRYPOINT #endif #ifdef _MSC_VER `````````` </details> https://github.com/llvm/llvm-project/pull/132966 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits