BUILDING PIN 2.13/2.14 AND LIBDFT ON UBUNTU 16.04 WITH KERNEL 3.19 ------------------------------------------------------------------ Not for the faint-hearted. Recommended config for libdft: Pin 2.13 with libdft-ng_linux-i386 (32-bit processes only), kernel 3.19 Recommended config for Triton: Pin 2.14 Use a kernel < 4.4 to prevent problems with Pin not supporting i386 sysenter on kernel 4.4. Download libdft from https://www.cs.columbia.edu/~vpk/research/libdft/libdft-3.1415alpha.tar.gz Download Pin 2.13 from https://gitlab.bucknell.edu/csci320/pin_cache/blob/30a7f8e0bf589b17660262b3e30e53894497ccf8/pin-2.13-61206-gcc.4.4.7-linux.tar.gz If you want to install Pin 2.14 for use with Triton, download it from https://software.intel.com/sites/landingpage/pintool/downloads/pin-2.14-71313-gcc.4.4.7-linux.tar.gz Note: the above link to Pin 2.13 is just about the only live one left that I was able to find. If it goes down, you can transplant Pin 2.13 from the "Practical Binary Analysis" VM (it's in /home/binary/libdft). -------- Installing kernel 3.19 on Ubuntu 16.04 -------- mkdir kernel cd kernel wget http://launchpadlibrarian.net/220635919/linux-headers-3.19.0-31-generic_3.19.0-31.36~14.04.1_amd64.deb wget http://launchpadlibrarian.net/220668669/linux-headers-3.19.0-31_3.19.0-31.36~14.04.1_all.deb wget http://launchpadlibrarian.net/220635970/linux-image-3.19.0-31-generic_3.19.0-31.36~14.04.1_amd64.deb sudo dpkg -i linux-* -------- Building Pin 2.13 tools -------- 1) Comment out the compiler check lines in source/include/pin/compiler_version_check2.H (If you're not sure which lines, just try to build the Pin tools and you'll see where the error hits.) 2) Add -injection child to pin.sh to make Pin work on kernel 4.x (and use pin.sh for running Pin) This is a command-line option that you want to add at every place where pin.sh invokes pinbin. If you get errors about AUX VEC you may also need to add the -ifeellucky option. 3) If in an i386 chroot on an x86-64 host, add the following at the top of source/Config/unix.vars: HOST_ARCH=ia32 4) Use CXX=g++-4.9 for building tools 5) In pin.sh, change the following: if [ `$origin/source/tools/testGccVersion /usr/bin/gcc` -eq 1 ] then cpp_libs="$lib_base/ia32/runtime/cpplibs:$lib_base/intel64/runtime/cpplibs" else cpp_libs= fi to: cpp_libs= # nothing -------- Building Pin 2.14 tools (only if you want to use Triton) -------- 1) Comment out the compiler check lines in source/include/pin/compiler_version_check2.H (See also the Pin 2.13 instructions.) 2) Add -injection child to pin.sh to make Pin work on kernel 4.x (and use pin.sh for running Pin) (See also the Pin 2.13 instructions.) 3) Use CXX=g++-4.7 for building tools (g++-4.9 might also work) -------- Building libdft with Pin 2.13 (libdft-ng_linux-i386, 32-bit processes only) -------- 1) Apply the patch from https://practicalbinaryanalysis.com/file/libdft.patch 2) export PIN_HOME as specified in the libdft INSTALL file 3) cd src && make (tested with CXX=g++-4.9) 4) cd tools && make (tested with CXX=g++-4.9) 5) Call tools as follows: ./pin.sh -follow_execv -t ../libdft-ng_linux-i386/tools/libdft-dta.so -- /bin/ls Make sure to call pin.sh from the Pin directory, or set PIN_ROOT