• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash -ex
2
3# Usage:
4#
5#     $ ./update-libfuzzer.sh
6
7set -ex
8
9# The LLVM commit from which we are vendoring libfuzzer. This must be a commit
10# hash from https://github.com/llvm/llvm-project
11COMMIT=ab51eccf88f5321e7c60591c5546b254b6afab99
12
13cd "$(dirname $0)"
14project_dir="$(pwd)"
15
16tmp_dir="$(mktemp -d)"
17cd "$tmp_dir"
18
19git init
20git remote add llvm https://github.com/llvm/llvm-project.git
21git sparse-checkout set compiler-rt/lib/fuzzer
22
23git fetch --depth 1 llvm "$COMMIT" --filter=blob:none
24git checkout "$COMMIT"
25
26rm -rf "$project_dir/libfuzzer/"
27mv "$tmp_dir/compiler-rt/lib/fuzzer/" "$project_dir/libfuzzer/"
28