Index: llvm/trunk/lib/Fuzzer/FuzzerShmemPosix.cpp =================================================================== --- llvm/trunk/lib/Fuzzer/FuzzerShmemPosix.cpp +++ llvm/trunk/lib/Fuzzer/FuzzerShmemPosix.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include namespace fuzzer { Index: llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp =================================================================== --- llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp +++ llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp @@ -27,8 +27,10 @@ // The coverage counters and PCs. // These are declared as global variables named "__sancov_*" to simplify // experiments with inlined instrumentation. -alignas(8) uint8_t - __sancov_trace_pc_guard_8bit_counters[fuzzer::TracePC::kNumPCs]; +alignas(8) ATTRIBUTE_INTERFACE +uint8_t __sancov_trace_pc_guard_8bit_counters[fuzzer::TracePC::kNumPCs]; + +ATTRIBUTE_INTERFACE uintptr_t __sancov_trace_pc_pcs[fuzzer::TracePC::kNumPCs]; namespace fuzzer { Index: llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp =================================================================== --- llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp +++ llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp @@ -103,7 +103,7 @@ #if LLVM_FUZZER_DEFINES_SANITIZER_WEAK_HOOOKS -ATTRIBUTE_NO_SANITIZE_MEMORY +ATTRIBUTE_INTERFACE ATTRIBUTE_NO_SANITIZE_MEMORY void __sanitizer_weak_hook_memcmp(void *caller_pc, const void *s1, const void *s2, size_t n, int result) { if (result == 0) return; // No reason to mutate. @@ -111,7 +111,7 @@ fuzzer::TPC.AddValueForMemcmp(caller_pc, s1, s2, n, /*StopAtZero*/false); } -ATTRIBUTE_NO_SANITIZE_MEMORY +ATTRIBUTE_INTERFACE ATTRIBUTE_NO_SANITIZE_MEMORY void __sanitizer_weak_hook_strncmp(void *caller_pc, const char *s1, const char *s2, size_t n, int result) { if (result == 0) return; // No reason to mutate. @@ -124,7 +124,7 @@ } -ATTRIBUTE_NO_SANITIZE_MEMORY +ATTRIBUTE_INTERFACE ATTRIBUTE_NO_SANITIZE_MEMORY void __sanitizer_weak_hook_strcmp(void *caller_pc, const char *s1, const char *s2, int result) { if (result == 0) return; // No reason to mutate. @@ -135,31 +135,31 @@ fuzzer::TPC.AddValueForMemcmp(caller_pc, s1, s2, N, /*StopAtZero*/true); } -ATTRIBUTE_NO_SANITIZE_MEMORY +ATTRIBUTE_INTERFACE ATTRIBUTE_NO_SANITIZE_MEMORY void __sanitizer_weak_hook_strncasecmp(void *called_pc, const char *s1, const char *s2, size_t n, int result) { return __sanitizer_weak_hook_strncmp(called_pc, s1, s2, n, result); } -ATTRIBUTE_NO_SANITIZE_MEMORY +ATTRIBUTE_INTERFACE ATTRIBUTE_NO_SANITIZE_MEMORY void __sanitizer_weak_hook_strcasecmp(void *called_pc, const char *s1, const char *s2, int result) { return __sanitizer_weak_hook_strcmp(called_pc, s1, s2, result); } -ATTRIBUTE_NO_SANITIZE_MEMORY +ATTRIBUTE_INTERFACE ATTRIBUTE_NO_SANITIZE_MEMORY void __sanitizer_weak_hook_strstr(void *called_pc, const char *s1, const char *s2, char *result) { TS->AddInterestingWord(reinterpret_cast(s2), strlen(s2)); } -ATTRIBUTE_NO_SANITIZE_MEMORY +ATTRIBUTE_INTERFACE ATTRIBUTE_NO_SANITIZE_MEMORY void __sanitizer_weak_hook_strcasestr(void *called_pc, const char *s1, const char *s2, char *result) { TS->AddInterestingWord(reinterpret_cast(s2), strlen(s2)); } -ATTRIBUTE_NO_SANITIZE_MEMORY +ATTRIBUTE_INTERFACE ATTRIBUTE_NO_SANITIZE_MEMORY void __sanitizer_weak_hook_memmem(void *called_pc, const void *s1, size_t len1, const void *s2, size_t len2, void *result) { if (fuzzer::DoingMyOwnMemmem) return;