mirror of
https://github.com/danog/gllvm.git
synced 2024-11-26 19:44:42 +01:00
Birthing some examples. Starting with a biggie.
This commit is contained in:
parent
7755cdabb9
commit
591b65316f
0
examples/README.md
Normal file
0
examples/README.md
Normal file
0
examples/linux-kernel/README.md
Normal file
0
examples/linux-kernel/README.md
Normal file
20
examples/linux-kernel/Vagrantfile
vendored
Normal file
20
examples/linux-kernel/Vagrantfile
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
# -*- mode: ruby -*-
|
||||
# vi: set ft=ruby :
|
||||
|
||||
|
||||
Vagrant.configure("2") do |config|
|
||||
|
||||
config.vm.box = "ubuntu/xenial64"
|
||||
config.vm.provision :shell, path: "bootstrap.sh"
|
||||
|
||||
config.vm.provider "virtualbox" do |vb|
|
||||
vb.memory = "4096"
|
||||
vb.customize ["modifyvm", :id, "--ioapic", "on"]
|
||||
vb.customize ["modifyvm", :id, "--memory", "4096"]
|
||||
vb.customize ["modifyvm", :id, "--cpus", "4"]
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
|
10
examples/linux-kernel/bash_profile
Normal file
10
examples/linux-kernel/bash_profile
Normal file
@ -0,0 +1,10 @@
|
||||
#### llvm
|
||||
export LLVM_HOME=/usr/lib/llvm-5.0
|
||||
export GOPATH=/vagrant/go
|
||||
|
||||
######## gllvm/wllvm configuration #############
|
||||
|
||||
export LLVM_COMPILER=clang
|
||||
export WLLVM_OUTPUT_LEVEL=WARNING
|
||||
export WLLVM_OUTPUT_FILE=/vagrant/wrapper.log
|
||||
export PATH=${GOPATH}/bin:${PATH}
|
22
examples/linux-kernel/bootstrap.sh
Normal file
22
examples/linux-kernel/bootstrap.sh
Normal file
@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
sudo apt-get update
|
||||
|
||||
sudo apt-get install -y emacs24 dbus-x11
|
||||
sudo apt-get install -y git subversion wget
|
||||
sudo apt-get install -y llvm-5.0 libclang-5.0-dev clang-5.0
|
||||
sudo apt-get install -y python-pip golang-go
|
||||
sudo apt-get install -y flex bison bc libncurses5-dev
|
||||
sudo apt-get install -y libelf-dev libssl-dev
|
||||
|
||||
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-5.0 1000
|
||||
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-5.0 1000
|
||||
sudo update-alternatives --install /usr/bin/llvm-dis++ llvm-dis /usr/bin/llvm-dis-5.0 1000
|
||||
sudo update-alternatives --install /usr/bin/llvm-dis llvm-dis /usr/bin/llvm-dis-5.0 1000
|
||||
sudo update-alternatives --install /usr/bin/llvm-ar llvm-ar /usr/bin/llvm-ar-5.0 1000
|
||||
sudo update-alternatives --install /usr/bin/llvm-link llvm-link /usr/bin/llvm-link-5.0 1000
|
||||
sudo update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-5.0 1000
|
||||
|
||||
cp /vagrant/bash_profile ~/.bash_profile
|
||||
|
||||
echo ". /vagrant/bash_profile" >> /home/vagrant/.bashrc
|
19
examples/linux-kernel/build_linux_gllvm.sh
Executable file
19
examples/linux-kernel/build_linux_gllvm.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export GOPATH=/vagrant/go
|
||||
|
||||
mkdir -p ${GOPATH}
|
||||
go get github.com/SRI-CSL/gllvm/cmd/...
|
||||
|
||||
mkdir ${HOME}/linux_kernel
|
||||
cd ${HOME}/linux_kernel
|
||||
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
|
||||
|
||||
cd linux-stable
|
||||
git checkout tags/v4.14.34
|
||||
cp /vagrant/tinyconfig64 .config
|
||||
|
||||
make CC=gclang HOSTCC=gclang
|
||||
|
||||
get-bc -m -b built-in.o
|
||||
get-bc -m vmlinux
|
17
examples/linux-kernel/build_linux_wllvm.sh
Executable file
17
examples/linux-kernel/build_linux_wllvm.sh
Executable file
@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
sudo pip install wllvm
|
||||
|
||||
mkdir ${HOME}/linux_kernel
|
||||
cd ${HOME}/linux_kernel
|
||||
git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
|
||||
|
||||
cd linux-stable
|
||||
git checkout tags/v4.14.34
|
||||
cp /vagrant/tinyconfig64 .config
|
||||
|
||||
|
||||
make CC=wllvm HOSTCC=wllvm
|
||||
|
||||
extract-bc -m -b built-in.o
|
||||
extract-bc -m vmlinux
|
1048
examples/linux-kernel/tinyconfig64
Normal file
1048
examples/linux-kernel/tinyconfig64
Normal file
File diff suppressed because it is too large
Load Diff
@ -33,6 +33,8 @@
|
||||
|
||||
package shared
|
||||
|
||||
// Remember to tag the repo, and publish a release on GitHub.
|
||||
//
|
||||
// version history:
|
||||
//
|
||||
// 1.0.0
|
||||
|
Loading…
Reference in New Issue
Block a user