Upgrade to a new Bazel version

This one has better performance and various new features. It also
prevents us from falling too far behind upstream.

Change-Id: I3b8e1c5bda886ea2e990523af9e6de2434c784be
diff --git a/tools/cpp/BUILD b/tools/cpp/BUILD
index 40e674f..053b0e4 100644
--- a/tools/cpp/BUILD
+++ b/tools/cpp/BUILD
@@ -23,27 +23,13 @@
   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
-# specified in --cpu.
-#
-# This file group should include
-#   * all cc_toolchain targets supported
-#   * all file groups that said cc_toolchain might refer to,
-# including the default_grte_top setting in the CROSSTOOL
-# protobuf.
-filegroup(
+# This is the entry point for --crosstool_top.
+cc_toolchain_suite(
   name = 'toolchain',
-  srcs = [
-    ':cc-compiler-k8',
-    ':cc-compiler-roborio',
-    '@arm_frc_linux_gnueabi_repo//:compiler_components',
-    ':roborio-compiler-files',
-    ':flags_compiler_inputs',
-    '@linaro_linux_gcc_4_9_repo//:compiler_components',
-    ':linaro-gcc-files',
-  ],
+  toolchains = {
+    'k8|clang': ':cc-compiler-k8',
+    'roborio|gcc': ':cc-compiler-roborio',
+  },
 )
 
 # Compiler inputs given by --copt etc in //tools:bazel.rc.
@@ -90,6 +76,7 @@
     '//tools/cpp/arm-frc-linux-gnueabi:ld',
     '//tools/cpp/arm-frc-linux-gnueabi:ar',
     '//tools/cpp/arm-frc-linux-gnueabi:gcc',
+    '//tools/cpp/arm-frc-linux-gnueabi:libs',
     '@arm_frc_linux_gnueabi_repo//:compiler_pieces',
   ],
 )
@@ -98,6 +85,8 @@
   srcs = [
     '//tools/cpp/arm-frc-linux-gnueabi:gcc',
     '//tools/cpp/arm-frc-linux-gnueabi:ld',
+    '@arm_frc_linux_gnueabi_repo//:compiler_components',
+    '@arm_frc_linux_gnueabi_repo//:compiler_pieces',
   ],
 )
 
diff --git a/tools/cpp/CROSSTOOL b/tools/cpp/CROSSTOOL
index 96fb1b9..5a374af 100644
--- a/tools/cpp/CROSSTOOL
+++ b/tools/cpp/CROSSTOOL
@@ -351,7 +351,7 @@
   cxx_builtin_include_directory: "%package(@arm_frc_linux_gnueabi_repo//usr/arm-frc-linux-gnueabi/usr/include)%"
 
   linker_flag: "-lstdc++"
-  #linker_flag: "-B/usr/bin/"
+  linker_flag: "-Ltools/cpp/arm-frc-linux-gnueabi/libs"
 
   feature {
     name: "opt"
diff --git a/tools/cpp/arm-frc-linux-gnueabi/BUILD b/tools/cpp/arm-frc-linux-gnueabi/BUILD
index 17a10c2..95000c3 100644
--- a/tools/cpp/arm-frc-linux-gnueabi/BUILD
+++ b/tools/cpp/arm-frc-linux-gnueabi/BUILD
@@ -77,3 +77,10 @@
     ':strip',
   ],
 )
+
+filegroup(
+  name = 'libs',
+  srcs = glob([
+    'libs/**',
+  ]),
+)