- get the llvm gold plugin and follow the installation instructions: https://llvm.org/docs/GoldPlugin.html
- install ld.gold to
/usr/bin/ld.gold
- compile LLVM-CFI with
-DLLVM_BINUTILS_INCDIR=/path/to/binutils/include
- set environment variables:
export PREFIX="/path/to/built/reckon"
export CC="$PREFIX/bin/clang -flto -femit-vtbl-checks"
export CXX="$PREFIX/bin/clang++ -flto -femit-vtbl-checks"
export AR="$PREFIX/bin/ar"
export NM="$PREFIX/bin/nm-new"
export RANLIB=/bin/true
export LDFLAGS="-fuse-ld=gold -Wl,-plugin-opt=sd-return"
Compile any project with LLVM-CFI. If autotooled, make sure that the C/C++ compilers and flags outlined above are used. LLVM-CFI will generate folders called "SDOutput" which contains the analysis results. The folders are created in the directory the linker was called in. Use
find . -type d -name "SDOutput"
to find the data.