summaryrefslogtreecommitdiffstats
path: root/lib/Driver/ToolChains/Darwin.cpp
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2018-12-03 20:53:58 +0000
committerVedant Kumar <vsk@apple.com>2018-12-03 20:53:58 +0000
commit96556093d0bdcdc7ead3fba1e514e375fbc66bb5 (patch)
treedc6120f262496b75206792bf8cd2ec9fbb42ef13 /lib/Driver/ToolChains/Darwin.cpp
parent12005cd649feb066e45fb688b80e8c158a44d9bb (diff)
[gcov/Darwin] Ensure external symbols are exported when using an export list
Make sure that symbols needed to implement runtime support for gcov are exported when using an export list on Darwin. Without the clang driver exporting these symbols, the linker hides them, resulting in tapi verification failures. rdar://45944768 Differential Revision: https://reviews.llvm.org/D55151 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@348187 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/ToolChains/Darwin.cpp')
-rw-r--r--lib/Driver/ToolChains/Darwin.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/Driver/ToolChains/Darwin.cpp b/lib/Driver/ToolChains/Darwin.cpp
index 50c0db5b5a..452b6b89ca 100644
--- a/lib/Driver/ToolChains/Darwin.cpp
+++ b/lib/Driver/ToolChains/Darwin.cpp
@@ -1034,11 +1034,17 @@ void Darwin::addProfileRTLibs(const ArgList &Args,
// runtime, automatically export symbols necessary to implement some of the
// runtime's functionality.
if (hasExportSymbolDirective(Args)) {
- addExportedSymbol(CmdArgs, "___llvm_profile_filename");
- addExportedSymbol(CmdArgs, "___llvm_profile_raw_version");
- addExportedSymbol(CmdArgs, "_lprofCurFilename");
+ if (needsGCovInstrumentation(Args)) {
+ addExportedSymbol(CmdArgs, "___gcov_flush");
+ addExportedSymbol(CmdArgs, "_flush_fn_list");
+ addExportedSymbol(CmdArgs, "_writeout_fn_list");
+ } else {
+ addExportedSymbol(CmdArgs, "___llvm_profile_filename");
+ addExportedSymbol(CmdArgs, "___llvm_profile_raw_version");
+ addExportedSymbol(CmdArgs, "_lprofCurFilename");
+ addExportedSymbol(CmdArgs, "_lprofMergeValueProfData");
+ }
addExportedSymbol(CmdArgs, "_lprofDirMode");
- addExportedSymbol(CmdArgs, "_lprofMergeValueProfData");
}
}