forked from rdkit/rdkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
linux_build_fuzzer.yml
56 lines (54 loc) · 2 KB
/
linux_build_fuzzer.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
steps:
- bash: |
source ${CONDA}/etc/profile.d/conda.sh
sudo apt-get install -y clang-9
sudo chown -R ${USER} ${CONDA}
conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda info -a
conda create --name rdkit_build cmake \
boost-cpp=$(boost_version) boost=$(boost_version) \
py-boost=$(boost_version) libboost=$(boost_version) \
cairo eigen
displayName: Setup build environment
- bash: |
source ${CONDA}/etc/profile.d/conda.sh
conda activate rdkit_build
export CC="clang-9"
export CXX="clang++-9"
export SANITIZER_FLAGS_address="-fsanitize=address -fsanitize-address-use-after-scope"
export COVERAGE_FLAGS="-fsanitize=fuzzer-no-link"
export CFLAGS="-O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION $COVERAGE_FLAGS $SANITIZER_FLAGS_address"
export CXXFLAGS="$CFLAGS"
export LIB_FUZZING_ENGINE="-fsanitize=fuzzer"
mkdir build && cd build && \
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DRDK_INSTALL_INTREE=ON \
-DRDK_BUILD_PYTHON_WRAPPERS=OFF \
-DLIB_FUZZING_ENGINE=${LIB_FUZZING_ENGINE} \
-DRDK_BUILD_FUZZ_TARGETS=ON \
-DRDK_INSTALL_STATIC_LIBS=ON \
-DBoost_USE_STATIC_LIBS=ON \
-DRDK_BUILD_CPP_TESTS=OFF \
-DBoost_NO_SYSTEM_PATHS=ON \
-DCMAKE_INCLUDE_PATH="${CONDA_PREFIX}/include" \
-DCMAKE_LIBRARY_PATH="${CONDA_PREFIX}/lib" \
-DCMAKE_PREFIX_PATH=$CONDA_PREFIX
displayName: Configure build (Run CMake)
- bash: |
source ${CONDA}/etc/profile.d/conda.sh
conda activate rdkit_build
cd build
make -j $( $(number_of_cores) ) install
displayName: Build
- bash: |
source ${CONDA}/etc/profile.d/conda.sh
conda activate rdkit_build
corpora=$(find . -type d -name "*_fuzzer")
for corpus in $corpora; do
corpus_basename=$(basename $corpus)
fuzzer_target=$(find . -type f -name "${corpus_basename}" -print -quit)
${fuzzer_target} ${corpus}/*
done
displayName: Run fuzzer on existing corpora