From b837a1424de29e70b62949689324b0cb649bb58f Mon Sep 17 00:00:00 2001 From: DavidKorczynski Date: Sat, 23 Oct 2021 20:35:29 +0100 Subject: [PATCH] tmux: fix coverage (#6641) --- projects/tmux/Dockerfile | 6 +++++- projects/tmux/build.sh | 10 ++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/projects/tmux/Dockerfile b/projects/tmux/Dockerfile index 7407cfff5..80f49b91c 100644 --- a/projects/tmux/Dockerfile +++ b/projects/tmux/Dockerfile @@ -16,7 +16,11 @@ FROM gcr.io/oss-fuzz-base/base-builder RUN apt-get update && apt-get install -y autoconf automake bison pkg-config \ - libevent-dev ncurses-dev + ncurses-dev libtool + +RUN git clone https://github.com/libevent/libevent.git && \ + cd libevent && ./autogen.sh && ./configure --disable-openssl --disable-shared && \ + make clean && make all && make install RUN git clone --depth 1 https://github.com/tmux/tmux.git RUN git clone --depth 1 https://github.com/tmux/tmux-fuzzing-corpus.git diff --git a/projects/tmux/build.sh b/projects/tmux/build.sh index f4fe555e5..c5d7bb87a 100644 --- a/projects/tmux/build.sh +++ b/projects/tmux/build.sh @@ -15,12 +15,15 @@ # ################################################################################ +# Ensure libevent can be found +export PKG_CONFIG_PATH="/usr/local/lib/" + ./autogen.sh ./configure \ --enable-fuzzing \ FUZZING_LIBS="${LIB_FUZZING_ENGINE} -lc++" \ LIBEVENT_LIBS="-Wl,-Bstatic -levent -Wl,-Bdynamic" \ - LIBTINFO_LIBS="-Wl,-Bstatic -ltinfo -Wl,-Bdynamic" + LIBTINFO_LIBS=" -l:libtinfo.a " make -j"$(nproc)" check find "${SRC}/tmux/fuzz/" -name '*-fuzzer' -exec cp -v '{}' "${OUT}"/ \; @@ -44,8 +47,3 @@ cat "${SRC}/tmux-fuzzing-corpus/iterm2"/* | \ split -a5 -db$MAXLEN - iterm2. zip -q -j -r "${OUT}/input-fuzzer_seed_corpus.zip" \ "${WORK}/fuzzing_corpus/" - -# Handle libevent not existing on runner. -mkdir $OUT/lib -cp /lib/x86_64-linux-gnu/libevent_core* $OUT/lib -patchelf --set-rpath '$ORIGIN/lib' $OUT/input-fuzzer