Skip to content

Commit

Permalink
Merge branch 'libfuzz'
Browse files Browse the repository at this point in the history
  • Loading branch information
rollbear committed Nov 9, 2023
2 parents 9530565 + 70e216f commit 1d74e3e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions clang/install-clang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -11,10 +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 libfuzzer-$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}//"`
Expand Down

0 comments on commit 1d74e3e

Please sign in to comment.