From 45fe7b69ea8c5c6eb17a61bd1d8c36a851ed8415 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Thu, 4 Aug 2016 17:20:48 +0000 Subject: [PATCH] Ship libFuzzer in its own package (libfuzzer-X.Y-dev) (Closes: #820159) --- debian/changelog | 1 + debian/control | 22 ++++++++++++++++++++++ debian/rules | 13 ++++++++++++- 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 67b73175..f5c2da2e 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,6 @@ llvm-toolchain-3.8 (1:3.8.1-6) unstable; urgency=medium + * Ship libFuzzer in its own package (libfuzzer-X.Y-dev) (Closes: #820159) * Sync from Ubuntu. Many thanks to Matthias Klose - drop-avx512-from-skylake.diff: Don't enable AVX512 on Skylake, as it's a server cpu feature and breaks llvmpipe on workstations. diff --git a/debian/control b/debian/control index 29206338..31325eaa 100644 --- a/debian/control +++ b/debian/control @@ -156,6 +156,28 @@ Description: clang library - Common development package (profiling, etc). +Package: libfuzzer-3.8-dev +Architecture: any +Section: libdevel +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Library for coverage-guided fuzz testing + LibFuzzer is a library for in-process, coverage-guided, evolutionary fuzzing + of other libraries. + . + LibFuzzer is similar in concept to American Fuzzy Lop (AFL), but it performs + all of its fuzzing inside a single process. This in-process fuzzing can be + more restrictive and fragile, but is potentially much faster as there is no + overhead for process start-up. + . + The fuzzer is linked with the library under test, and feeds fuzzed inputs to + the library via a specific fuzzing entrypoint (aka 'target function'); the + fuzzer then tracks which areas of the code are reached, and generates mutations + on the corpus of input data in order to maximize the code coverage. The code + coverage information for libFuzzer is provided by LLVM's SanitizerCoverage + instrumentation. + + + Package: python-clang-3.8 Section: python Architecture: any diff --git a/debian/rules b/debian/rules index 206cc868..22f81e9c 100755 --- a/debian/rules +++ b/debian/rules @@ -253,6 +253,13 @@ override_dh_auto_configure: preconfigure override_dh_auto_build: $(PRE_PROCESS) $(MAKE) $(NJOBS) -C $(TARGET_BUILD) VERBOSE=1 CLANG_VENDOR=$(VENDOR) CXXFLAGS="$(CXXFLAGS_EXTRA)" LDFLAGS="$(LDFLAGS_EXTRA)" REQUIRES_RTTI=1 DEBUGMAKE=1 + cd $(TARGET_BUILD) \ + CFLAGS=`dpkg-buildflags --get CFLAGS`; \ + CFLAGS="$$CFLAGS `dpkg-buildflags --get CPPFLAGS`"; \ + echo $$CFLAGS; \ + bin/clang++ -c $$CFLAGS -std=c++11 ../lib/Fuzzer/*.cpp -IFuzzer; \ + ar ruv libFuzzer.a Fuzzer*.o + ifeq (${AUTOCONF_BUILD},yes) # We run the build with the Asserts, new directory, make a symlink to make @@ -332,6 +339,9 @@ endif mkdir -p $(CURDIR)/debian/clang-$(LLVM_VERSION)/usr/bin/ cp compiler-rt/lib/asan/scripts/asan_symbolize.py $(CURDIR)/debian/clang-$(LLVM_VERSION)/usr/bin/asan_symbolize-$(LLVM_VERSION) + mkdir -p $(CURDIR)/debian/libfuzzer-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/lib/ + cp -v $(TARGET_BUILD)/libFuzzer.a $(CURDIR)/debian/libfuzzer-$(LLVM_VERSION)-dev/usr/lib/llvm-$(LLVM_VERSION)/lib/ + # Create this fake directory to make the install libclang-common-dev happy # under the unsupported archs of compiler-rt mkdir -p $(DEB_INST)/usr/lib/clang/$(LLVM_VERSION)/lib @@ -372,7 +382,8 @@ endif # Rename binaries mkdir -p $(DEB_INST)/usr/bin/ - cd $(DEB_INST)/usr/bin/; rm -f *; \ + cd $(DEB_INST)/usr/bin/; \ + rm -f *; \ for f in ../lib/llvm-$(LLVM_VERSION)/bin/*; do \ ln -s $$f `basename $$f`-$(LLVM_VERSION); \ echo "Link $$f to `basename $$f`-$(LLVM_VERSION)"; \