| 1 |
#!/bin/bash -eu |
| 2 |
# Copyright 2024 Google LLC |
| 3 |
# SPDX-License-Identifier: Apache-2.0 |
| 4 |
|
| 5 |
# This script is intended to be run only from the oss-fuzz docker framework |
| 6 |
# See https://google.github.io/oss-fuzz/getting-started/new-project-guide/#buildsh |
| 7 |
cd xen |
| 8 |
./configure --disable-stubdom --disable-pvshim --disable-docs --disable-xen --with-system-qemu |
| 9 |
make clang=y -C tools/include |
| 10 |
make clang=y -C tools/fuzz/x86_instruction_emulator libfuzzer-harness |
| 11 |
cp tools/fuzz/x86_instruction_emulator/libfuzzer-harness $OUT/x86_instruction_emulator |
| 12 |
|
| 13 |
# Runtime coverage collection requires access to source files and symlinks don't work |
| 14 |
cp xen/lib/x86/*.c tools/fuzz/x86_instruction_emulator |
| 15 |
cp tools/tests/x86_emulator/*.c tools/fuzz/x86_instruction_emulator |