diff --git a/etc/Vagrantfile b/etc/Vagrantfile new file mode 100644 index 000000000..6fc27a222 --- /dev/null +++ b/etc/Vagrantfile @@ -0,0 +1,50 @@ +Vagrant.configure(2) do |config| + config.vm.box = "ubuntu/vivid64" + + config.vm.provider "virtualbox" do |vb| + vb.memory = "4096" + vb.cpus = 8 + end + + config.vm.provision "shell", inline: <<-SHELL + sudo apt-get update + sudo apt-get install -y git clang cmake libssl-dev + + cd /opt + + # Build rust + + git clone https://github.com/rust-lang/rust.git + cd rust + git checkout 717e8831b # https://github.com/frewsxcv/afl.rs/issues/11 + ./configure --enable-clang --disable-libcpp --enable-optimize --disable-docs + make -j 8 + cd .. + echo "export PATH=\$PATH:/opt/rust/x86_64-unknown-linux-gnu/stage2/bin" >> /home/vagrant/.bashrc + echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/opt/rust/x86_64-unknown-linux-gnu/stage2/lib/" >> /home/vagrant/.bashrc + source /home/vagrant/.bashrc + + # Build cargo + + git clone https://github.com/rust-lang/cargo + cd cargo + apt-get install -y pkg-config # https://github.com/frewsxcv/afl.rs/issues/11 + git checkout 1ae683a1496be2e35f213e3e11645adcb3ed62b1 # https://github.com/frewsxcv/afl.rs/issues/11 + ./configure --local-rust-root=../rust/x86_64-unknown-linux-gnu/stage2/ --enable-optimize + make + echo "export PATH=\$PATH:/opt/cargo/target/x86_64-unknown-linux-gnu/release" >> /home/vagrant/.bashrc + source /home/vagrant/.bashrc + + # Build afl + + wget http://lcamtuf.coredump.cx/afl/releases/afl-1.94b.tgz + tar xf afl-1.94b.tgz + cd afl-1.94b + make + make install + + # export CXX="$(which clang++) -Wno-c++11-extensions" + # export LLVM_CONFIG=$(which llvm-config-3.4) + # build repo with rust plugin + SHELL +end