remove all the crio, bbb, and 2014 code

This also meant upgrading to clang-3.5 from llvm.org to try to get it to
build code for the roboRIO.

Change-Id: I44df4af4e9e04296ee7934cc787da3101b1ac449
diff --git a/aos/build/aos.gyp b/aos/build/aos.gyp
index 1187d05..648718c 100644
--- a/aos/build/aos.gyp
+++ b/aos/build/aos.gyp
@@ -1,9 +1,4 @@
 # This file has all of the aos targets.
-# For the cRIO, shared_library means to build a .out file, NOT a shared library.
-#   This means that depending on shared libraries doesn't work very well.
-# Shared libraries don't seem to be supported by the powerpc-wrs-vxworks
-# tools and gyp doesn't like a static_library that depends only on
-# other static_librarys.
 {
   'targets': [
     # A target for things used by the logging implementation (except die) to
diff --git a/aos/build/aos.gypi b/aos/build/aos.gypi
index 6cae0e4..3ffe5c0 100644
--- a/aos/build/aos.gypi
+++ b/aos/build/aos.gypi
@@ -22,32 +22,20 @@
     ],
   },
   'conditions': [
-    ['PLATFORM=="crio"', {
-        'make_global_settings': [
-          ['CC', '<!(readlink -f <(AOS)/build/crio_cc)'],
-          ['CXX', '<!(readlink -f <(AOS)/build/crio_cxx)'],
-        ],
-      }
-    ], ['PLATFORM=="linux-arm-gcc_frc"', {
+    ['PLATFORM=="linux-arm-gcc_frc"', {
         'make_global_settings': [
           ['CC', '<(ccache)<!(which arm-frc-linux-gnueabi-gcc-4.9)'],
           ['CXX', '<(ccache)<!(which arm-frc-linux-gnueabi-g++-4.9)'],
         ],
       },
-    ], ['PLATFORM=="linux-arm-gcc"', {
-        'make_global_settings': [
-          ['CC', '<(ccache)<!(which arm-linux-gnueabihf-gcc-4.7)'],
-          ['CXX', '<(ccache)<!(which arm-linux-gnueabihf-g++-4.7)'],
-        ],
-      },
-    ], ['PLATFORM=="linux-arm-clang"', {
+    ], ['PLATFORM=="linux-arm-clang_frc"', {
         'variables': {
           'arm-clang-symlinks': '<!(realpath -s <(AOS)/build/arm-clang-symlinks)',
           'arm-clang-sysroot': '<(arm-clang-symlinks)/sysroot',
 # Flags that should be passed to all compile/link/etc commands.
           'platflags': [
-            '-target', 'armv7a-linux-gnueabihf',
-            '-mfloat-abi=hard',
+            '-target', 'armv7a-frc-linux-gnueabi',
+            '-mfloat-abi=softfp',
             '--sysroot=<(arm-clang-sysroot)',
 
             # TODO(brians): See if it will run with this enabled.
@@ -63,18 +51,21 @@
             '<@(platflags)',
           ],
           'cflags_cc': [
-            '-isystem', '<(arm-clang-sysroot)/usr/include/c++/4.7.2',
-            '-isystem', '<(arm-clang-sysroot)/usr/include/c++/4.7.2/arm-linux-gnueabihf',
+            '-isystem', '<(arm-clang-sysroot)/include/c++/4.9.1',
+            '-isystem', '<(arm-clang-sysroot)/include/c++/4.9.1/arm-frc-linux-gnueabi',
           ],
           'ldflags': [
             '<@(platflags)',
+            '-L', '/usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/4.9.1',
+            #'-L', '<(arm-clang-sysroot)/other_lib/',
+            #'-nostartfiles',
           ],
         },
       },
     ], ['PLATFORM=="linux-amd64-clang"', {
         'make_global_settings': [
-          ['CC', '<(ccache)/opt/clang-3.5/bin/clang'],
-          ['CXX', '<(ccache)/opt/clang-3.5/bin/clang++'],
+          ['CC', '<(ccache)<!(which clang)'],
+          ['CXX', '<(ccache)<!(which clang++)'],
         ],
       },
     ], ['PLATFORM=="linux-amd64-gcc"', {
@@ -153,13 +144,21 @@
       '__STDC_CONSTANT_MACROS',
       '__STDC_LIMIT_MACROS',
       'AOS_COMPILER_<!(echo <(FULL_COMPILER) | sed \'s/\./_/g\')',
+      '_FILE_OFFSET_BITS=64',
     ],
     'ldflags': [
       '-pipe',
+      '-pthread',
+    ],
+    'libraries': [
+      '-lm',
+      '-lrt',
     ],
     'cflags': [
       '-pipe',
 
+      '-pthread',
+
       '-Wall',
       '-Wextra',
       '-Wswitch-enum',
@@ -178,6 +177,9 @@
     'cflags_c': [
       '-std=gnu99',
     ],
+    'cflags_cc': [
+      '-std=gnu++11',
+    ],
     'include_dirs': [
       '<(DEPTH)',
     ],
@@ -217,15 +219,7 @@
           'ldflags': [
             '-O3',
           ],
-          'conditions': [['PLATFORM=="crio"', {
-# Copied from stuff that I think started with the supplied Makefiles.
-              'cflags': [
-                '-fstrength-reduce',
-                '-fno-builtin',
-                '-fno-strict-aliasing',
-              ],
-            }],
-            ['ARCHITECTURE=="amd64"', {
+          'conditions': [['ARCHITECTURE=="amd64"', {
               'cflags': [
                 '-fstack-protector-all',
               ],
@@ -244,17 +238,7 @@
           ],
         }
       ],
-      ['ARCHITECTURE=="arm" and FULL_COMPILER!="gcc_frc"', {
-        'cflags': [
-          '-mcpu=cortex-a8',
-          '-mfpu=neon',
-        ],
-        'ldflags': [
-          '-mcpu=cortex-a8',
-          '-mfpu=neon',
-        ],
-      }],
-      ['ARCHITECTURE=="arm" and FULL_COMPILER=="gcc_frc"', {
+      ['ARCHITECTURE=="arm"', {
         'cflags': [
           '-mcpu=cortex-a9',
           '-mfpu=neon',
@@ -266,95 +250,31 @@
           '-mfloat-abi=softfp',
         ],
       }],
-      ['PLATFORM=="crio"', {
-          'target_conditions': [
-            ['_type=="shared_library"', {
-                'ldflags': [
-                  '-r',
-                  '-nostdlib',
-                  '-Wl,-X',
-                ],
-              }
-            ],
-          ],
-          'ldflags': [
-            '-mcpu=603e',
-            '-mstrict-align',
-            '-mlongcall',
-          ],
-          'cflags': [
-            # The Freescale MPC5200B (cRIO-FRC) and MPC5125 (cRIO-FRC II) both
-            # have MPC603e cores according to Freescale docs.
-            '-mcpu=603e',
-            '-mstrict-align',
-            '-mlongcall',
-            '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/lib/gcc/powerpc-wrs-vxworks/3.4.4/include/',
-            '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/vxworks-6.3/target/h/',
-            '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/',
-            '-isystem', '<(aos_abs)/../output/downloaded/gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/include/c++/3.4.4/powerpc-wrs-vxworks/',
-            '-isystem', '<(WIND_BASE)/target/h',
-            '-isystem', '<(WIND_BASE)/target/h/wrn/coreip',
-          ],
-          'cflags_cc': [
-            '-std=gnu++0x',
-          ],
-          'defines': [
-            'CPU=PPC603',
-            'TOOL_FAMILY=gnu',
-            'TOOL=gnu',
-            '_WRS_KERNEL',
-            '__PPC__',
-# Prevent the vxworks system headers from being dumb and #defining min and max.
-            'NOMINMAX',
-          ],
-        }, { # 'PLATFORM!="crio"'
-          'target_conditions': [
+      ['COMPILER=="gcc"', {
+        'cflags': [
+          '-Wunused-local-typedefs',
+        ],
+        'defines': [
+          '__has_feature(n)=0'
+        ],
+      }], ['COMPILER=="clang"', {
+        'cflags': [
+          '-fcolor-diagnostics',
+          '-fmessage-length=80',
+          '-fmacro-backtrace-limit=0',
+        ],
+        'defines': [
+          # This tells clang's optimizer the same thing.
+          '__builtin_assume_aligned(p, a)=({ const typeof(p) my_p_ = (p); ((((uintptr_t)my_p_ % (a)) == 0u) ? my_p_ : (__builtin_unreachable(), (my_p_))); })',
+        ],
+      }],
+    ],
+    'target_conditions': [
 # Default to putting outputs into rsync_dir.
-            ['no_rsync==0 and _type!="static_library"', {
-                'product_dir': '<(rsync_dir)',
-              },
-            ],
-          ],
-          'ldflags': [
-            '-pthread',
-          ],
-          'cflags': [
-            '-pthread',
-          ],
-          'cflags_cc': [
-            '-std=gnu++11',
-          ],
-          'defines': [
-            '_FILE_OFFSET_BITS=64',
-          ],
-          'libraries': [
-            '-lm',
-            '-lrt',
-          ],
-          'conditions': [
-            ['COMPILER=="gcc"', {
-                'cflags': [
-                  '-Wunused-local-typedefs',
-                ],
-                'defines': [
-                  '__has_feature(n)=0'
-                ],
-              },
-            ], ['COMPILER=="clang"', {
-                'cflags': [
-                  '-fcolor-diagnostics',
-                  '-fmessage-length=80',
-                  '-fmacro-backtrace-limit=0',
-                ],
-                'defines': [
-                  # This tells clang's optimizer the same thing.
-                  '__builtin_assume_aligned(p, a)=({ const typeof(p) my_p_ = (p); ((((uintptr_t)my_p_ % (a)) == 0u) ? my_p_ : (__builtin_unreachable(), (my_p_))); })',
-                ],
-              },
-            ],
-          ],
-        }
-      ]
+      ['no_rsync==0 and _type!="static_library"', {
+          'product_dir': '<(rsync_dir)',
+        },
+      ],
     ],
   },
 }
diff --git a/aos/build/aos_all.gyp b/aos/build/aos_all.gyp
index 3d02b84..d67a11d 100644
--- a/aos/build/aos_all.gyp
+++ b/aos/build/aos_all.gyp
@@ -17,7 +17,6 @@
         '<(AOS)/linux_code/ipc_lib/ipc_lib.gyp:raw_queue_test',
         '<(AOS)/linux_code/ipc_lib/ipc_lib.gyp:ipc_stress_test',
         '<(AOS)/linux_code/starter/starter.gyp:starter_exe',
-        '<(AOS)/linux_code/starter/starter.gyp:netconsole',
         '<(AOS)/linux_code/linux_code.gyp:complex_thread_local_test',
         '<(AOS)/linux_code/linux_code.gyp:dump_rtprio',
       ],
diff --git a/aos/build/arm-clang-symlinks/bin/as b/aos/build/arm-clang-symlinks/bin/as
index 0e8bd12..f5bd4f8 120000
--- a/aos/build/arm-clang-symlinks/bin/as
+++ b/aos/build/arm-clang-symlinks/bin/as
@@ -1 +1 @@
-/usr/arm-linux-gnueabihf/bin/as
\ No newline at end of file
+/usr/bin/arm-frc-linux-gnueabi-as
\ No newline at end of file
diff --git a/aos/build/arm-clang-symlinks/bin/clang b/aos/build/arm-clang-symlinks/bin/clang
index 6e5b0eb..c456250 120000
--- a/aos/build/arm-clang-symlinks/bin/clang
+++ b/aos/build/arm-clang-symlinks/bin/clang
@@ -1 +1 @@
-/opt/clang-3.5/bin/clang
\ No newline at end of file
+/usr/bin/clang
\ No newline at end of file
diff --git a/aos/build/arm-clang-symlinks/bin/clang++ b/aos/build/arm-clang-symlinks/bin/clang++
index 3237b82..2932265 120000
--- a/aos/build/arm-clang-symlinks/bin/clang++
+++ b/aos/build/arm-clang-symlinks/bin/clang++
@@ -1 +1 @@
-/opt/clang-3.5/bin/clang++
\ No newline at end of file
+/usr/bin/clang++
\ No newline at end of file
diff --git a/aos/build/arm-clang-symlinks/bin/ld b/aos/build/arm-clang-symlinks/bin/ld
index 5981fc6..a12d1ed 120000
--- a/aos/build/arm-clang-symlinks/bin/ld
+++ b/aos/build/arm-clang-symlinks/bin/ld
@@ -1 +1 @@
-/usr/arm-linux-gnueabihf/bin/ld.gold
\ No newline at end of file
+/usr/bin/arm-frc-linux-gnueabi-ld
\ No newline at end of file
diff --git a/aos/build/arm-clang-symlinks/more_libs/libc.so b/aos/build/arm-clang-symlinks/more_libs/libc.so
new file mode 100644
index 0000000..188a467
--- /dev/null
+++ b/aos/build/arm-clang-symlinks/more_libs/libc.so
@@ -0,0 +1,5 @@
+/* GNU ld script
+   Use the shared library, but some functions are only in
+   the static library, so try that secondarily.  */
+OUTPUT_FORMAT(elf32-littlearm)
+GROUP ( /home/brian/Desktop/git_frc971/2014/trunk/src/aos/build/arm-clang-symlinks/sysroot/lib/libc.so.6 /home/brian/Desktop/git_frc971/2014/trunk/src/aos/build/arm-clang-symlinks/sysroot/usr/lib/libc_nonshared.a  AS_NEEDED ( /home/brian/Desktop/git_frc971/2014/trunk/src/aos/build/arm-clang-symlinks/sysroot/lib/ld-linux.so.3 ) )
diff --git a/aos/build/arm-clang-symlinks/more_libs/libpthread.so b/aos/build/arm-clang-symlinks/more_libs/libpthread.so
new file mode 100644
index 0000000..a7c99bf
--- /dev/null
+++ b/aos/build/arm-clang-symlinks/more_libs/libpthread.so
@@ -0,0 +1,5 @@
+/* GNU ld script
+   Use the shared library, but some functions are only in
+   the static library, so try that secondarily.  */
+OUTPUT_FORMAT(elf32-littlearm)
+GROUP ( /home/brian/Desktop/git_frc971/2014/trunk/src/aos/build/arm-clang-symlinks/sysroot/lib/libpthread.so.0 /home/brian/Desktop/git_frc971/2014/trunk/src/aos/build/arm-clang-symlinks/sysroot/usr/lib/libpthread_nonshared.a )
diff --git a/aos/build/arm-clang-symlinks/other_lib b/aos/build/arm-clang-symlinks/other_lib
new file mode 120000
index 0000000..4603144
--- /dev/null
+++ b/aos/build/arm-clang-symlinks/other_lib
@@ -0,0 +1 @@
+/usr/lib/x86_64-linux-gnu/gcc/arm-frc-linux-gnueabi/4.9.1
\ No newline at end of file
diff --git a/aos/build/arm-clang-symlinks/sysroot/include b/aos/build/arm-clang-symlinks/sysroot/include
new file mode 120000
index 0000000..f4878ac
--- /dev/null
+++ b/aos/build/arm-clang-symlinks/sysroot/include
@@ -0,0 +1 @@
+/usr/arm-frc-linux-gnueabi/include
\ No newline at end of file
diff --git a/aos/build/arm-clang-symlinks/sysroot/lib b/aos/build/arm-clang-symlinks/sysroot/lib
index aa3bc5b..5a01f30 120000
--- a/aos/build/arm-clang-symlinks/sysroot/lib
+++ b/aos/build/arm-clang-symlinks/sysroot/lib
@@ -1 +1 @@
-/usr/lib/gcc/arm-linux-gnueabihf/4.7
\ No newline at end of file
+/usr/arm-frc-linux-gnueabi/lib
\ No newline at end of file
diff --git a/aos/build/arm-clang-symlinks/sysroot/usr b/aos/build/arm-clang-symlinks/sysroot/usr
new file mode 120000
index 0000000..5d4ffd7
--- /dev/null
+++ b/aos/build/arm-clang-symlinks/sysroot/usr
@@ -0,0 +1 @@
+/usr/arm-frc-linux-gnueabi/usr
\ No newline at end of file
diff --git a/aos/build/arm-clang-symlinks/sysroot/usr/include b/aos/build/arm-clang-symlinks/sysroot/usr/include
deleted file mode 120000
index 60bd24d..0000000
--- a/aos/build/arm-clang-symlinks/sysroot/usr/include
+++ /dev/null
@@ -1 +0,0 @@
-/usr/arm-linux-gnueabihf/include
\ No newline at end of file
diff --git a/aos/build/arm-clang-symlinks/sysroot/usr/lib b/aos/build/arm-clang-symlinks/sysroot/usr/lib
deleted file mode 120000
index a9253d6..0000000
--- a/aos/build/arm-clang-symlinks/sysroot/usr/lib
+++ /dev/null
@@ -1 +0,0 @@
-/usr/arm-linux-gnueabihf/lib
\ No newline at end of file
diff --git a/aos/build/build.py b/aos/build/build.py
index acca25f..39559b3 100755
--- a/aos/build/build.py
+++ b/aos/build/build.py
@@ -377,86 +377,6 @@
                   ' '.join(not_found))
       exit(1)
 
-class CRIOProcessor(Processor):
-  """A Processor subclass for building cRIO code."""
-
-  class Platform(Processor.Platform):
-    def __init__(self, debug, wind_base):
-      super(CRIOProcessor.Platform, self).__init__()
-
-      self.__debug = debug
-      self.__wind_base = wind_base
-
-    def __repr__(self):
-      return 'CRIOProcessor.Platform(debug=%s)' % self.debug()
-    def __str__(self):
-      return 'crio%s' % ('-debug' if self.debug() else '')
-
-    def outname(self):
-      return 'crio-debug' if self.debug() else 'crio'
-    def os(self):
-      return 'vxworks'
-    def gyp_platform(self):
-      return 'crio'
-    def architecture(self):
-      return 'ppc'
-    def compiler(self):
-      return 'gcc'
-    def sanitizer(self):
-      return 'none'
-    def debug(self):
-      return self.__debug
-    def wind_base(self):
-      return self.__wind_base
-
-    # TODO(brians): test this
-    def deploy(self, dry_run):
-      self.do_deploy(dry_run,
-                     ('ncftpput', get_ip('robot'), '/',
-                      os.path.join(self.outdir(), 'lib',
-                                   'FRC_UserProgram.out')))
-
-    def build_env(self):
-      return {'WIND_BASE': self.wind_base()}
-
-  def __init__(self):
-    super(CRIOProcessor, self).__init__()
-
-    if 'WIND_BASE' in os.environ:
-      self.__wind_base = os.environ['WIND_BASE']
-    else:
-      self.__wind_base = '/usr/local/powerpc-wrs-vxworks/wind_base'
-
-  def parse_platforms(self, platforms_string):
-    if platforms_string is None or platforms_string == 'crio':
-      return (CRIOProcessor.Platform(False, self.wind_base()),)
-    elif string == 'crio-debug' or string == 'debug':
-      return (CRIOProcessor.Platform(True, self.wind_base()),)
-    else:
-      raise Processor.UnknownPlatform(
-          '"%s" not recognized as a cRIO platform.' % platforms_string)
-
-  def wind_base(self):
-    return self.__wind_base
-
-  def extra_gyp_flags(self):
-    return ('-DWIND_BASE=%s' % self.wind_base(),)
-
-  def modify_ninja_file(self, ninja_file):
-    subprocess.check_call(
-        ('sed', '-i',
-         's/nm -gD/nm/g', ninja_file),
-        stdin=open(os.devnull, 'r'))
-
-  def download_externals(self, _):
-    call_download_externals('crio')
-
-  def check_installed(self, platforms, is_deploy):
-    packages = ('powerpc-wrs-vxworks', 'tcl')
-    if is_deploy:
-      packages += ('ncftp',)
-    self.do_check_installed(packages)
-
 class PrimeProcessor(Processor):
   """A Processor subclass for building prime code."""
 
@@ -511,7 +431,7 @@
     def deploy(self, dry_run):
       # Downloads code to the prime in a way that avoids clashing too badly with
       # starter (like the naive download everything one at a time).
-      if self.compiler() == 'gcc_frc':
+      if self.compiler().endswith('_frc'):
         device = 'roboRIO'
       else:
         device = 'prime'
@@ -550,11 +470,11 @@
              ''.join(mv_cmd).format(TMPDIR=TEMP_DIR, TO_DIR=TARGET_DIR)))
 
     def build_env(self):
-      OTHER_SYSROOT = '/opt/clang-3.5/'
+      OTHER_SYSROOT = '/usr/lib/llvm-3.5'
       SYMBOLIZER_PATH = OTHER_SYSROOT + 'bin/llvm-symbolizer'
       r = {}
       if self.compiler() == 'clang' or self.compiler() == 'gcc_4.8':
-        r['LD_LIBRARY_PATH'] = OTHER_SYSROOT + 'lib64'
+        r['LD_LIBRARY_PATH'] = OTHER_SYSROOT + 'lib'
       if self.sanitizer() == 'address':
         r['ASAN_SYMBOLIZER_PATH'] = SYMBOLIZER_PATH
         r['ASAN_OPTIONS'] = \
@@ -570,7 +490,7 @@
       r['CCACHE_DIR'] = os.path.abspath(os.path.join(aos_path(), '..', 'output',
                                                      'ccache_dir'))
       r['CCACHE_HASHDIR'] = 'yes'
-      if self.compiler() == 'clang':
+      if self.compiler().startswith('clang'):
         # clang doesn't like being run directly on the preprocessed files.
         r['CCACHE_CPP2'] = 'yes'
       # Without this, ccache slows down because of the generated header files.
@@ -586,7 +506,7 @@
       return r
 
   ARCHITECTURES = ('arm', 'amd64')
-  COMPILERS = ('clang', 'gcc', 'gcc_4.8', 'gcc_frc')
+  COMPILERS = ('clang', 'gcc', 'gcc_frc')
   SANITIZERS = ('address', 'undefined', 'integer', 'memory', 'thread', 'none')
   SANITIZER_TEST_WARNINGS = {
       'memory': (True,
@@ -603,14 +523,14 @@
     for architecture in PrimeProcessor.ARCHITECTURES:
       for compiler in PrimeProcessor.COMPILERS:
         for debug in [True, False]:
-          if ((architecture == 'arm' and compiler == 'gcc_4.8') or
-              (architecture == 'amd64' and compiler == 'gcc_frc')):
+          if ((architecture == 'arm' and not compiler.endswith('_frc')) or
+              (architecture == 'amd64' and compiler.endswith('_frc'))):
             # We don't have a compiler to use here.
             continue
           platforms.append(
               self.Platform(architecture, compiler, debug, 'none'))
     for sanitizer in PrimeProcessor.SANITIZERS:
-      for compiler in ('gcc_4.8', 'clang'):
+      for compiler in ('clang',):
         if compiler == 'gcc_4.8' and (sanitizer == 'undefined' or
                                       sanitizer == 'integer' or
                                       sanitizer == 'memory'):
@@ -630,12 +550,8 @@
         if warning[0]:
           default_platforms -= self.select_platforms(sanitizer=sanitizer)
     elif is_deploy:
-      if get_ip_base() == '10.99.71':
-        compiler = 'gcc_frc'
-      else:
-        compiler = 'clang'
       default_platforms = self.select_platforms(architecture='arm',
-                                                compiler=compiler,
+                                                compiler='gcc_frc',
                                                 debug=False)
     else:
       default_platforms = self.select_platforms(debug=False)
@@ -732,7 +648,8 @@
       if platform.architecture() == 'arm':
         packages.add('gcc-4.7-arm-linux-gnueabihf')
         packages.add('g++-4.7-arm-linux-gnueabihf')
-      if platform.compiler() == 'clang' or platform.compiler() == 'gcc_4.8':
+      if (platform.compiler() == 'clang' or platform.compiler() == 'gcc_4.8' or
+          platform.compiler() == 'clang_frc'):
         packages.add('clang-3.5')
       if platform.compiler() == 'gcc_4.8':
         packages.add('libcloog-isl3:amd64')
@@ -847,7 +764,7 @@
     if len(r) > 1:
       r[-1] = 'and ' + r[-1]
     return ', '.join(r)
-  
+
   class Arguments(object):
     def __init__(self):
       self.jobs = os.sysconf('SC_NPROCESSORS_ONLN') + 2
@@ -890,9 +807,7 @@
     else:
       args.platform = arg
 
-  if args.processor == 'crio':
-    processor = CRIOProcessor()
-  elif args.processor == 'prime':
+  if args.processor == 'prime':
     processor = PrimeProcessor(args.action_name == 'tests',
                                args.action_name == 'deploy')
   elif args.processor == 'bot3_prime':
@@ -1018,7 +933,7 @@
              '-DSANITIZER=%s' % platform.sanitizer(),
              '-DEXTERNALS_EXTRA=%s' %
              ('-fPIE' if platform.sanitizer() in PrimeProcessor.PIE_SANITIZERS
-              else ('_frc' if platform.compiler() == 'gcc_frc' else ''))) +
+              else ('_frc' if platform.compiler().endswith('_frc') else ''))) +
             processor.extra_gyp_flags() + (args.main_gyp,),
             stdin=subprocess.PIPE)
         gyp.communicate(("""
diff --git a/aos/build/crio_cc b/aos/build/crio_cc
deleted file mode 100755
index 442d3fe..0000000
--- a/aos/build/crio_cc
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-# This is a helper script that gets called as a replacement for gcc. It just
-# passes all arguments on unless it is being called as a shared linker.
-
-[ $1 != '-shared' ] && exec powerpc-wrs-vxworks-gcc "$@"
-exec $(dirname $0)/crio_link_out "$@"
diff --git a/aos/build/crio_cxx b/aos/build/crio_cxx
deleted file mode 100755
index ea68e58..0000000
--- a/aos/build/crio_cxx
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-
-# This is a helper script that gets called as a replacement for g++. It just
-# passes all arguments on unless it is being called as a shared linker.
-
-[ $1 != '-shared' ] && exec powerpc-wrs-vxworks-g++ "$@"
-exec $(dirname $0)/crio_link_out "$@"
diff --git a/aos/build/crio_link_out b/aos/build/crio_link_out
deleted file mode 100755
index 0630341..0000000
--- a/aos/build/crio_link_out
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-#set -x
-
-set -e
-
-# This is a helper script that compiles .out files for the cRIO. It gets called
-# by the gcc and g++ wrapper scripts if they detect that the tool is being used
-# as a shared linker.
-
-# All the flags except -shared.
-INPUTS_FLAGS=`echo "$@" | sed 's/-shared//g'`
-# The arguments after any -o flags.
-OUTPUT=`echo ${INPUTS_FLAGS} | awk \
-  'BEGIN { RS=" " }; output { print ; output = 0 }; /-o/ { output = 1 }'`
-# All arguments that don't start with a - and aren't ${OUTPUT}.
-INPUTS=`echo ${INPUTS_FLAGS} | awk \
-  'BEGIN { RS=" " }; /-Wl,--no-whole-archive/ { output = 0 }; \
-  output { print }; \
-  /-Wl,--whole-archive/ { output = 1 }'`
-TEMPDIR=`dirname ${OUTPUT}`
-AOS=`dirname $0`/..
-powerpc-wrs-vxworks-nm ${INPUTS} | \
-  tclsh ${WIND_BASE}/host/resource/hutils/tcl/munch.tcl -c ppc > \
-    ${TEMPDIR}/ctdt.c
-powerpc-wrs-vxworks-gcc -I${AOS}/.. -c ${TEMPDIR}/ctdt.c -o ${TEMPDIR}/ctdt.o
-powerpc-wrs-vxworks-g++ ${INPUTS_FLAGS} ${TEMPDIR}/ctdt.o
-ln -f ${OUTPUT} `echo ${OUTPUT} | sed 's/lib\([A-Za-z0-9_]*\)\.so$/\1.out/'`
diff --git a/aos/build/download_externals.sh b/aos/build/download_externals.sh
index 674dc3a..50eec85 100755
--- a/aos/build/download_externals.sh
+++ b/aos/build/download_externals.sh
@@ -26,7 +26,6 @@
   export CXXFLAGS="-mcpu=cortex-a8 -mfpu=neon"
   export OBJDUMP=${CROSS_COMPILE}objdump
   CONFIGURE_FLAGS="--host=arm-linux-gnueabihf CC=${CC} CXX=${CXX} CFLAGS=\"${CFLAGS}\" CXXFLAGS=\"${CXXFLAGS}\" OBJDUMP=${OBJDUMP}"
-  IS_CRIO=0
 elif [ "$1" == "arm_frc" ]; then
   COMPILED=${EXTERNALS}/../compiled-arm_frc
 
@@ -40,7 +39,6 @@
   CONFIGURE_FLAGS="--host=arm-frc-linux-gnueabi CC=${CC} CXX=${CXX} CFLAGS=\"${CFLAGS}\" CXXFLAGS=\"${CXXFLAGS}\" OBJDUMP=${OBJDUMP}"
 elif [ "$1" == "amd64" ]; then
   COMPILED=${EXTERNALS}/../compiled-amd64
-  IS_CRIO=0
 elif [ "$1" == "amd64-fPIE" ]; then
   COMPILED=${EXTERNALS}/../compiled-amd64-fPIE
 
@@ -49,9 +47,6 @@
   ALL_LDFLAGS="-fPIE"
   export LDFLAGS=${ALL_LDFLAGS}
   CONFIGURE_FLAGS="CFLAGS=\"${CFLAGS}\" CXXFLAGS=\"${CXXFLAGS}\" LDFLAGS=\"${LDFLAGS}\""
-  IS_CRIO=0
-elif [ "$1" == "crio" ]; then
-  IS_CRIO=1
 else
   echo "Unknown platform $1 to download externals for." 1>&2
   exit 1
@@ -68,24 +63,12 @@
 # get gyp
 [ -d ${GYP_DIR} ] || ( svn co http://gyp.googlecode.com/svn/trunk -r ${GYP_REVISION} ${GYP_DIR} && patch -p1 -d ${GYP_DIR} < ${AOS}/externals/gyp.patch )
 
-# get gccdist
-GCCDIST=${EXTERNALS}/gccdist
-[ -f ${GCCDIST}.zip ] || wget ftp://ftp.ni.com/pub/devzone/tut/updated_vxworks63gccdist.zip -O ${GCCDIST}.zip
-[ -d ${GCCDIST} ] || ( cd ${EXTERNALS} && unzip -q ${GCCDIST}.zip )
-
 # get eigen
 EIGEN_VERSION=3.2.1
 EIGEN_DIR=${EXTERNALS}/eigen-${EIGEN_VERSION}
 [ -f ${EIGEN_DIR}.tar.bz2 ] || wget http://bitbucket.org/eigen/eigen/get/${EIGEN_VERSION}.tar.bz2 -O ${EIGEN_DIR}.tar.bz2
 [ -d ${EIGEN_DIR} ] || ( mkdir ${EIGEN_DIR} && tar --strip-components=1 -C ${EIGEN_DIR} -xf ${EIGEN_DIR}.tar.bz2 )
 
-# get the LLVM Compiler-RT source
-COMPILER_RT_TAG=RELEASE_32/final
-COMPILER_RT_VERSION=`echo ${COMPILER_RT_TAG} | sed s:/:_:`
-COMPILER_RT_DIR=${EXTERNALS}/compiler-rt-${COMPILER_RT_VERSION}
-COMPILER_RT_URL=http://llvm.org/svn/llvm-project/compiler-rt/tags/${COMPILER_RT_TAG}
-[ -d ${COMPILER_RT_DIR} ] || svn checkout ${COMPILER_RT_URL} ${COMPILER_RT_DIR}
-
 # get gtest
 GTEST_VERSION=1.6.0
 GTEST_DIR=${EXTERNALS}/gtest-${GTEST_VERSION}-p2
@@ -93,8 +76,6 @@
 [ -f ${GTEST_ZIP} ] || wget http://googletest.googlecode.com/files/gtest-${GTEST_VERSION}.zip -O ${GTEST_ZIP}
 [ -d ${GTEST_DIR} ] || ( unzip ${GTEST_ZIP} -d ${TMPDIR} && mv ${TMPDIR}/gtest-${GTEST_VERSION} ${GTEST_DIR} && cd ${GTEST_DIR} && patch -p1 < ${AOS}/externals/gtest.patch )
 
-[[ ${IS_CRIO} -eq 1 ]] && exit 0
-
 # get and build libjpeg
 LIBJPEG_VERSION=8d
 LIBJPEG_DIR=${COMPILED}/jpeg-${LIBJPEG_VERSION}
@@ -195,14 +176,6 @@
 	--prefix=$(readlink -f ${LIBCDD_PREFIX}) \
 	&& make gmpdir=${GMP_PREFIX} && make install"
 
-# download stm32flash
-STM32FLASH_COMMIT=8399fbe1baf2b7d097746786458021d92895d71b
-STM32FLASH_DIR=${EXTERNALS}/stm32flash-${STM32FLASH_COMMIT}
-STM32FLASH_URL=https://git.gitorious.org/stm32flash/stm32flash.git
-[ -d ${STM32FLASH_DIR} ] || ( mkdir ${STM32FLASH_DIR} && \
-	git clone ${STM32FLASH_URL} ${STM32FLASH_DIR}/stm32flash && \
-	cd ${STM32FLASH_DIR}/stm32flash && git checkout ${STM32FLASH_COMMIT} )
-
 # get and build libunwind
 LIBUNWIND_VERSION=1.1
 LIBUNWIND_TAR=${EXTERNALS}/libunwind-${LIBUNWIND_VERSION}.tar.gz
diff --git a/aos/build/externals.gyp b/aos/build/externals.gyp
index ae5a038..de00669 100644
--- a/aos/build/externals.gyp
+++ b/aos/build/externals.gyp
@@ -46,54 +46,6 @@
       },
     },
     {
-      'target_name': 'WPILib',
-      'type': 'static_library',
-      'sources': [
-        '<!@(find <(AOS)/externals/WPILib/WPILib/ -name *.cpp)',
-      ],
-      'cflags!': [
-        '-Werror',
-        '-ggdb3',
-        '-O0'
-      ],
-      'cflags': [
-        '-ggdb1',
-        '-O3'
-      ],
-      'include_dirs': [
-        '<(AOS)/externals/WPILib',
-        '<(AOS)/externals/WPILib/WPILib',
-      ],
-      'direct_dependent_settings': {
-        'cflags': [
-          '-isystem', '<(AOS)/externals/WPILib',
-          '-isystem', '<(AOS)/externals/WPILib/WPILib',
-        ],
-      },
-    },
-    {
-      'target_name': 'WPILib-NetworkRobotValues',
-      'type': 'static_library',
-      'sources': [
-        '<(AOS)/externals/WPILib/WPILib/NetworkRobot/NetworkRobotValues.cpp'
-      ],
-      'include_dirs': [
-        '<(AOS)/externals/WPILib',
-      ],
-      'defines': [
-        # Clang doesn't like having register in the hton* macros.
-        'register=',
-      ],
-      'direct_dependent_settings': {
-        'include_dirs': [
-          '<(AOS)/externals/WPILib',
-        ],
-        'defines': [
-          'register=',
-        ],
-      },
-    },
-    {
       'target_name': 'opencv',
       'type': 'none',
       'link_settings': {
@@ -205,26 +157,5 @@
         'include_dirs': ['<(compiled_abs)/'],
       },
     },
-    {
-      'target_name': 'stm32flash',
-      'type': 'static_library',
-      'sources': [
-        '<(externals)/stm32flash-<(stm32flash_commit)/stm32flash/init.c',
-        '<(externals)/stm32flash-<(stm32flash_commit)/stm32flash/parsers/hex.c',
-        '<(externals)/stm32flash-<(stm32flash_commit)/stm32flash/serial_common.c',
-        '<(externals)/stm32flash-<(stm32flash_commit)/stm32flash/serial_platform.c',
-        '<(externals)/stm32flash-<(stm32flash_commit)/stm32flash/utils.c',
-        '<(externals)/stm32flash-<(stm32flash_commit)/stm32flash/stm32.c',
-      ],
-      'cflags': [
-        '-Wno-error',
-      ],
-      'direct_dependent_settings': {
-        'include_dirs': ['<(externals_abs)/stm32flash-<(stm32flash_commit)'],
-      },
-    },
-  ],
-  'includes': [
-    'libgcc-additions/libgcc-additions.gypi',
   ],
 }
diff --git a/aos/build/libgcc-additions/README b/aos/build/libgcc-additions/README
deleted file mode 100644
index 6a9a665..0000000
--- a/aos/build/libgcc-additions/README
+++ /dev/null
@@ -1,26 +0,0 @@
-This directory contains the stuff necessary to deal with the fact that the
-  libgcc.a from the old GCC that the cRIO has doesn't have all of the functions
-  that newer GCCs expect from it.
-
-[extra functions necessary for 4.5.2]
-I generated this diff with `powerpc-wrs-vxworks-nm \
-  gccdist/WindRiver/gnu/3.4.4-vxworks-6.3/x86-win32/lib/gcc/powerpc-wrs-vxworks/3.4.4/libgcc.a \
-  | fgrep '000 T' | awk ' { print $NF }'` (and using the same command with the
-  gccdist.a from the 4.5.2 GCC.
-  I then gave the outputs from both of those to diff and edited out by hand the
-  functions that just moved.
-__powisf2
-__powidf2
-__mulsc3
-__muldc3
-__divsc3
-__divdc3
-__bswapsi2
-__bswapdi2
-__floatundisf
-__floatundidf
-__eprintf
-
-eprintf looks like it's not needed.
-Compiler-RT thinks that bswapsi2 and bswapdi2 are only needed on arm, so it
-  only has arm assembly for them.
diff --git a/aos/build/libgcc-additions/_bswapdi2.o b/aos/build/libgcc-additions/_bswapdi2.o
deleted file mode 100644
index 8bc6f56..0000000
--- a/aos/build/libgcc-additions/_bswapdi2.o
+++ /dev/null
Binary files differ
diff --git a/aos/build/libgcc-additions/_bswapsi2.o b/aos/build/libgcc-additions/_bswapsi2.o
deleted file mode 100644
index 4700ad8..0000000
--- a/aos/build/libgcc-additions/_bswapsi2.o
+++ /dev/null
Binary files differ
diff --git a/aos/build/libgcc-additions/libgcc-additions.gypi b/aos/build/libgcc-additions/libgcc-additions.gypi
deleted file mode 100644
index afa81f6..0000000
--- a/aos/build/libgcc-additions/libgcc-additions.gypi
+++ /dev/null
@@ -1,35 +0,0 @@
-{
-  'targets': [
-    {
-      'target_name': 'libgcc-4.5.2',
-      'type': 'static_library',
-      'variables': {
-        'compiler-rt': '<(externals)/compiler-rt-<(compiler_rt_version)',
-      },
-      'include_dirs': [
-        '<(compiler-rt)/lib',
-      ],
-      'defines': [
-        '_YUGA_BIG_ENDIAN=1',
-        '_YUGA_LITTLE_ENDIAN=0',
-        'UINT64_C(c)=c##ULL',
-      ],
-      'sources': [
-        '<(compiler-rt)/lib/powisf2.c',
-        '<(compiler-rt)/lib/powidf2.c',
-        '<(compiler-rt)/lib/mulsc3.c',
-        '<(compiler-rt)/lib/muldc3.c',
-        '<(compiler-rt)/lib/divsc3.c',
-        '<(compiler-rt)/lib/divdc3.c',
-        #'<(compiler-rt)/lib/bswapsi2.c',
-        '_bswapsi2.o',
-        #'<(compiler-rt)/lib/bswapdi2.c',
-        '_bswapdi2.o',
-        '<(compiler-rt)/lib/floatundisf.c',
-        '<(compiler-rt)/lib/floatundidf.c',
-
-        'libm.c',
-      ],
-    },
-  ],
-}
diff --git a/aos/build/libgcc-additions/libm.c b/aos/build/libgcc-additions/libm.c
deleted file mode 100644
index ce04ce5..0000000
--- a/aos/build/libgcc-additions/libm.c
+++ /dev/null
@@ -1,47 +0,0 @@
-// Some of the Compiler-RT implementations we use want to use functions from
-// libm. However, GCC provides builtins for them, so they don't need to show up
-// in <math.h> Unfortunately, those GCC builtins seem to (sometimes, at least)
-// just emit calls to the functions themselves, so we have our own
-// implementations here. They might not be as fast as they could be, but they
-// are correct as far as I can tell.
-
-#include <stdint.h>
-
-double fmax(double a, double b) {
-  if (__builtin_isnan(a)) return b;
-  if (__builtin_isnan(b)) return a;
-  if (a > b) return a;
-  return b;
-}
-float fmaxf(float a, float b) {
-  if (__builtin_isnan(a)) return b;
-  if (__builtin_isnan(b)) return a;
-  if (a > b) return a;
-  return b;
-}
-
-double scalbn(double x, int exp) {
-  return x * (2 << exp);
-}
-float scalbnf(float x, int exp) {
-  return x * (2 << exp);
-}
-
-float logbf(float x) {
-  union {
-    float f;
-    int32_t d;
-  } converter;
-  converter.f = x;
-  int32_t ix = converter.d & 0x7fffffff;
-  int32_t rix;
-
-  if (ix == 0) {
-    return (float)-1.0 / __builtin_fabsf(x);
-  } else if (ix >= 0x7f800000) {
-    return x * x;
-  } else if (__builtin_expect((rix = ix >> 23) == 0, 0)) {
-    rix -= __builtin_clz(ix) - 9;
-  }
-  return (float)(rix - 127);
-}
diff --git a/aos/build/queues/compiler.rb b/aos/build/queues/compiler.rb
index 864d1c6..52c0005 100644
--- a/aos/build/queues/compiler.rb
+++ b/aos/build/queues/compiler.rb
@@ -60,7 +60,7 @@
 end
 def format_pipeline(output)
   read_in, write_in = IO.pipe()
-  child = Process.spawn('/opt/clang-3.5/bin/clang-format --style=google',
+  child = Process.spawn('/usr/bin/clang-format-3.5 --style=google',
                         {:in=>read_in, write_in=>:close,
                          :out=>output.fileno})
   read_in.close