mirror of
https://github.com/netdata/libbpf.git
synced 2026-04-19 15:09:06 +08:00
scripts: allow skipping elfutils rebuild in build-fuzzers.sh
This simplifies local reproduction of fuzzer reported errors. E.g. the following sequence of commands would execute much faster on a second run: $ SKIP_LIBELF_REBUILD=1 scripts/build-fuzzers.sh $ out/bpf-object-fuzzer <path-to-test-case> Signed-off-by: Eduard Zingerman <eddyz87@gmail.com>
This commit is contained in:
committed by
Andrii Nakryiko
parent
9823ef295d
commit
dac1ec64a3
@@ -35,11 +35,14 @@ if [[ "$SANITIZER" == undefined ]]; then
|
||||
CXXFLAGS+=" $UBSAN_FLAGS"
|
||||
fi
|
||||
|
||||
export SKIP_LIBELF_REBUILD=${SKIP_LIBELF_REBUILD:=''}
|
||||
|
||||
# Ideally libbelf should be built using release tarballs available
|
||||
# at https://sourceware.org/elfutils/ftp/. Unfortunately sometimes they
|
||||
# fail to compile (for example, elfutils-0.185 fails to compile with LDFLAGS enabled
|
||||
# due to https://bugs.gentoo.org/794601) so let's just point the script to
|
||||
# commits referring to versions of libelf that actually can be built
|
||||
if [[ ! -e elfutils || "$SKIP_LIBELF_REBUILD" == "" ]]; then
|
||||
rm -rf elfutils
|
||||
git clone https://sourceware.org/git/elfutils.git
|
||||
(
|
||||
@@ -72,6 +75,7 @@ make -C config -j$(nproc) V=1
|
||||
make -C lib -j$(nproc) V=1
|
||||
make -C libelf -j$(nproc) V=1
|
||||
)
|
||||
fi
|
||||
|
||||
make -C src BUILD_STATIC_ONLY=y V=1 clean
|
||||
make -C src -j$(nproc) CFLAGS="-I$(pwd)/elfutils/libelf $CFLAGS" BUILD_STATIC_ONLY=y V=1
|
||||
|
||||
Reference in New Issue
Block a user