Skip to content

Commit 3e78c4b

Browse files
committedAug 12, 2017
Add a Dockerfile for clang-proto-fuzzer
Summary: Add a Dockerfile for clang-proto-fuzzer Reviewers: morehouse, vitalybuka Reviewed By: morehouse Subscribers: hintonda, cfe-commits Differential Revision: https://reviews.llvm.org/D36635 llvm-svn: 310774
1 parent 3704eba commit 3e78c4b

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
 

‎clang/tools/clang-fuzzer/Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#===- llvm/tools/clang/tools/clang-fuzzer ---------------------------------===//
2+
#
3+
# The LLVM Compiler Infrastructure
4+
#
5+
# This file is distributed under the University of Illinois Open Source
6+
# License. See LICENSE.TXT for details.
7+
#
8+
#===----------------------------------------------------------------------===//
9+
# Produces an image that builds clang-proto-fuzzer
10+
FROM ubuntu:16.04
11+
RUN apt-get update -y
12+
RUN apt-get install -y autoconf automake libtool curl make g++ unzip wget git \
13+
binutils liblzma-dev libz-dev python-all cmake ninja-build subversion \
14+
pkg-config docbook2x
15+
16+
WORKDIR /root
17+
18+
# Get protobuf
19+
RUN wget -qO- https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz | tar zxf -
20+
RUN cd protobuf-3.3.0 && ./autogen.sh && ./configure && make -j $(nproc) && make check -j $(nproc) && make install && ldconfig
21+
# Get LLVM
22+
RUN svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
23+
RUN cd llvm/tools && svn co http://llvm.org/svn/llvm-project/cfe/trunk clang -r $(cd ../ && svn info | grep Revision | awk '{print $2}')
24+
RUN cd llvm/projects && svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt -r $(cd ../ && svn info | grep Revision | awk '{print $2}')
25+
# Build plain LLVM (stage 0)
26+
RUN mkdir build0 && cd build0 && cmake -GNinja -DCMAKE_BUILD_TYPE=Release ../llvm && ninja
27+
# Configure instrumented LLVM (stage 1)
28+
RUN mkdir build1 && cd build1 && cmake -GNinja -DCMAKE_BUILD_TYPE=Release ../llvm \
29+
-DLLVM_ENABLE_ASSERTIONS=ON \
30+
-DCMAKE_C_COMPILER=`pwd`/../build0/bin/clang \
31+
-DCMAKE_CXX_COMPILER=`pwd`/../build0/bin/clang++ \
32+
-DLLVM_USE_SANITIZE_COVERAGE=YES \
33+
-DLLVM_USE_SANITIZER=Address -DCLANG_ENABLE_PROTO_FUZZER=ON
34+
# Build the fuzzers
35+
RUN cd build1 && ninja clang-fuzzer
36+
RUN cd build1 && ninja clang-proto-fuzzer
37+
RUN cd build1 && ninja clang-proto-to-cxx

‎clang/tools/clang-fuzzer/README.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ Example:
5959
-DCLANG_ENABLE_PROTO_FUZZER=ON
6060
ninja clang-proto-fuzzer clang-proto-to-cxx
6161

62+
This directory also contains a Dockerfile which sets up all required
63+
dependencies and builds the fuzzers.
6264

6365
=====================
6466
Running the fuzzers

0 commit comments

Comments
 (0)
Please sign in to comment.