Skip to content

How To Build

Maksim Shudrak edited this page Mar 14, 2020 · 14 revisions

Introduction

Drltrace was originally created and distributed as an additional module for DrMemory. You can build & use older (but still working) version of drltrace distributed as a part of DrMemory using the following guide.

Windows Build Requirements

Basically, drltrace has the same requirements as DynamoRIO. To build drltrace you will need:

  • Visual Studio 2013. Other versions are not officially supported as our automated tests use VS 2013.
  • CMake. 3.2+ is required. When prompted, we recommend adding it to your PATH.
  • Git. Any flavor should do, including Git on Windows or Cygwin git.
  • Perl. We recommend either Strawberry Perl or Cygwin perl.

Windows Build Workflow

Step 1. Preparing Environment

From the command line, set up the path and environment variables for Visual Studio by running vcvars batch file (it is usually located in C:\Program Files (x86)\Microsoft Visual Studio XX.0\VC\bin, either manually in a cmd shell or by running the Developer Command Prompt for VS2013 which has a Start Menu entry under Visual Studio Tools.

Step 2. Downloading sources

git clone --recursive https://github.com/mxmssh/drltrace.git
mkdir build
cd build

Step 3. Building

Debug Version (32-bit)

cmake -G"Visual Studio 12" -DCMAKE_BUILD_TYPE=Debug ..\drltrace\drltrace_src\
cmake --build .

Release Version (32-bit)

cmake -G"Visual Studio 12" -DCMAKE_BUILD_TYPE=RelWithDebInfo ..\drltrace\drltrace_src\
cmake --build . --config RelWithDebInfo

If you need a 64-bit build, choose VS2013 x64 Cross Tools Command Prompt and pass -G"Visual Studio 12 Win64" to cmake

Linux Build Requirements

  1. gcc
  2. binutils
  3. cmake (at least version 2.8.10.1, but not version 3.x)
  4. perl

Linux Build Workflow

Step 1. Downloading sources

git clone https://github.com/mxmssh/drltrace.git
mkdir build
cd build

Step 2. Building

Debug Version

cmake -DDEBUG=ON ../drltrace/drltrace_src/
make

Release Version

cmake ../drltrace/drltrace_src/
make

32-bit version (assuming you are on x64 machine)

sudo apt-get install g++-multilib
CFLAGS=-m32 CXXFLAGS=-m32 cmake ../drltrace/drltrace_src/
make