Scripts to set up a fresh Linux OS for building LLVM Linux
- Set up a fresh Ubuntu 14.04 VM
- In VirtualBox, increase the VM’s allocated memory to 2MB
- Resize the existing virtual disk to 20 GB as per this Gist
- Yes, the cloning and building will use up more than vagrant’s default 8 GB
- Copy xen-slicing-pq.hg and build scripts into vagrant
OPTIONS=`vagrant ssh-config | grep -v '^Host ' | awk -v ORS=' ' 'NF{print "-o " $1 "=" $2}'`
scp -r ${OPTIONS} /path/to/xen-slicing-pq.hg vagrant:~/
scp ${OPTIONS} /path/to/magic-build-script.sh vagrant:~/
scp ${OPTIONS} /path/to/increase_swap.sh vagrant:~/
- Increases from 512 MB to 2 GB; otherwise LLVM build will fail at ~96% completion
- vagrant ssh
- sudo ./increase_swap.sh
- sudo ./magic-build-script.sh
- Will prompt for “Build LLVM Linux? 1) Y 2) N” after dependencies are installed and sources are cloned.
- Clone
buildroot. (make syncin/vagrant/llvmlinuxwill fail b/c the old repo addressgit.buildroot.net/git/buildroot.githas not been updated.) cd /vagrant/llvmlinux/test/buildroot/srcgit clone git://git.busybox.net/buildroot- Remove the patch below; it will fail to be applied and will block the rest of the build from progressing.
cd /vagrant/llvmlinux/targets/x86_64/patches- Open the text file
series - Remove the line with
correct-size_index-table-before-replacing-the-bootst.patch1. Note: As of 26/06/2015, this patch is symlinked fromtargets/x86_64/patches/totargets/arch/all/patches/, but the actual path is one level deeper undertargets/arch/all/patches/ARCHIVE/. - Save and exit
- To re-sync sources and rebuild:
cd /vagrant/llvmlinux/targets/x86_64make sync-allmake