Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use custom llvm to emit pulse linearly in libfuzzer #5

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ inputs:
required: true
runs:
using: 'docker'
image: 'Dockerfile'
image: 'docker://anthonylh/llvm-patched-libfuzzer'
args:
- ${{ inputs.command }}
2 changes: 1 addition & 1 deletion scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export HOME=/root
echo $PATH
echo `which cargo`
git config --global --add safe.directory /github/workspace
exec bash -c "$@"
exec bash -c "PATH=/usr/bin/llvmorg-17.0.6/bin:\$PATH $@"
20 changes: 9 additions & 11 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#!/bin/bash

set -exo pipefail
LLVM_VERSION=17


apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
Expand All @@ -13,13 +11,13 @@ DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
software-properties-common \
gnupg \
linux-headers-generic \
librocksdb-dev
librocksdb-dev \
unzip

cd /usr/bin

wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
./llvm.sh ${LLVM_VERSION}
curl -o llvmorg-17.0.6.zip https://fuzzcorp-dist-a9302fb.s3.us-east-2.amazonaws.com/llvmorg-17.0.6.zip
unzip llvmorg-17.0.6.zip

# install rust
curl https://sh.rustup.rs -sSf | sh -s -- -y
Expand All @@ -28,9 +26,9 @@ rustup toolchain install nightly
rustup default nightly
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu

ln -s "../lib/llvm-${LLVM_VERSION}/bin/clang" clang
ln -s "../lib/llvm-${LLVM_VERSION}/bin/clang++" clang++
ln -s "/usr/bin/llvmorg-17.0.6/bin/clang" clang
ln -s "/usr/bin/llvmorg-17.0.6/bin/clang++" clang++

ln -sf /usr/bin/ld.lld-17 /usr/bin/ld
update-alternatives --install /usr/bin/cc cc "/lib/llvm-${LLVM_VERSION}/bin/clang" 50
update-alternatives --install /usr/bin/c++ c++ "/lib/llvm-${LLVM_VERSION}/bin/clang++" 50
ln -sf //usr/bin/llvmorg-17.0.6/bin/ld.lld /usr/bin/ld
update-alternatives --install /usr/bin/cc cc "/usr/bin/llvmorg-17.0.6/bin/clang" 50
update-alternatives --install /usr/bin/c++ c++ "/usr/bin/llvmorg-17.0.6/bin/clang++" 50