From 70e216fc2748ed1b0430167457e08f34c39203e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fahller?= Date: Thu, 9 Nov 2023 12:48:17 +0100 Subject: [PATCH] Install libfuzzer for clang containers --- clang/install-clang.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/clang/install-clang.sh b/clang/install-clang.sh index c238605..1054126 100755 --- a/clang/install-clang.sh +++ b/clang/install-clang.sh @@ -3,6 +3,14 @@ set -eou pipefail VERSION=$1 +MAJOR=${VERSION%%.*} + +if [ $MAJOR -ge 6 ] +then + FUZZER="libfuzzer-${VERSION}-dev" +else + FUZZER="" +fi fetch_clang () { source /etc/lsb-release @@ -11,11 +19,11 @@ fetch_clang () { apt-add-repository "deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-$VERSION main" apt-add-repository "deb-src http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-$VERSION main" apt update - apt install -y clang-$VERSION libc++-$VERSION-dev libc++abi-${VERSION}-dev + apt install -y clang-$VERSION libc++-$VERSION-dev libc++abi-${VERSION}-dev ${FUZZER} } -apt install -y clang-${VERSION} || fetch_clang clang-${VERSION} +apt install -y clang-${VERSION} ${FUZZER}|| fetch_clang clang-${VERSION} for f in /usr/bin/llvm*-${VERSION} do ln -s $f `echo $f | sed "s/-${VERSION}//"` -done \ No newline at end of file +done