cd ~/src
git clone git@github.com:trailofbits/cxx-common.gitThe repository path is where all the dependencies will be installed. By default,
we use /opt/trailofbits/libraries. The only requirements on the repository path
is that it be writeable, and that it points to a folder named libraries.
NOTE: The naming of this environment variable is significant.
export TRAILOFBITS_LIBRARIES=/opt/trailofbits/librariesThe next step installs a modern version of CMake for bootstrapping the rest of the process.
cd cxx-common
python ./pkgman.py --repository_path=${TRAILOFBITS_LIBRARIES} --packages=cmake
export PATH="${TRAILOFBITS_LIBRARIES}/cmake/bin:${PATH}"Now we build the remaining dependencies. We specify LLVM version 900 to mean 9.0.0.
We also specify that we'll be excluding libc++ from the build.
python ./pkgman.py \
--llvm_version=900 \
--repository_path=${TRAILOFBITS_LIBRARIES} \
--packages=llvm,capstone,google,xed \
--exclude_libcxx cd ~/src
git clone git@github.com:lifting-bits/remill.gitFor example, Anvill:
cd remill/tools
git clone git@github.com:lifting-bits/anvill.gitcd ~/build
mkdir remill-build
cd remill-build
${TRAILOFBITS_LIBRARIES}/cmake/bin/cmake \
-DCMAKE_BC_COMPILER=${TRAILOFBITS_LIBRARIES}/llvm/bin/clang++ \
-DCMAKE_VERBOSE_MAKEFILE=True \
~/src/remill
make -j8If you're using macOS, then also supply the following argument to CMake: -DCMAKE_OSX_SYSROOT=$(xcrun -sdk macosx --show-sdk-path).
That is unusual, maybe it's an include path proble. I recommend skipping the cmake bootstrapping and using your system cmake. Then you'll change the final cmake invocation to build Remill to use
cmakerather than${TRAILOFBITS_LIBRARIES}/cmake/bin/cmake.