summaryrefslogtreecommitdiff
path: root/lib/profile/InstrProfilingFile.c
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-10-18 00:02:28 +0000
committerVedant Kumar <vsk@apple.com>2016-10-18 00:02:28 +0000
commit0516202dcad2640b569938fdde7cbbba55fdfb65 (patch)
treee4d6a492a190c3340810adf7b34b4ceef9673c37 /lib/profile/InstrProfilingFile.c
parent8c1bb14d81b6f30818c23646dd2a56990f072739 (diff)
[profile] Mark lprofCurFilename as COMPILER_RT_WEAK
This makes __llvm_profile_set_filename() work across dylib boundaries on Darwin. This functionality was originally meant to work on all platforms, but was moved to a Linux-only directory with r272404. The root cause of the test failure on Darwin was that lprofCurFilename was not marked weak. Each dylib maintained its own copy of the variable due to the two-level namespace. Tested with check-profile (on Darwin). I don't expect this to regress other platforms. Differential Revision: https://reviews.llvm.org/D25707 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@284440 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile/InstrProfilingFile.c')
-rw-r--r--lib/profile/InstrProfilingFile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/profile/InstrProfilingFile.c b/lib/profile/InstrProfilingFile.c
index e264f6388..44f5d9ab8 100644
--- a/lib/profile/InstrProfilingFile.c
+++ b/lib/profile/InstrProfilingFile.c
@@ -82,7 +82,8 @@ typedef struct lprofFilename {
ProfileNameSpecifier PNS;
} lprofFilename;
-lprofFilename lprofCurFilename = {0, 0, 0, {0}, {0}, 0, 0, 0, PNS_unknown};
+COMPILER_RT_WEAK lprofFilename lprofCurFilename = {0, 0, 0, {0}, {0},
+ 0, 0, 0, PNS_unknown};
int getpid(void);
static int getCurFilenameLength();