Used external roborio compiler instead of local compiler.

Change-Id: Ifec0d68b0b51a822c906bc4f52320004ee2f5d84
diff --git a/WORKSPACE b/WORKSPACE
index 66027a8..631ea78 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -25,3 +25,10 @@
   name = 'libpthread',
   actual = '@usr_repo//:libpthread',
 )
+
+new_http_archive(
+  name = 'arm-frc-linux-gnueabi-repo',
+  build_file = 'tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi.BUILD',
+  sha256 = '9d92b513b627c4aaa93d4d8049b4c6b96a532b64df11b27fde4dead58347a9f6',
+  url = 'http://frc971.org/Build-Dependencies/arm-frc-linux-gnueabi_4.9.3.tar.gz',
+)
diff --git a/aos/common/util/BUILD b/aos/common/util/BUILD
index d94e6e4..e2c6b8c 100644
--- a/aos/common/util/BUILD
+++ b/aos/common/util/BUILD
@@ -102,7 +102,7 @@
     '//third_party/eigen',
     '//aos/common:time',
     '//aos/common/logging',
-    '//external:libm',
+    '//debian:libm',
   ],
 )
 
diff --git a/aos/linux_code/BUILD b/aos/linux_code/BUILD
index 245acc6..de7f903 100644
--- a/aos/linux_code/BUILD
+++ b/aos/linux_code/BUILD
@@ -22,7 +22,7 @@
   deps = [
     '//aos/common:once',
     '//aos/common:die',
-    '//external:libpthread',
+    '//debian:libpthread',
   ],
 )
 
diff --git a/aos/linux_code/ipc_lib/BUILD b/aos/linux_code/ipc_lib/BUILD
index a8be135..077968b 100644
--- a/aos/linux_code/ipc_lib/BUILD
+++ b/aos/linux_code/ipc_lib/BUILD
@@ -55,7 +55,7 @@
     '//aos/linux_code/ipc_lib:mutex',
     ':core_lib',
     '//aos/common/logging:logging_interface',
-    '//external:librt',
+    '//debian:librt',
   ],
 )
 
diff --git a/debian/BUILD b/debian/BUILD
new file mode 100644
index 0000000..58f87da
--- /dev/null
+++ b/debian/BUILD
@@ -0,0 +1,11 @@
+package(default_visibility = ['//visibility:public'])
+
+load('/tools/build_rules/select', 'cpu_select')
+
+[ cc_library(
+  name = libname,
+  deps = cpu_select({
+    "roborio": ['@arm-frc-linux-gnueabi-repo//:' + libname],
+    "amd64": ['//external:' + libname],
+  }),
+) for libname in ['libpthread', 'libm', 'libdl', 'librt']]
diff --git a/debian/BUILD.usr b/debian/BUILD.usr
index da3e80a..e50da1a 100644
--- a/debian/BUILD.usr
+++ b/debian/BUILD.usr
@@ -1,37 +1,26 @@
-package(default_visibility = ['//visibility:public'])
-
-config_setting(
-  name = "roborio",
-  values = {
-    "cpu": "roborio",
-  }
-)
+package(default_visibility = ['//debian:__pkg__'])
 
 cc_library(
   name = 'librt',
-  srcs = select({
-    ":roborio": ['arm-frc-linux-gnueabi/usr/lib/librt.so'],
-    "//conditions:default": ['lib/x86_64-linux-gnu/librt.so'],
-  }),
+  srcs = [
+    'lib/x86_64-linux-gnu/librt.so'
+  ],
 )
 
 cc_library(
   name = 'libdl',
-  srcs = select({
-    ":roborio": ['arm-frc-linux-gnueabi/usr/lib/libdl.so'],
-    "//conditions:default": ['lib/x86_64-linux-gnu/libdl.so'],
-  }),
+  srcs = [
+    'lib/x86_64-linux-gnu/libdl.so'
+  ],
 )
 
 cc_library(
   name = 'libm',
-  srcs = select({
-    ":roborio": ['arm-frc-linux-gnueabi/usr/lib/libm.so'],
-    "//conditions:default": ['lib/x86_64-linux-gnu/libm.so'],
-  }),
+  srcs = [
+    'lib/x86_64-linux-gnu/libm.so'
+  ],
 )
 
 cc_library(
   name = 'libpthread',
 )
-
diff --git a/frc971/control_loops/BUILD b/frc971/control_loops/BUILD
index 1fba54f..14799e4 100644
--- a/frc971/control_loops/BUILD
+++ b/frc971/control_loops/BUILD
@@ -65,7 +65,7 @@
   deps = [
     ':queues',
     ':gaussian_noise',
-    '//external:libm',
+    '//debian:libm',
   ],
 )
 
@@ -78,7 +78,7 @@
     'gaussian_noise.h',
   ],
   deps = [
-    '//external:libm',
+    '//debian:libm',
   ],
 )
 
@@ -93,7 +93,7 @@
   deps = [
     '//third_party/eigen',
     '//aos/common/controls:polytope',
-    '//external:libm',
+    '//debian:libm',
   ],
 )
 
diff --git a/opt_bazel_base_workspace b/opt_bazel_base_workspace
new file mode 120000
index 0000000..38d2cc4
--- /dev/null
+++ b/opt_bazel_base_workspace
@@ -0,0 +1 @@
+/opt/bazel/base_workspace/
\ No newline at end of file
diff --git a/third_party/gflags/BUILD b/third_party/gflags/BUILD
index bad36a9..532ef3f 100644
--- a/third_party/gflags/BUILD
+++ b/third_party/gflags/BUILD
@@ -42,7 +42,7 @@
     'include/gflags/gflags_completions.h',
   ],
   deps = [
-    '//external:libpthread',
+    '//debian:libpthread',
   ],
   copts = common_copts,
   includes = [ 'include' ],
diff --git a/tools/bazel.rc b/tools/bazel.rc
index 688e1f5..0138d58 100644
--- a/tools/bazel.rc
+++ b/tools/bazel.rc
@@ -1,8 +1,8 @@
 # TODO(Brian): Figure out how we're going to distribute Bazel so everybody
 # doesn't need to hand-edit this file or use a .bazelrc...
-build --package_path %workspace%:/home/brian/bazel/base_workspace
-fetch --package_path %workspace%:/home/brian/bazel/base_workspace
-query --package_path %workspace%:/home/brian/bazel/base_workspace
+build --package_path %workspace%:%workspace%/opt_bazel_base_workspace
+fetch --package_path %workspace%:%workspace%/opt_bazel_base_workspace
+query --package_path %workspace%:%workspace%/opt_bazel_base_workspace
 
 # Complain about missing headers in the dependencies of C++ code instead of just
 # working with it.
diff --git a/tools/cpp/BUILD b/tools/cpp/BUILD
index a29003c..16fb172 100644
--- a/tools/cpp/BUILD
+++ b/tools/cpp/BUILD
@@ -30,6 +30,8 @@
         ":cc-compiler-local",
         ":cc-compiler-k8",
         ":cc-compiler-roborio",
+        '@arm-frc-linux-gnueabi-repo//:compiler_components',
+        ':roborio-compiler-files',
     ],
 )
 
@@ -75,16 +77,39 @@
     supports_param_files = 0,
 )
 
+filegroup(
+  name = 'roborio-compiler-files',
+  srcs = [
+    '//tools/cpp/arm-frc-linux-gnueabi:tool-wrappers',
+    '@arm-frc-linux-gnueabi-repo//:compiler_pieces',
+  ],
+)
+
+filegroup(
+  name = 'roborio_linker_files',
+  srcs = [
+    '//tools/cpp/arm-frc-linux-gnueabi:ld',
+    '//tools/cpp/arm-frc-linux-gnueabi:ar',
+  ],
+)
+filegroup(
+  name = 'roborio_compiler_files',
+  srcs = [
+    '//tools/cpp/arm-frc-linux-gnueabi:gcc',
+    '//tools/cpp/arm-frc-linux-gnueabi:ld',
+  ],
+)
+
 cc_toolchain(
     name = "cc-compiler-roborio",
-    all_files = ":empty",
-    compiler_files = ":empty",
-    cpu = "local",
-    dwp_files = ":empty",
+    all_files = ":roborio-compiler-files",
+    compiler_files = ':roborio_compiler_files',
+    cpu = "roborio",
+    dwp_files = ':empty',
     dynamic_runtime_libs = [":empty"],
-    linker_files = ":empty",
-    objcopy_files = ":empty",
+    linker_files = ":roborio_linker_files",
+    objcopy_files = '//tools/cpp/arm-frc-linux-gnueabi:objcopy',
     static_runtime_libs = [":empty"],
-    strip_files = ":empty",
+    strip_files = '//tools/cpp/arm-frc-linux-gnueabi:strip',
     supports_param_files = 0,
 )
diff --git a/tools/cpp/CROSSTOOL b/tools/cpp/CROSSTOOL
index f874fce..39af245 100644
--- a/tools/cpp/CROSSTOOL
+++ b/tools/cpp/CROSSTOOL
@@ -292,21 +292,21 @@
   target_system_name: "roborio"
   toolchain_identifier: "roborio_linux"
 
-  tool_path { name: "ar" path: "/usr/bin/arm-frc-linux-gnueabi-ar" }
-  tool_path { name: "compat-ld" path: "/usr/bin/arm-frc-linux-gnueabi-ld" }
-  tool_path { name: "cpp" path: "/usr/bin/arm-frc-linux-gnueabi-cpp" }
-  tool_path { name: "dwp" path: "/usr/bin/dwp" }
-  tool_path { name: "gcc" path: "/usr/bin/arm-frc-linux-gnueabi-gcc" }
-  tool_path { name: "gcov" path: "/usr/bin/arm-frc-linux-gnueabi-gcov-4.9" }
+  tool_path { name: "ar" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ar" }
+  tool_path { name: "compat-ld" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld" }
+  tool_path { name: "cpp" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-cpp" }
+  tool_path { name: "dwp" path: "/bin/false" }
+  tool_path { name: "gcc" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcc" }
+  tool_path { name: "gcov" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov-4.9" }
   # C(++) compiles invoke the compiler (as that is the one knowing where
   # to find libraries), but we provide LD so other rules can invoke the linker.
-  tool_path { name: "ld" path: "/usr/bin/arm-frc-linux-gnueabi-ld" }
-  tool_path { name: "nm" path: "/usr/bin/arm-frc-linux-gnueabi-nm" }
-  tool_path { name: "objcopy" path: "/usr/bin/arm-frc-linux-gnueabi-objcopy" }
+  tool_path { name: "ld" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld" }
+  tool_path { name: "nm" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-nm" }
+  tool_path { name: "objcopy" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objcopy" }
   objcopy_embed_flag: "-I"
   objcopy_embed_flag: "binary"
-  tool_path { name: "objdump" path: "/usr/bin/arm-frc-linux-gnueabi-objdump" }
-  tool_path { name: "strip" path: "/usr/bin/arm-frc-linux-gnueabi-strip" }
+  tool_path { name: "objdump" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objdump" }
+  tool_path { name: "strip" path: "arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-strip" }
 
   # TODO(bazel-team): In theory, the path here ought to exactly match the path
   # used by gcc. That works because bazel currently doesn't track files at
diff --git a/tools/cpp/arm-frc-linux-gnueabi/BUILD b/tools/cpp/arm-frc-linux-gnueabi/BUILD
new file mode 100644
index 0000000..4548dbe
--- /dev/null
+++ b/tools/cpp/arm-frc-linux-gnueabi/BUILD
@@ -0,0 +1,70 @@
+package(default_visibility = ['//tools/cpp:__pkg__'])
+
+filegroup(
+  name = 'gcc',
+  srcs = [
+    '@arm-frc-linux-gnueabi-repo//:gcc',
+    'arm-frc-linux-gnueabi-gcc',
+  ],
+)
+
+filegroup(
+  name = 'ar',
+  srcs = [
+    '@arm-frc-linux-gnueabi-repo//:ar',
+    'arm-frc-linux-gnueabi-ar',
+  ],
+)
+
+filegroup(
+  name = 'ld',
+  srcs = [
+    '@arm-frc-linux-gnueabi-repo//:ld',
+    'arm-frc-linux-gnueabi-ld',
+  ],
+)
+
+filegroup(
+  name = 'nm',
+  srcs = [
+    '@arm-frc-linux-gnueabi-repo//:nm',
+    'arm-frc-linux-gnueabi-nm',
+  ],
+)
+
+filegroup(
+  name = 'objcopy',
+  srcs = [
+    '@arm-frc-linux-gnueabi-repo//:objcopy',
+    'arm-frc-linux-gnueabi-objcopy',
+  ],
+)
+
+filegroup(
+  name = 'objdump',
+  srcs = [
+    '@arm-frc-linux-gnueabi-repo//:objdump',
+    'arm-frc-linux-gnueabi-objdump',
+  ],
+)
+
+filegroup(
+  name = 'strip',
+  srcs = [
+    '@arm-frc-linux-gnueabi-repo//:strip',
+    'arm-frc-linux-gnueabi-strip',
+  ],
+)
+
+filegroup(
+  name = 'tool-wrappers',
+  srcs = [
+    ':gcc',
+    ':ar',
+    ':ld',
+    ':nm',
+    ':objcopy',
+    ':objdump',
+    ':strip',
+  ],
+)
diff --git a/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ar b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ar
new file mode 100755
index 0000000..040a122
--- /dev/null
+++ b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ar
@@ -0,0 +1,5 @@
+#!/bin/bash --norc
+
+exec -a arm-frc-linux-gnueabi-ar \
+	"${BAZEL_OUTPUT_ROOT}external/arm-frc-linux-gnueabi-repo/usr/bin/arm-frc-linux-gnueabi-ar" \
+	"$@"
diff --git a/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-as b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-as
new file mode 100755
index 0000000..84b49da
--- /dev/null
+++ b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-as
@@ -0,0 +1,5 @@
+#!/bin/bash --norc
+
+exec -a arm-frc-linux-gnueabi-as \
+	"${BAZEL_OUTPUT_ROOT}external/arm-frc-linux-gnueabi-repo/usr/bin/arm-frc-linux-gnueabi-as" \
+	"$@"
diff --git a/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-cpp b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-cpp
new file mode 100755
index 0000000..c04ad23
--- /dev/null
+++ b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-cpp
@@ -0,0 +1,5 @@
+#!/bin/bash --norc
+
+exec -a arm-frc-linux-gnueabi-cpp \
+	"${BAZEL_OUTPUT_ROOT}external/arm-frc-linux-gnueabi-repo/usr/bin/arm-frc-linux-gnueabi-cpp" \
+	"$@"
diff --git a/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-dwp b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-dwp
new file mode 100755
index 0000000..04bfaa3
--- /dev/null
+++ b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-dwp
@@ -0,0 +1,5 @@
+#!/bin/bash --norc
+
+exec -a arm-frc-linux-gnueabi-dwp \
+	"${BAZEL_OUTPUT_ROOT}external/arm-frc-linux-gnueabi-repo/usr/bin/arm-frc-linux-gnueabi-dwp" \
+	"$@"
diff --git a/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcc b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcc
new file mode 100755
index 0000000..0e306f1
--- /dev/null
+++ b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcc
@@ -0,0 +1,5 @@
+#!/bin/bash --norc
+
+exec \
+	"${BAZEL_OUTPUT_ROOT}external/arm-frc-linux-gnueabi-repo/usr/bin/arm-frc-linux-gnueabi-gcc" \
+	"$@"
diff --git a/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov
new file mode 100755
index 0000000..d220b95
--- /dev/null
+++ b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-gcov
@@ -0,0 +1,5 @@
+#!/bin/bash --norc
+
+exec -a arm-frc-linux-gnueabi-gcov \
+	"${BAZEL_OUTPUT_ROOT}external/arm-frc-linux-gnueabi-repo/usr/bin/arm-frc-linux-gnueabi-gcov" \
+	"$@"
diff --git a/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld
new file mode 100755
index 0000000..db762f3
--- /dev/null
+++ b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-ld
@@ -0,0 +1,5 @@
+#!/bin/bash --norc
+
+exec -a arm-frc-linux-gnueabi-ld \
+	"${BAZEL_OUTPUT_ROOT}external/arm-frc-linux-gnueabi-repo/usr/bin/arm-frc-linux-gnueabi-ld" \
+	"$@"
diff --git a/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-nm b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-nm
new file mode 100755
index 0000000..6348eda
--- /dev/null
+++ b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-nm
@@ -0,0 +1,5 @@
+#!/bin/bash --norc
+
+exec -a arm-frc-linux-gnueabi-nm \
+	"${BAZEL_OUTPUT_ROOT}external/arm-frc-linux-gnueabi-repo/usr/bin/arm-frc-linux-gnueabi-nm" \
+	"$@"
diff --git a/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objcopy b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objcopy
new file mode 100755
index 0000000..b126fc7
--- /dev/null
+++ b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objcopy
@@ -0,0 +1,5 @@
+#!/bin/bash --norc
+
+exec -a arm-frc-linux-gnueabi-objcopy \
+	"${BAZEL_OUTPUT_ROOT}external/arm-frc-linux-gnueabi-repo/usr/bin/arm-frc-linux-gnueabi-objcopy" \
+	"$@"
diff --git a/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objdump b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objdump
new file mode 100755
index 0000000..dacf923
--- /dev/null
+++ b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-objdump
@@ -0,0 +1,5 @@
+#!/bin/bash --norc
+
+exec -a arm-frc-linux-gnueabi-objdump \
+	"${BAZEL_OUTPUT_ROOT}external/arm-frc-linux-gnueabi-repo/usr/bin/arm-frc-linux-gnueabi-objdump" \
+	"$@"
diff --git a/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-repo b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-repo
new file mode 120000
index 0000000..1c8656d
--- /dev/null
+++ b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-repo
@@ -0,0 +1 @@
+../../../bazel-out/../../external/arm-frc-linux-gnueabi-repo
\ No newline at end of file
diff --git a/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-strip b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-strip
new file mode 100755
index 0000000..8469103
--- /dev/null
+++ b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi-strip
@@ -0,0 +1,5 @@
+#!/bin/bash --norc
+
+exec -a arm-frc-linux-gnueabi-strip \
+	"${BAZEL_OUTPUT_ROOT}external/arm-frc-linux-gnueabi-repo/usr/bin/arm-frc-linux-gnueabi-strip" \
+	"$@"
diff --git a/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi.BUILD b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi.BUILD
new file mode 100644
index 0000000..e579f39
--- /dev/null
+++ b/tools/cpp/arm-frc-linux-gnueabi/arm-frc-linux-gnueabi.BUILD
@@ -0,0 +1,98 @@
+package(default_visibility = ["//visibility:public"])
+
+filegroup(
+  name = 'gcc',
+  srcs = [
+    'usr/bin/arm-frc-linux-gnueabi-gcc-4.9',
+  ],
+)
+
+filegroup(
+  name = 'ar',
+  srcs = [
+    'usr/bin/arm-frc-linux-gnueabi-ar',
+  ],
+)
+
+filegroup(
+  name = 'ld',
+  srcs = [
+    'usr/bin/arm-frc-linux-gnueabi-ld',
+  ],
+)
+
+filegroup(
+  name = 'nm',
+  srcs = [
+    'usr/bin/arm-frc-linux-gnueabi-nm',
+  ],
+)
+
+filegroup(
+  name = 'objcopy',
+  srcs = [
+    'usr/bin/arm-frc-linux-gnueabi-objcopy',
+  ],
+)
+
+filegroup(
+  name = 'objdump',
+  srcs = [
+    'usr/bin/arm-frc-linux-gnueabi-objdump',
+  ],
+)
+
+filegroup(
+  name = 'strip',
+  srcs = [
+    'usr/bin/arm-frc-linux-gnueabi-strip',
+  ],
+)
+
+filegroup(
+  name = 'compiler_pieces',
+  srcs = glob([
+    'usr/bin/**/*',
+    'usr/include/**/*',
+    'usr/lib/**/*',
+  ]),
+)
+
+filegroup(
+  name = 'compiler_components',
+  srcs = [
+    ':gcc',
+    ':ar',
+    ':ld',
+    ':nm',
+    ':objcopy',
+    ':objdump',
+    ':strip',
+  ],
+)
+
+cc_library(
+  name = 'librt',
+  srcs = [
+    'usr/arm-frc-linux-gnueabi/usr/lib/librt.so'
+  ],
+)
+
+cc_library(
+  name = 'libdl',
+  srcs = [
+    'usr/arm-frc-linux-gnueabi/usr/lib/libdl.so'
+  ],
+)
+
+cc_library(
+  name = 'libm',
+  srcs = [
+    'usr/arm-frc-linux-gnueabi/usr/lib/libm.so'
+  ],
+)
+
+cc_library(
+  name = 'libpthread',
+)
+
diff --git a/y2014/control_loops/claw/BUILD b/y2014/control_loops/claw/BUILD
index 35aa61b..6382b86 100644
--- a/y2014/control_loops/claw/BUILD
+++ b/y2014/control_loops/claw/BUILD
@@ -44,7 +44,7 @@
     '//frc971/control_loops:coerce_goal',
     '//aos/common/logging:queue_logging',
     '//aos/common/logging:matrix_logging',
-    '//external:libm',
+    '//debian:libm',
   ],
 )
 
diff --git a/y2014/control_loops/shooter/BUILD b/y2014/control_loops/shooter/BUILD
index 8013afc..f04a02a 100644
--- a/y2014/control_loops/shooter/BUILD
+++ b/y2014/control_loops/shooter/BUILD
@@ -43,7 +43,7 @@
     '//y2014:constants',
     '//frc971/control_loops:state_feedback_loop',
     '//aos/common/logging:queue_logging',
-    '//external:libm',
+    '//debian:libm',
   ],
 )
 
diff --git a/y2015/actors/BUILD b/y2015/actors/BUILD
index 92c7c83..3560355 100644
--- a/y2015/actors/BUILD
+++ b/y2015/actors/BUILD
@@ -104,7 +104,7 @@
     '//y2015:constants',
     '//y2015/control_loops/fridge:fridge_queue',
     '//third_party/eigen',
-    '//external:libm',
+    '//debian:libm',
   ],
 )
 
diff --git a/y2015/util/BUILD b/y2015/util/BUILD
index 27c144d..e520d5d 100644
--- a/y2015/util/BUILD
+++ b/y2015/util/BUILD
@@ -5,7 +5,7 @@
   deps = [
     '//third_party/eigen',
     '//y2015:constants',
-    '//external:libm',
+    '//debian:libm',
   ],
 )