Commit 45f800fa authored by Sylvestre Ledru's avatar Sylvestre Ledru

Only enable libfuzzer for Linux kernel.

Thanks to Pino Toscano for the patch
parent 2d9c7937
llvm-toolchain-snapshot (1:5.0~svn298899-2) UNRELEASED; urgency=medium
* Only enable libfuzzer for Linux kernel.
Thanks to Pino Toscano for the patch
-- Sylvestre Ledru <sylvestre@debian.org> Sat, 06 May 2017 10:05:07 +0200
llvm-toolchain-snapshot (1:5.0~svn298899-1) unstable; urgency=medium
* Limit the archs where the ocaml binding is built
......
......@@ -166,7 +166,7 @@ Description: clang library - Common development package
Package: libfuzzer-5.0-dev
Architecture: any
Architecture: linux-any
Section: libdevel
Depends: ${shlibs:Depends}, ${misc:Depends}, clang-5.0 (= ${binary:Version})
Description: Library for coverage-guided fuzz testing
......
......@@ -21,6 +21,7 @@ DEB_HOST_MULTIARCH = $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
DEB_HOST_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_HOST_ARCH_BITS = $(shell dpkg-architecture -qDEB_HOST_ARCH_BITS)
DEB_HOST_ARCH = $(shell dpkg-architecture -qDEB_HOST_ARCH)
DEB_HOST_ARCH_OS = $(shell dpkg-architecture -qDEB_HOST_ARCH_OS)
LDFLAGS_EXTRA =
CXXFLAGS_EXTRA = -std=c++0x
......@@ -147,6 +148,11 @@ ifneq (,$(filter $(DEB_HOST_ARCH),$(OCAML_ARCHS)))
DH_OPTIONS=--with ocaml
endif
LIBFUZZER_ENABLE=yes
ifeq (,$(filter $(DEB_HOST_ARCH_OS),linux))
LIBFUZZER_ENABLE=no
endif
%:
dh $@ $(DH_OPTIONS)
......@@ -266,12 +272,14 @@ 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
ifeq (${LIBFUZZER_ENABLE},yes)
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
endif
override_dh_prep: build_doc
dh_prep
......@@ -340,8 +348,10 @@ override_dh_auto_install:
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)
ifeq (${LIBFUZZER_ENABLE},yes)
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/
endif
# Create this fake directory to make the install libclang-common-dev happy
# under the unsupported archs of compiler-rt
......@@ -434,6 +444,7 @@ override_dh_auto_install:
# Rename OCaml bindings
if test "$(OCAML_ENABLE)" = yes; then \
mkdir -p "$(DEB_INST)$(OCAML_STDLIB_DIR)"; \
mkdir -p "$(DEB_INST)usr/lib/llvm-$(LLVM_VERSION)/docs/ocaml/html/html"; \
mkdir -p "$(DEB_INST)usr/lib/llvm-$(LLVM_VERSION)/share/doc/llvm/ocaml-html/"; \
if test -d "$(DEB_INST)/usr/lib/llvm-$(LLVM_VERSION)/lib/ocaml"; then \
mv -f "$(DEB_INST)usr/lib/llvm-$(LLVM_VERSION)/lib/ocaml" \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment