diff options
author | Colin Watson <cjwatson@debian.org> | 2020-09-20 16:14:20 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2020-09-20 16:14:20 +0100 |
commit | 173bfbf7886608a4a7abbfac6a42ac4bf4a3432d (patch) | |
tree | b97833d8754f257f92d99dd2f5c9e9d557e3f689 /fuzz/build-coverage | |
parent | 75073d0a8478441cc97a6efa10b566c5fb1dac81 (diff) |
New upstream version 1.5.0
Diffstat (limited to 'fuzz/build-coverage')
-rwxr-xr-x | fuzz/build-coverage | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/fuzz/build-coverage b/fuzz/build-coverage index af9f8df..0f8310d 100755 --- a/fuzz/build-coverage +++ b/fuzz/build-coverage | |||
@@ -1,27 +1,30 @@ | |||
1 | #!/bin/bash -eux | 1 | #!/bin/sh -eux |
2 | # | 2 | |
3 | # Copyright (c) 2019 Yubico AB. All rights reserved. | 3 | # Copyright (c) 2019 Yubico AB. All rights reserved. |
4 | # Use of this source code is governed by a BSD-style | 4 | # Use of this source code is governed by a BSD-style |
5 | # license that can be found in the LICENSE file. | 5 | # license that can be found in the LICENSE file. |
6 | 6 | ||
7 | LIBCBOR=$1 | 7 | LIBCBOR="$1" |
8 | LIBFIDO2=$2 | 8 | LIBFIDO2="$2" |
9 | 9 | ||
10 | CC=${CC:-clang} | 10 | CC="${CC:-clang}" |
11 | PKG_CONFIG_PATH=${PKG_CONFIG_PATH:-${LIBCBOR}/install/lib/pkgconfig} | 11 | CXX="${CXX:-clang++}" |
12 | PKG_CONFIG_PATH="${PKG_CONFIG_PATH:-${LIBCBOR}/install/lib/pkgconfig}" | ||
12 | export CC PKG_CONFIG_PATH | 13 | export CC PKG_CONFIG_PATH |
13 | 14 | ||
14 | # Clean up. | 15 | # Clean up. |
15 | rm -rf ${LIBCBOR}/build ${LIBCBOR}/install ${LIBFIDO2}/build | 16 | rm -rf "${LIBCBOR}/build" "${LIBCBOR}/install" "${LIBFIDO2}/build" |
16 | 17 | ||
17 | # Patch, build, and install libcbor. | 18 | # Patch, build, and install libcbor. |
18 | (cd ${LIBCBOR} && patch -N -l -s -p0 < ${LIBFIDO2}/fuzz/README) || true | 19 | (cd "${LIBCBOR}" && patch -N -l -s -p0 < "${LIBFIDO2}/fuzz/README") || true |
19 | mkdir ${LIBCBOR}/build ${LIBCBOR}/install | 20 | mkdir "${LIBCBOR}/build" "${LIBCBOR}/install" |
20 | (cd ${LIBCBOR}/build && cmake -DCMAKE_INSTALL_PREFIX=${LIBCBOR}/install ..) | 21 | (cd "${LIBCBOR}/build" && cmake -DCMAKE_INSTALL_PREFIX="${LIBCBOR}/install" ..) |
21 | make -C ${LIBCBOR}/build all install | 22 | make -C "${LIBCBOR}/build" all install |
22 | 23 | ||
23 | # Build libfido2. | 24 | # Build libfido2. |
24 | mkdir -p ${LIBFIDO2}/build | 25 | mkdir -p "${LIBFIDO2}/build" |
25 | (cd ${LIBFIDO2}/build && cmake -DFUZZ=1 -DLIBFUZZER=1 -DCOVERAGE=1 \ | 26 | export CFLAGS="-fprofile-instr-generate -fcoverage-mapping" |
26 | -DCMAKE_BUILD_TYPE=Debug ..) | 27 | export LDFLAGS="${CFLAGS}" |
27 | make -C ${LIBFIDO2}/build | 28 | (cd "${LIBFIDO2}/build" && cmake -DFUZZ=1 -DLIBFUZZER=1 \ |
29 | -DCMAKE_BUILD_TYPE=Debug ..) | ||
30 | make -C "${LIBFIDO2}/build" | ||