summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/fuzzer/FuzzerShmemFuchsia.cpp
diff options
context:
space:
mode:
authorMatt Morehouse <mascasa@google.com>2017-12-08 22:54:44 +0000
committerMatt Morehouse <mascasa@google.com>2017-12-08 22:54:44 +0000
commitffb1132e52f1bba733305116db82eec86dbe4736 (patch)
tree6b9ce769b53eaa12c1e257e77111ab9873b3b238 /compiler-rt/lib/fuzzer/FuzzerShmemFuchsia.cpp
parent440f69c95aeadb6e4c920d81db50c44c17810d97 (diff)
downloadbcm5719-llvm-ffb1132e52f1bba733305116db82eec86dbe4736.tar.gz
bcm5719-llvm-ffb1132e52f1bba733305116db82eec86dbe4736.zip
[libFuzzer] Add support for Fuchsia OS.
Summary: This patch adds the initial support for Fuchsia. - LIBFUZZER_FUCHSIA is added as an OS type in FuzzerDefs.h - Fuchsia is, by design, not POSIX compliant. However, it does use ELF and supports common POSIX I/O functions. Thus, FuzzerExtFunctions.h and FuzzerIO.h are implemented by extending the header guards in FuzzerExtFunctionsWeak.cpp and FuzzerIOPosix.cpp to include LIBFUZZER_FUCHSIA. - The platform-specific portions of FuzzerUtil.h are implemented by FuzzerUtilFuchsia.cpp, which makes use of exception ports, syscalls, and the launchpad library. - The experimental equivalence server is not currently supported, so FuzzerShmem.h is implemented by stub methods in FuzzerShmemFuchsia.cpp. Any future implementation will likely involve VMOs. Tested with ASAN/SanCov on Fuchsia/x86-64 with the canonical toy fuzzer. Patch By: aarongreen Reviewers: kcc, morehouse, flowerhack, phosek Reviewed By: kcc, phosek, Eugene.Zelenko Subscribers: srhines, mgorny, Eugene.Zelenko Differential Revision: https://reviews.llvm.org/D40974 llvm-svn: 320210
Diffstat (limited to 'compiler-rt/lib/fuzzer/FuzzerShmemFuchsia.cpp')
-rw-r--r--compiler-rt/lib/fuzzer/FuzzerShmemFuchsia.cpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/compiler-rt/lib/fuzzer/FuzzerShmemFuchsia.cpp b/compiler-rt/lib/fuzzer/FuzzerShmemFuchsia.cpp
new file mode 100644
index 00000000000..e9ce50c2ac8
--- /dev/null
+++ b/compiler-rt/lib/fuzzer/FuzzerShmemFuchsia.cpp
@@ -0,0 +1,38 @@
+//===- FuzzerShmemPosix.cpp - Posix shared memory ---------------*- C++ -* ===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+// SharedMemoryRegion. For Fuchsia, this is just stubs as equivalence servers
+// are not currently supported.
+//===----------------------------------------------------------------------===//
+#include "FuzzerDefs.h"
+
+#if LIBFUZZER_FUCHSIA
+
+#include "FuzzerShmem.h"
+
+namespace fuzzer {
+
+bool SharedMemoryRegion::Create(const char *Name) {
+ return false;
+}
+
+bool SharedMemoryRegion::Open(const char *Name) {
+ return false;
+}
+
+bool SharedMemoryRegion::Destroy(const char *Name) {
+ return false;
+}
+
+void SharedMemoryRegion::Post(int Idx) {}
+
+void SharedMemoryRegion::Wait(int Idx) {}
+
+} // namespace fuzzer
+
+#endif // LIBFUZZER_FUCHSIA
OpenPOWER on IntegriCloud