Hook up tcmalloc

Change-Id: I11c8dd2a2bd67f54bdce3ca6eb5bc97d02c9fae9
diff --git a/tools/cpp/BUILD b/tools/cpp/BUILD
index 3a33e0e..9196d44 100644
--- a/tools/cpp/BUILD
+++ b/tools/cpp/BUILD
@@ -1,21 +1,24 @@
-package(default_visibility = ["//visibility:public"])
+package(default_visibility = ['//visibility:public'])
 
 cc_library(
-    name = "malloc",
+  name = 'malloc',
+  deps = [
+    '//third_party/gperftools:tcmalloc',
+  ],
 )
 
 cc_library(
-    name = "stl",
+  name = 'stl',
 )
 
 filegroup(
-    name = "empty",
-    srcs = [],
+  name = 'empty',
+  srcs = [],
 )
 
 # This is the entry point for --crosstool_top.  Toolchains are found
 # by lopping off the name of --crosstool_top and searching for
-# "cc-compiler-${CPU}" in this BUILD file, where CPU is the target CPU
+# 'cc-compiler-${CPU}' in this BUILD file, where CPU is the target CPU
 # specified in --cpu.
 #
 # This file group should include
@@ -24,57 +27,57 @@
 # including the default_grte_top setting in the CROSSTOOL
 # protobuf.
 filegroup(
-    name = "toolchain",
-    srcs = [
-        ":cc-compiler-armeabi-v7a",
-        ":cc-compiler-local",
-        ":cc-compiler-k8",
-        ":cc-compiler-roborio",
-        '@arm-frc-linux-gnueabi-repo//:compiler_components',
-        ':roborio-compiler-files',
-    ],
+  name = 'toolchain',
+  srcs = [
+    ':cc-compiler-armeabi-v7a',
+    ':cc-compiler-local',
+    ':cc-compiler-k8',
+    ':cc-compiler-roborio',
+    '@arm-frc-linux-gnueabi-repo//:compiler_components',
+    ':roborio-compiler-files',
+  ],
 )
 
 cc_toolchain(
-    name = "cc-compiler-local",
-    all_files = ":empty",
-    compiler_files = ":empty",
-    cpu = "local",
-    dwp_files = ":empty",
-    dynamic_runtime_libs = [":empty"],
-    linker_files = ":empty",
-    objcopy_files = ":empty",
-    static_runtime_libs = [":empty"],
-    strip_files = ":empty",
-    supports_param_files = 1,
+  name = 'cc-compiler-local',
+  all_files = ':empty',
+  compiler_files = ':empty',
+  cpu = 'local',
+  dwp_files = ':empty',
+  dynamic_runtime_libs = [':empty'],
+  linker_files = ':empty',
+  objcopy_files = ':empty',
+  static_runtime_libs = [':empty'],
+  strip_files = ':empty',
+  supports_param_files = 1,
 )
 
 cc_toolchain(
-    name = "cc-compiler-armeabi-v7a",
-    all_files = ":empty",
-    compiler_files = ":empty",
-    cpu = "local",
-    dwp_files = ":empty",
-    dynamic_runtime_libs = [":empty"],
-    linker_files = ":empty",
-    objcopy_files = ":empty",
-    static_runtime_libs = [":empty"],
-    strip_files = ":empty",
-    supports_param_files = 1,
+  name = 'cc-compiler-armeabi-v7a',
+  all_files = ':empty',
+  compiler_files = ':empty',
+  cpu = 'local',
+  dwp_files = ':empty',
+  dynamic_runtime_libs = [':empty'],
+  linker_files = ':empty',
+  objcopy_files = ':empty',
+  static_runtime_libs = [':empty'],
+  strip_files = ':empty',
+  supports_param_files = 1,
 )
 
 cc_toolchain(
-    name = "cc-compiler-k8",
-    all_files = ":empty",
-    compiler_files = ":empty",
-    cpu = "local",
-    dwp_files = ":empty",
-    dynamic_runtime_libs = [":empty"],
-    linker_files = ":empty",
-    objcopy_files = ":empty",
-    static_runtime_libs = [":empty"],
-    strip_files = ":empty",
-    supports_param_files = 1,
+  name = 'cc-compiler-k8',
+  all_files = ':empty',
+  compiler_files = ':empty',
+  cpu = 'local',
+  dwp_files = ':empty',
+  dynamic_runtime_libs = [':empty'],
+  linker_files = ':empty',
+  objcopy_files = ':empty',
+  static_runtime_libs = [':empty'],
+  strip_files = ':empty',
+  supports_param_files = 1,
 )
 
 filegroup(
@@ -104,15 +107,15 @@
 )
 
 cc_toolchain(
-    name = "cc-compiler-roborio",
-    all_files = ":roborio-compiler-files",
-    compiler_files = ':roborio_compiler_files',
-    cpu = "roborio",
-    dwp_files = ':empty',
-    dynamic_runtime_libs = [":empty"],
-    linker_files = ":roborio_linker_files",
-    objcopy_files = '//tools/cpp/arm-frc-linux-gnueabi:objcopy',
-    static_runtime_libs = [":empty"],
-    strip_files = '//tools/cpp/arm-frc-linux-gnueabi:strip',
-    supports_param_files = 1,
+  name = 'cc-compiler-roborio',
+  all_files = ':roborio-compiler-files',
+  compiler_files = ':roborio_compiler_files',
+  cpu = 'roborio',
+  dwp_files = ':empty',
+  dynamic_runtime_libs = [':empty'],
+  linker_files = ':roborio_linker_files',
+  objcopy_files = '//tools/cpp/arm-frc-linux-gnueabi:objcopy',
+  static_runtime_libs = [':empty'],
+  strip_files = '//tools/cpp/arm-frc-linux-gnueabi:strip',
+  supports_param_files = 1,
 )