 +    dr_global_free((void*)channel->ticket_queue.head, sizeof(ticket_queue_t));
 +    dr_mutex_destroy(channel->queue_lock);
 +}
-diff --git a/clients/drsigil/drsigil_parser.c b/clients/drsigil/drsigil_parser.c
+diff --git a/clients/drsigil/parser.c b/clients/drsigil/parser.c
 new file mode 100644
 index 00000000..0d0ced3a
 --- /dev/null
-+++ b/clients/drsigil/drsigil_parser.c
++++ b/clients/drsigil/parser.c
 @@ -0,0 +1,55 @@
 +#include <string.h>
 +#include <getopt.h>

From a0c5d5a06440a6a4cbb0c52b09f869ea5df8d128 Mon Sep 17 00:00:00 2001
From: Mike Lui <mike.d.lui@gmail.com>
Date: Thu, 20 Jul 2017 14:29:46 -0400
Subject: [PATCH] patch

---
 clients/drsigil/CMakeLists.txt         |  27 ++
 clients/drsigil/drsigil.c              | 259 ++++++++++++++
 clients/drsigil/drsigil.h              | 301 +++++++++++++++++
 clients/drsigil/drsigil_instrument.c   | 602 +++++++++++++++++++++++++++++++++
 clients/drsigil/drsigil_ipc.c          | 376 ++++++++++++++++++++
 clients/drsigil/drsigil_parser.c       |  55 +++
 clients/drsigil/pthread_defines.h      | 283 ++++++++++++++++
 clients/drsigil/start_stop_functions.h |  50 +++
 8 files changed, 1953 insertions(+)
 create mode 100644 clients/drsigil/CMakeLists.txt
 create mode 100644 clients/drsigil/drsigil.c
 create mode 100644 clients/drsigil/drsigil.h
 create mode 100644 clients/drsigil/drsigil_instrument.c
 create mode 100644 clients/drsigil/drsigil_ipc.c
 create mode 100644 clients/drsigil/drsigil_parser.c
 create mode 100644 clients/drsigil/pthread_defines.h
 create mode 100644 clients/drsigil/start_stop_functions.h

diff --git a/clients/drsigil/CMakeLists.txt b/clients/drsigil/CMakeLists.txt
new file mode 100644
index 00000000..0e38aff6
--- /dev/null
+++ b/clients/drsigil/CMakeLists.txt
@@ -0,0 +1,27 @@

+# also simplifies relocation in DR
+# set(DynamoRIO_USE_LIBC OFF)
+
+add_library(drsigil SHARED drsigil.c instrument.c ipc.c parser.c)
+find_package(DynamoRIO)
+if (NOT DynamoRIO_FOUND)
+  message(FATAL_ERROR "DynamoRIO package required to build")
