Before you start hacking it may be helpful to get through the second and third sections of this paper: Mull it over: mutation testing based on LLVM from ICST 2018.
Mull supplies a number of ready to use virtual machines based on VirtualBox.
The machines are managed using Vagrant and Ansible.
Do the following steps to setup a virtual machine:
cd infrastructure
vagrant up debian
This command will:
setup a virtual machine
install required packages (cmake, sqlite3, pkg-config, …)
download precompiled version of LLVM
build Mull against the LLVM
run Mull’s test suite
run Mull against OpenSSL and fmtlib as an integration test
Once the machine is up and running you can start hacking over SSH:
vagrant ssh debian
Within the virtual machine Mull’s sources located under /opt/mull
.
Alternatively, you can setup a remote toolchain within your IDE, if it supports it.
When you are done feel free to drop the virtual machine:
vagrant destroy debian
You can see the full list of supplied VMs by running this command:
vagrant status
You can replicate all the steps managed by Vagrant/Ansible manually.
Please, look at the corresponding Ansible playbook (debian-playbook.yaml
,
macos-playbook.yaml
, etc.) for the list of packages required on your OS.
You need LLVM to build and debug Mull. You can use any LLVM version between 3.9 and 8.0.
There are several options:
Download precompiled version of LLVM from the official website: http://releases.llvm.org/ This is a recommended option. Use it whenever possible. Simply download the tarball and unpack it somewhere.
Build LLVM from scratch on your own This option also works. Use it whenever you cannot or do not want to use precompiled version.
Ask Mull to build LLVM for you This is recommended only if you need to debug some issue in Mull that requires deep dive into the LLVM itself.
If you are going for an option 2 or 3 - make sure you also include Clang.
Create a build folder and initialize build system:
git clone https://github.com/mull-project/mull.git --recursive
cd mull
mkdir build.dir
cd build.dir
cmake -DPATH_TO_LLVM=path/to/llvm ..
make mull-cxx
make mull-tests
The PATH_TO_LLVM
depends on which option you picked in previous section:
Path to extracted tarball.
Path to a build directory.
Path to a source directory.
If you are getting linker errors, then it is very likely related to the C++
ABI. Depending on your OS/setup you may need to tweak the _GLIBCXX_USE_CXX11_ABI
(0 or 1):
cmake -DPATH_TO_LLVM=some-path -DCMAKE_CXX_FLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 ..
If the linker error you get is something like undefined reference to `typeinfo for irm::CmpInstPredicateReplacement'
,
try to pass the -fno-rtti
flag:
cmake -DPATH_TO_LLVM=some-path -DCMAKE_CXX_FLAGS=-fno-rtti ..