[llvm] r294035 - [libfuzzer] chromium-related compilation fixes

Mike Aizatsky via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 3 12:26:44 PST 2017


Author: aizatsky
Date: Fri Feb  3 14:26:44 2017
New Revision: 294035

URL: http://llvm.org/viewvc/llvm-project?rev=294035&view=rev
Log:
[libfuzzer] chromium-related compilation fixes

Reviewers: kcc

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

Modified:
    llvm/trunk/lib/Fuzzer/FuzzerShmemPosix.cpp
    llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp
    llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp

Modified: llvm/trunk/lib/Fuzzer/FuzzerShmemPosix.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerShmemPosix.cpp?rev=294035&r1=294034&r2=294035&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerShmemPosix.cpp (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerShmemPosix.cpp Fri Feb  3 14:26:44 2017
@@ -21,6 +21,7 @@
 #include <sys/mman.h>
 #include <semaphore.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <unistd.h>
 
 namespace fuzzer {

Modified: llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp?rev=294035&r1=294034&r2=294035&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp Fri Feb  3 14:26:44 2017
@@ -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 {

Modified: llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp?rev=294035&r1=294034&r2=294035&view=diff
==============================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp (original)
+++ llvm/trunk/lib/Fuzzer/FuzzerTraceState.cpp Fri Feb  3 14:26:44 2017
@@ -103,7 +103,7 @@ extern "C" {
 
 #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 @@ void __sanitizer_weak_hook_memcmp(void *
   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 @@ void __sanitizer_weak_hook_strncmp(void
 }
 
 
-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 @@ void __sanitizer_weak_hook_strcmp(void *
   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<const uint8_t *>(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<const uint8_t *>(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;




More information about the llvm-commits mailing list