pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
compiler-rt-netbsd: Add NetBSD scratch for LLVM fuzzer
Module Name: pkgsrc-wip
Committed By: Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By: kamil
Date: Sat Aug 19 21:35:44 2017 +0200
Changeset: 31f39f66f09feecb5d5abd34ab9465b1c52be4d1
Modified Files:
compiler-rt-netbsd/distinfo
compiler-rt-netbsd/patches/patch-cmake_config-ix.cmake
compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerDefs.h
compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerExtFunctionsWeak.cpp
compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerExtraCounters.cpp
compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerUtilLinux.cpp
compiler-rt-netbsd/patches/patch-lib_fuzzer_afl_afl__driver.cpp
compiler-rt-netbsd/patches/patch-lib_fuzzer_tests_CMakeLists.txt
Log Message:
compiler-rt-netbsd: Add NetBSD scratch for LLVM fuzzer
Sponsored by <The NetBSD Foundation>
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=31f39f66f09feecb5d5abd34ab9465b1c52be4d1
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
compiler-rt-netbsd/distinfo | 14 +++++++-------
compiler-rt-netbsd/patches/patch-cmake_config-ix.cmake | 2 +-
compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerDefs.h | 14 +++++++++++---
.../patches/patch-lib_fuzzer_FuzzerExtFunctionsWeak.cpp | 6 +++---
.../patches/patch-lib_fuzzer_FuzzerExtraCounters.cpp | 4 ++--
.../patches/patch-lib_fuzzer_FuzzerUtilLinux.cpp | 6 +++---
.../patches/patch-lib_fuzzer_afl_afl__driver.cpp | 12 +++++++++---
.../patches/patch-lib_fuzzer_tests_CMakeLists.txt | 7 +++++--
8 files changed, 41 insertions(+), 24 deletions(-)
diffs:
diff --git a/compiler-rt-netbsd/distinfo b/compiler-rt-netbsd/distinfo
index 4e7b031b9b..452b0ee3e6 100644
--- a/compiler-rt-netbsd/distinfo
+++ b/compiler-rt-netbsd/distinfo
@@ -15,22 +15,22 @@ Size (llvm-3.6.2.src.tar.xz) = 12802380 bytes
SHA1 (patch-CMakeLists.txt) = ec39ee9f70dd8a00c3ce3740f1d83087049022ac
SHA1 (patch-cmake_Modules_AddCompilerRT.cmake) = 1932fdd666b5a6ca5390c721cd0fb00ec82ea230
SHA1 (patch-cmake_base-config-ix.cmake) = 769409d3071ff8a2aac266c00adf9a80134873c5
-SHA1 (patch-cmake_config-ix.cmake) = 648bf0b34b4b3e37e51758c453604b0f883250e0
+SHA1 (patch-cmake_config-ix.cmake) = 28f518733212fa3eb2f037af9612b7badff43113
SHA1 (patch-lib_CMakeLists.txt) = 4b04484d6cdfd234e38112604c5e4f39e1da80e4
SHA1 (patch-lib_asan_asan__mapping.h) = 73f5f33e946868b4780864e633916376b11b16f1
SHA1 (patch-lib_fuzzer_CMakeLists.txt) = 6b7cbef3eae92feb2b3cb1a859b8c6bd94a39b8f
SHA1 (patch-lib_fuzzer_FuzzerCorpus.h) = b0a51d89bbd2b3e598b6ac54cb4f94a0fe15a9b1
SHA1 (patch-lib_fuzzer_FuzzerCrossOver.cpp) = c8629812dfdd2650ca23f5f3cd0087c08657c3ad
-SHA1 (patch-lib_fuzzer_FuzzerDefs.h) = 3cdea2fdfa7690c4eb2ea091be042d86127e9c1e
+SHA1 (patch-lib_fuzzer_FuzzerDefs.h) = 2404f0e8d99fdece628b4f7647d5c537c392fa16
SHA1 (patch-lib_fuzzer_FuzzerDictionary.h) = 35d7b4e56383da78d09f4380de6f17ddea8b29ca
SHA1 (patch-lib_fuzzer_FuzzerDriver.cpp) = 0974c17b8ad6f7abd18d188afc2adc08b4d1e82c
SHA1 (patch-lib_fuzzer_FuzzerExtFunctions.def) = e0d6fa69c0180f1862696e4d176547668a934793
SHA1 (patch-lib_fuzzer_FuzzerExtFunctions.h) = fe82a8654610c5e38c8c67ace47f0e89832dab5b
SHA1 (patch-lib_fuzzer_FuzzerExtFunctionsDlsym.cpp) = 5cfbac20b75a40306fd2906e199b8e1f015093c1
SHA1 (patch-lib_fuzzer_FuzzerExtFunctionsDlsymWin.cpp) = f6d9fd9a0a8e3bd4b132624a1fea856178a7b6c1
-SHA1 (patch-lib_fuzzer_FuzzerExtFunctionsWeak.cpp) = 280740f903c4e2897ea086590bf26e96fe77cbcc
+SHA1 (patch-lib_fuzzer_FuzzerExtFunctionsWeak.cpp) = 0787d7e07e6825ed085b9dec248cfe70f40810d2
SHA1 (patch-lib_fuzzer_FuzzerExtFunctionsWeakAlias.cpp) = 40c59d86385e26ffef4c38866ffdd0bae3aa9d6b
-SHA1 (patch-lib_fuzzer_FuzzerExtraCounters.cpp) = 2ed133bbf82b40c94f3e228ae0fd90bc816c2aef
+SHA1 (patch-lib_fuzzer_FuzzerExtraCounters.cpp) = 6af08995330ebabc1e7863ac52cf77b1409f8f2f
SHA1 (patch-lib_fuzzer_FuzzerFlags.def) = 0e8fbdcbf99af13f4fc7fcf657f65c2e72d955f7
SHA1 (patch-lib_fuzzer_FuzzerIO.cpp) = b0a6d9c69817b5f852bed78ab849418497405063
SHA1 (patch-lib_fuzzer_FuzzerIO.h) = 01c691ec62c22ca62b5633f0d5f69bc6078870f5
@@ -56,16 +56,16 @@ SHA1 (patch-lib_fuzzer_FuzzerTracePC.h) = aca4959242065c2a53d4f0a463c4d9c2d8a353
SHA1 (patch-lib_fuzzer_FuzzerUtil.cpp) = 326170868dbaed4856794ca270eaed3ce4a35ae0
SHA1 (patch-lib_fuzzer_FuzzerUtil.h) = 8a2c7cc510df9fa25a839de63d7018ac9c9bfb31
SHA1 (patch-lib_fuzzer_FuzzerUtilDarwin.cpp) = e9eef8692ae3910c2c974f83b344093aa60d5060
-SHA1 (patch-lib_fuzzer_FuzzerUtilLinux.cpp) = 6ac9c2fa0880b2095a210778bdd7d5668419e3c3
+SHA1 (patch-lib_fuzzer_FuzzerUtilLinux.cpp) = 321f38ba53a931b4d33882df983076464ba07ec3
SHA1 (patch-lib_fuzzer_FuzzerUtilPosix.cpp) = 79ee126359d08d29d2f62844b4113a14afa13c36
SHA1 (patch-lib_fuzzer_FuzzerUtilWindows.cpp) = a795cf6ff0061d5bb085380dfd08f804d0e01009
SHA1 (patch-lib_fuzzer_FuzzerValueBitMap.h) = ae4d0d89b45316fe64c3050883318dba5979ea65
SHA1 (patch-lib_fuzzer_README.txt) = 7f879642761ad510d3a4832324443d0274113113
-SHA1 (patch-lib_fuzzer_afl_afl__driver.cpp) = 1299afe427afe20cd91e89a2434720d20c56951f
+SHA1 (patch-lib_fuzzer_afl_afl__driver.cpp) = 5ec2878cc190abb05e1ef1407e5ca9dea4e3c36a
SHA1 (patch-lib_fuzzer_build.sh) = 51583bbb85fd43514aa864a8912d58b682ccc2c8
SHA1 (patch-lib_fuzzer_cxx.dict) = d4605b9ebd83d3f155849d971c06ef07311b10ec
SHA1 (patch-lib_fuzzer_standalone_StandaloneFuzzTargetMain.c) = d0470b6d4a3cfdb51cb0d843aca824e96a37deb9
-SHA1 (patch-lib_fuzzer_tests_CMakeLists.txt) = f8062b33e8114fefbf0663f2c2871da7482956b2
+SHA1 (patch-lib_fuzzer_tests_CMakeLists.txt) = b508e40fe09eb73649a2f7eecdec1bd1e26e49d8
SHA1 (patch-lib_fuzzer_tests_FuzzerUnittest.cpp) = d2c25d452c1bdda4274196784e4fb3c0341e3303
SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__posix.cc) = 36a89517584891a1a50536a681a5d42e99ef904d
SHA1 (patch-lib_sanitizer__common_sanitizer__platform__limits__posix.h) = 89302e7b40901faaa471cdd76eefa222a0cc055d
diff --git a/compiler-rt-netbsd/patches/patch-cmake_config-ix.cmake b/compiler-rt-netbsd/patches/patch-cmake_config-ix.cmake
index 3674b63149..657ff32c67 100644
--- a/compiler-rt-netbsd/patches/patch-cmake_config-ix.cmake
+++ b/compiler-rt-netbsd/patches/patch-cmake_config-ix.cmake
@@ -37,7 +37,7 @@ $NetBSD$
endif()
+
+if (COMPILER_RT_HAS_SANITIZER_COMMON AND FUZZER_SUPPORTED_ARCH AND
-+ OS_NAME MATCHES "Darwin|Linux")
++ OS_NAME MATCHES "Darwin|Linux|NetBSD")
+ set(COMPILER_RT_HAS_FUZZER TRUE)
+else()
+ set(COMPILER_RT_HAS_FUZZER FALSE)
diff --git a/compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerDefs.h b/compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerDefs.h
index f82da4ba79..2463ba823e 100644
--- a/compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerDefs.h
+++ b/compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerDefs.h
@@ -1,8 +1,8 @@
$NetBSD$
---- lib/fuzzer/FuzzerDefs.h.orig 2017-08-19 18:02:19.276282767 +0000
+--- lib/fuzzer/FuzzerDefs.h.orig 2017-08-19 18:06:21.552523434 +0000
+++ lib/fuzzer/FuzzerDefs.h
-@@ -0,0 +1,128 @@
+@@ -0,0 +1,136 @@
+//===- FuzzerDefs.h - Internal header for the Fuzzer ------------*- C++ -* ===//
+//
+// The LLVM Compiler Infrastructure
@@ -28,14 +28,22 @@ $NetBSD$
+#ifdef __linux__
+#define LIBFUZZER_APPLE 0
+#define LIBFUZZER_LINUX 1
++#define LIBFUZZER_NETBSD 0
+#define LIBFUZZER_WINDOWS 0
+#elif __APPLE__
+#define LIBFUZZER_APPLE 1
+#define LIBFUZZER_LINUX 0
++#define LIBFUZZER_NETBSD 0
++#define LIBFUZZER_WINDOWS 0
++#elif __NetBSD__
++#define LIBFUZZER_APPLE 0
++#define LIBFUZZER_LINUX 0
++#define LIBFUZZER_NETBSD 1
+#define LIBFUZZER_WINDOWS 0
+#elif _WIN32
+#define LIBFUZZER_APPLE 0
+#define LIBFUZZER_LINUX 0
++#define LIBFUZZER_NETBSD 0
+#define LIBFUZZER_WINDOWS 1
+#else
+#error "Support for your platform has not been implemented"
@@ -45,7 +53,7 @@ $NetBSD$
+# define __has_attribute(x) 0
+#endif
+
-+#define LIBFUZZER_POSIX LIBFUZZER_APPLE || LIBFUZZER_LINUX
++#define LIBFUZZER_POSIX (LIBFUZZER_APPLE || LIBFUZZER_LINUX || LIBFUZZER_NETBSD)
+
+#ifdef __x86_64
+# if __has_attribute(target)
diff --git a/compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerExtFunctionsWeak.cpp b/compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerExtFunctionsWeak.cpp
index 9b91c8b070..843a4a08a2 100644
--- a/compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerExtFunctionsWeak.cpp
+++ b/compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerExtFunctionsWeak.cpp
@@ -1,6 +1,6 @@
$NetBSD$
---- lib/fuzzer/FuzzerExtFunctionsWeak.cpp.orig 2017-08-19 18:02:19.277155657 +0000
+--- lib/fuzzer/FuzzerExtFunctionsWeak.cpp.orig 2017-08-19 18:06:21.652002460 +0000
+++ lib/fuzzer/FuzzerExtFunctionsWeak.cpp
@@ -0,0 +1,54 @@
+//===- FuzzerExtFunctionsWeak.cpp - Interface to external functions -------===//
@@ -18,7 +18,7 @@ $NetBSD$
+// to clients right now.
+//===----------------------------------------------------------------------===//
+#include "FuzzerDefs.h"
-+#if LIBFUZZER_LINUX
++#if LIBFUZZER_LINUX || LIBFUZZER_NETBSD
+
+#include "FuzzerExtFunctions.h"
+#include "FuzzerIO.h"
@@ -56,4 +56,4 @@ $NetBSD$
+
+} // namespace fuzzer
+
-+#endif // LIBFUZZER_LINUX
++#endif // LIBFUZZER_LINUX || LIBFUZZER_NETBSD
diff --git a/compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerExtraCounters.cpp b/compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerExtraCounters.cpp
index 33bd28e839..dde51fd781 100644
--- a/compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerExtraCounters.cpp
+++ b/compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerExtraCounters.cpp
@@ -1,6 +1,6 @@
$NetBSD$
---- lib/fuzzer/FuzzerExtraCounters.cpp.orig 2017-08-19 18:02:19.277368365 +0000
+--- lib/fuzzer/FuzzerExtraCounters.cpp.orig 2017-08-19 18:06:21.680809375 +0000
+++ lib/fuzzer/FuzzerExtraCounters.cpp
@@ -0,0 +1,41 @@
+//===- FuzzerExtraCounters.cpp - Extra coverage counters ------------------===//
@@ -16,7 +16,7 @@ $NetBSD$
+
+#include "FuzzerDefs.h"
+
-+#if LIBFUZZER_LINUX
++#if LIBFUZZER_LINUX || LIBFUZZER_NETBSD
+__attribute__((weak)) extern uint8_t __start___libfuzzer_extra_counters;
+__attribute__((weak)) extern uint8_t __stop___libfuzzer_extra_counters;
+
diff --git a/compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerUtilLinux.cpp b/compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerUtilLinux.cpp
index 1722bbfb73..ab9825ee23 100644
--- a/compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerUtilLinux.cpp
+++ b/compiler-rt-netbsd/patches/patch-lib_fuzzer_FuzzerUtilLinux.cpp
@@ -1,6 +1,6 @@
$NetBSD$
---- lib/fuzzer/FuzzerUtilLinux.cpp.orig 2017-08-19 18:02:19.280774289 +0000
+--- lib/fuzzer/FuzzerUtilLinux.cpp.orig 2017-08-19 18:06:22.041673476 +0000
+++ lib/fuzzer/FuzzerUtilLinux.cpp
@@ -0,0 +1,24 @@
+//===- FuzzerUtilLinux.cpp - Misc utils for Linux. ------------------------===//
@@ -14,7 +14,7 @@ $NetBSD$
+// Misc utils for Linux.
+//===----------------------------------------------------------------------===//
+#include "FuzzerDefs.h"
-+#if LIBFUZZER_LINUX
++#if LIBFUZZER_LINUX || LIBFUZZER_NETBSD
+
+#include <stdlib.h>
+
@@ -26,4 +26,4 @@ $NetBSD$
+
+} // namespace fuzzer
+
-+#endif // LIBFUZZER_LINUX
++#endif // LIBFUZZER_LINUX || LIBFUZZER_NETBSD
diff --git a/compiler-rt-netbsd/patches/patch-lib_fuzzer_afl_afl__driver.cpp b/compiler-rt-netbsd/patches/patch-lib_fuzzer_afl_afl__driver.cpp
index 943b162f19..c215f582b7 100644
--- a/compiler-rt-netbsd/patches/patch-lib_fuzzer_afl_afl__driver.cpp
+++ b/compiler-rt-netbsd/patches/patch-lib_fuzzer_afl_afl__driver.cpp
@@ -1,8 +1,8 @@
$NetBSD$
---- lib/fuzzer/afl/afl_driver.cpp.orig 2017-08-19 18:02:19.281430930 +0000
+--- lib/fuzzer/afl/afl_driver.cpp.orig 2017-08-19 18:06:22.111520157 +0000
+++ lib/fuzzer/afl/afl_driver.cpp
-@@ -0,0 +1,335 @@
+@@ -0,0 +1,341 @@
+//===- afl_driver.cpp - a glue between AFL and libFuzzer --------*- C++ -* ===//
+//
+// The LLVM Compiler Infrastructure
@@ -73,9 +73,15 @@ $NetBSD$
+#ifdef __linux__
+#define LIBFUZZER_LINUX 1
+#define LIBFUZZER_APPLE 0
++#define LIBFUZZER_NETBSD 0
+#elif __APPLE__
+#define LIBFUZZER_LINUX 0
+#define LIBFUZZER_APPLE 1
++#define LIBFUZZER_NETBSD 0
++#elif __NetBSD__
++#define LIBFUZZER_LINUX 0
++#define LIBFUZZER_APPLE 0
++#define LIBFUZZER_NETBSD 1
+#else
+#error "Support for your platform has not been implemented"
+#endif
@@ -124,7 +130,7 @@ $NetBSD$
+ struct rusage usage;
+ if (getrusage(RUSAGE_SELF, &usage))
+ return 0;
-+ if (LIBFUZZER_LINUX) {
++ if (LIBFUZZER_LINUX || LIBFUZZER_NETBSD) {
+ // ru_maxrss is in KiB
+ return usage.ru_maxrss >> 10;
+ } else if (LIBFUZZER_APPLE) {
diff --git a/compiler-rt-netbsd/patches/patch-lib_fuzzer_tests_CMakeLists.txt b/compiler-rt-netbsd/patches/patch-lib_fuzzer_tests_CMakeLists.txt
index f0696e5be7..bce62277dd 100644
--- a/compiler-rt-netbsd/patches/patch-lib_fuzzer_tests_CMakeLists.txt
+++ b/compiler-rt-netbsd/patches/patch-lib_fuzzer_tests_CMakeLists.txt
@@ -1,8 +1,8 @@
$NetBSD$
---- lib/fuzzer/tests/CMakeLists.txt.orig 2017-08-19 18:02:19.281880135 +0000
+--- lib/fuzzer/tests/CMakeLists.txt.orig 2017-08-19 18:06:22.169861671 +0000
+++ lib/fuzzer/tests/CMakeLists.txt
-@@ -0,0 +1,46 @@
+@@ -0,0 +1,49 @@
+set(LIBFUZZER_UNITTEST_CFLAGS
+ ${COMPILER_RT_UNITTEST_CFLAGS}
+ ${COMPILER_RT_GTEST_CFLAGS}
@@ -15,6 +15,9 @@ $NetBSD$
+set_target_properties(FuzzerUnitTests PROPERTIES FOLDER "Compiler-RT Tests")
+
+set(LIBFUZZER_UNITTEST_LINK_FLAGS ${COMPILER_RT_UNITTEST_LINK_FLAGS})
++if (OS_NAME MATCHES "NetBSD")
++ list(APPEND LIBFUZZER_UNITTEST_LINK_FLAGS -lrt)
++endif()
+list(APPEND LIBFUZZER_UNITTEST_LINK_FLAGS --driver-mode=g++)
+
+if(APPLE)
Home |
Main Index |
Thread Index |
Old Index