diff options
| author | Marcos Pividori <mpividori@google.com> | 2017-01-29 05:44:59 +0000 |
|---|---|---|
| committer | Marcos Pividori <mpividori@google.com> | 2017-01-29 05:44:59 +0000 |
| commit | 8650f5d1a19aeaeb91757db6df82ad352eb25e9b (patch) | |
| tree | 2adbe8d7172c3a0c6bcda6a1966cad17624abf64 /compiler-rt/lib/sanitizer_common/sancov_flags.cc | |
| parent | 3a556111b9e40aa68f8f9dbb4309b4179b7a7fe2 (diff) | |
| download | bcm5719-llvm-8650f5d1a19aeaeb91757db6df82ad352eb25e9b.tar.gz bcm5719-llvm-8650f5d1a19aeaeb91757db6df82ad352eb25e9b.zip | |
General definition for weak functions
In this diff, I define a general macro for defining weak functions
with a default implementation: "SANITIZER_INTERFACE_WEAK_DEF()".
This way, we simplify the implementation for different platforms.
For example, we cannot define weak functions on Windows, but we can
use linker pragmas to create an alias to a default implementation.
All of these implementation details are hidden in the new macro.
Also, as I modify the name for exported weak symbols on Windows, I
needed to temporarily disable "dll_host" test for asan, which checks
the list of functions included in asan_win_dll_thunk.
Differential Revision: https://reviews.llvm.org/D28596
llvm-svn: 293419
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sancov_flags.cc')
| -rw-r--r-- | compiler-rt/lib/sanitizer_common/sancov_flags.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sancov_flags.cc b/compiler-rt/lib/sanitizer_common/sancov_flags.cc index 08fd2a4366a..9abb5b5c598 100644 --- a/compiler-rt/lib/sanitizer_common/sancov_flags.cc +++ b/compiler-rt/lib/sanitizer_common/sancov_flags.cc @@ -15,10 +15,9 @@ #include "sanitizer_flag_parser.h" #include "sanitizer_platform.h" -#if !SANITIZER_LINUX -// other platforms do not have weak symbols out of the box. -extern "C" const char* __sancov_default_options() { return ""; } -#endif +SANITIZER_INTERFACE_WEAK_DEF(const char*, __sancov_default_options, void) { + return ""; +} using namespace __sanitizer; |

