Skip to content

Commit 80d5185

Browse files
[PGO][Offload] Don't define GPU entrypoint on Darwin (#132966)
This PR partially reverts 83e180c and instead opts to not define the GPU entry point on Darwin platforms. Marking `__llvm_write_custom_profile` as used was causing issues on embedded platforms.
1 parent ece72e2 commit 80d5185

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

clang/lib/Driver/ToolChains/Darwin.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,15 +1481,11 @@ void Darwin::addProfileRTLibs(const ArgList &Args,
14811481
// If we have a symbol export directive and we're linking in the profile
14821482
// runtime, automatically export symbols necessary to implement some of the
14831483
// runtime's functionality.
1484-
if (hasExportSymbolDirective(Args)) {
1485-
if (ForGCOV) {
1486-
addExportedSymbol(CmdArgs, "___gcov_dump");
1487-
addExportedSymbol(CmdArgs, "___gcov_reset");
1488-
addExportedSymbol(CmdArgs, "_writeout_fn_list");
1489-
addExportedSymbol(CmdArgs, "_reset_fn_list");
1490-
} else {
1491-
addExportedSymbol(CmdArgs, "___llvm_write_custom_profile");
1492-
}
1484+
if (hasExportSymbolDirective(Args) && ForGCOV) {
1485+
addExportedSymbol(CmdArgs, "___gcov_dump");
1486+
addExportedSymbol(CmdArgs, "___gcov_reset");
1487+
addExportedSymbol(CmdArgs, "_writeout_fn_list");
1488+
addExportedSymbol(CmdArgs, "_reset_fn_list");
14931489
}
14941490

14951491
// Align __llvm_prf_{cnts,bits,data} sections to the maximum expected page

compiler-rt/lib/profile/InstrProfilingFile.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1273,6 +1273,7 @@ COMPILER_RT_VISIBILITY int __llvm_profile_set_file_object(FILE *File,
12731273
return 0;
12741274
}
12751275

1276+
#ifndef __APPLE__
12761277
int __llvm_write_custom_profile(const char *Target,
12771278
const __llvm_profile_data *DataBegin,
12781279
const __llvm_profile_data *DataEnd,
@@ -1381,5 +1382,6 @@ int __llvm_write_custom_profile(const char *Target,
13811382

13821383
return ReturnValue;
13831384
}
1385+
#endif
13841386

13851387
#endif

0 commit comments

Comments
 (0)