From 75073d0a8478441cc97a6efa10b566c5fb1dac81 Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Fri, 17 Apr 2020 20:57:17 +0100 Subject: New upstream version 1.4.0 --- fuzz/build-coverage | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 fuzz/build-coverage (limited to 'fuzz/build-coverage') diff --git a/fuzz/build-coverage b/fuzz/build-coverage new file mode 100755 index 0000000..af9f8df --- /dev/null +++ b/fuzz/build-coverage @@ -0,0 +1,27 @@ +#!/bin/bash -eux +# +# Copyright (c) 2019 Yubico AB. All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +LIBCBOR=$1 +LIBFIDO2=$2 + +CC=${CC:-clang} +PKG_CONFIG_PATH=${PKG_CONFIG_PATH:-${LIBCBOR}/install/lib/pkgconfig} +export CC PKG_CONFIG_PATH + +# Clean up. +rm -rf ${LIBCBOR}/build ${LIBCBOR}/install ${LIBFIDO2}/build + +# Patch, build, and install libcbor. +(cd ${LIBCBOR} && patch -N -l -s -p0 < ${LIBFIDO2}/fuzz/README) || true +mkdir ${LIBCBOR}/build ${LIBCBOR}/install +(cd ${LIBCBOR}/build && cmake -DCMAKE_INSTALL_PREFIX=${LIBCBOR}/install ..) +make -C ${LIBCBOR}/build all install + +# Build libfido2. +mkdir -p ${LIBFIDO2}/build +(cd ${LIBFIDO2}/build && cmake -DFUZZ=1 -DLIBFUZZER=1 -DCOVERAGE=1 \ + -DCMAKE_BUILD_TYPE=Debug ..) +make -C ${LIBFIDO2}/build -- cgit v1.2.3