mirror of
https://git.proxmox.com/git/llvm-toolchain
synced 2025-08-03 06:57:55 +00:00
Only enable libfuzzer for Linux kernel.
Thanks to Pino Toscano for the patch
This commit is contained in:
parent
96c6c1c882
commit
2d81a37090
7
debian/changelog
vendored
7
debian/changelog
vendored
@ -1,3 +1,10 @@
|
||||
llvm-toolchain-4.0 (1:4.0.1~+rc1-2) unstable; 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:03:14 +0200
|
||||
|
||||
llvm-toolchain-4.0 (1:4.0.1~+rc1-1) unstable; urgency=medium
|
||||
|
||||
* New snapshot release
|
||||
|
2
debian/control
vendored
2
debian/control
vendored
@ -166,7 +166,7 @@ Description: clang library - Common development package
|
||||
|
||||
|
||||
Package: libfuzzer-4.0-dev
|
||||
Architecture: any
|
||||
Architecture: linux-any
|
||||
Section: libdevel
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, clang-4.0 (= ${binary:Version})
|
||||
Description: Library for coverage-guided fuzz testing
|
||||
|
10
debian/rules
vendored
10
debian/rules
vendored
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user