llvm-project/compiler-rt/test
Vedant Kumar ff3227e77d [profile] Move __llvm_profile_filename into a separate object
Users can specify the path a raw profile is written to by passing
-fprofile-instr-generate=<path>, but this functionality broke on Darwin
after __llvm_profile_filename was made weak [1], resulting in profiles
being written to "default.profraw" even when <path> is specified.

The situation is that instrumented programs provide a weak definition of
__llvm_profile_filename, which conflicts with a weak redefinition
provided by the profiling runtime.

The linker appears to pick the 'winning' definition arbitrarily: on
Darwin, it usually prefers the larger definition, which is probably why
the instrprof-override-filename.c test has been passing.

The fix is to move the runtime's definition into a separate object file
within the archive. This means that the linker won't "see" the runtime's
definition unless the user program has not provided one. I couldn't
think of a great way to test this other than to mimic the Darwin
failure: use -fprofile-instr-generate=<some-small-path>.

Testing: check-{clang,profile}, modified instrprof-override-filename.c.

[1] [Profile] deprecate __llvm_profile_override_default_filename
https://reviews.llvm.org/D22613
https://reviews.llvm.org/D22614

Differential Revision: https://reviews.llvm.org/D34797

llvm-svn: 306710
2017-06-29 17:42:24 +00:00
..
BlocksRuntime
asan Revert "[asan] Control location of symbolizer on device using ANDROID_SYMBOLIZER_PATH" 2017-06-29 02:48:06 +00:00
builtins Add generic __bswap[ds]i2 implementations 2017-05-25 14:52:14 +00:00
cfi [cfi] Enable icall tests with thinlto. 2017-06-16 00:18:35 +00:00
dfsan [mips] XFAIL dfsan's custom.cc test on mips64. 2017-05-09 19:17:16 +00:00
esan [esan] Disable flaky tests for PR33590 2017-06-26 01:02:54 +00:00
interception Revert "[interception] Check for export table's size before referring to its elements." 2017-01-22 03:30:14 +00:00
lsan Revert "[LSan] Make LSan allocator allocator_may_return_null compliant" 2017-06-29 04:39:17 +00:00
msan [Sanitizers] Operator new() interceptors always die on allocation error 2017-06-28 21:58:57 +00:00
profile [profile] Move __llvm_profile_filename into a separate object 2017-06-29 17:42:24 +00:00
safestack [Safestack] Fix the canary test to catch the libc's message regarding stack smashing 2017-05-10 08:06:42 +00:00
sanitizer_common [sanitizer-coverage] Stop marking this test as unsupported on Darwin 2017-06-21 19:04:59 +00:00
scudo [scudo] Change aligned alloc functions to be more compliant & perf changes 2017-06-29 16:45:20 +00:00
tsan [Sanitizers] Operator new() interceptors always die on allocation error 2017-06-28 21:58:57 +00:00
ubsan [ubsan] Improve diagnostics for return value checks (compiler-rt) 2017-06-23 21:32:48 +00:00
xray [XRay][compiler-rt][NFC] Move test case into correct directory. 2017-06-28 05:21:15 +00:00
CMakeLists.txt Don't double-include cfi tests on linux 2017-06-27 19:52:35 +00:00
lit.common.cfg [asan] Add a compilation wrapper that codesigns shared libraries to support iOS simulator testing 2017-04-28 04:55:35 +00:00
lit.common.configured.in [asan] Add support for running lit tests in the iOS Simulator 2017-04-26 18:59:22 +00:00