clean up the distinction between FRC and non-FRC platforms

This also means binary_log_writer will choose the correct directory
under clang_frc, which it didn't before.

Change-Id: I894cf880253a0fe98d155c0c14d431fe4048dc46
diff --git a/aos/build/aos.gypi b/aos/build/aos.gypi
index 22e96a0..e049182 100644
--- a/aos/build/aos.gypi
+++ b/aos/build/aos.gypi
@@ -24,13 +24,13 @@
     ],
   },
   'conditions': [
-    ['PLATFORM=="linux-arm-gcc_frc"', {
+    ['PLATFORM=="linux-arm_frc-gcc"', {
         '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-clang_frc"', {
+    ], ['PLATFORM=="linux-arm_frc-clang"', {
         'variables': {
           'arm-clang-symlinks': '<!(realpath -s <(AOS)/build/arm-clang-symlinks)',
           'arm-clang-sysroot': '<(arm-clang-symlinks)/sysroot',
@@ -140,6 +140,7 @@
       '__STDC_CONSTANT_MACROS',
       '__STDC_LIMIT_MACROS',
       'AOS_COMPILER_<!(echo <(FULL_COMPILER) | sed \'s/\./_/g\')',
+      'AOS_ARCHITECTURE_<(ARCHITECTURE)',
       '_FILE_OFFSET_BITS=64',
     ],
     'ldflags': [
diff --git a/aos/build/build.py b/aos/build/build.py
index 21e0379..6ac9694 100755
--- a/aos/build/build.py
+++ b/aos/build/build.py
@@ -436,7 +436,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().endswith('_frc'):
+      if self.architecture().endswith('_frc'):
         device = 'roboRIO'
       else:
         device = 'prime'
@@ -511,8 +511,8 @@
 
       return r
 
-  ARCHITECTURES = ('arm', 'amd64')
-  COMPILERS = ('clang', 'gcc_frc', 'clang_frc')
+  ARCHITECTURES = ('arm_frc', 'amd64')
+  COMPILERS = ('clang', 'gcc')
   SANITIZERS = ('address', 'undefined', 'integer', 'memory', 'thread', 'none')
   SANITIZER_TEST_WARNINGS = {
       'memory': (True,
@@ -529,8 +529,7 @@
     for architecture in PrimeProcessor.ARCHITECTURES:
       for compiler in PrimeProcessor.COMPILERS:
         for debug in [True, False]:
-          if ((architecture == 'arm' and not compiler.endswith('_frc')) or
-              (architecture == 'amd64' and compiler.endswith('_frc'))):
+          if architecture == 'amd64' and compiler == 'gcc':
             # We don't have a compiler to use here.
             continue
           platforms.append(
@@ -556,8 +555,8 @@
         if warning[0]:
           default_platforms -= self.select_platforms(sanitizer=sanitizer)
     elif is_deploy:
-      default_platforms = self.select_platforms(architecture='arm',
-                                                compiler='gcc_frc',
+      default_platforms = self.select_platforms(architecture='arm_frc',
+                                                compiler='gcc',
                                                 debug=False)
     else:
       default_platforms = self.select_platforms(debug=False)
@@ -578,13 +577,8 @@
       if platforms & pie_sanitizers:
         to_download.add(architecture + '-fPIE')
 
-      frc_platforms = self.select_platforms(architecture=architecture,
-                                            compiler='gcc_frc')
-      if platforms & frc_platforms:
-        to_download.add(architecture + '_frc')
-
       if platforms & (self.select_platforms(architecture=architecture) -
-                      pie_sanitizers - frc_platforms):
+                      pie_sanitizers):
         to_download.add(architecture)
 
     for download_target in to_download:
@@ -651,14 +645,13 @@
     packages.add('clang-3.5')
     packages.add('clang-format-3.5')
     for platform in platforms:
-      if (platform.compiler() == 'clang' or platform.compiler() == 'gcc_4.8' or
-          platform.compiler() == 'clang_frc'):
+      if platform.compiler() == 'clang' or platform.compiler() == 'gcc_4.8':
         packages.add('clang-3.5')
       if platform.compiler() == 'gcc_4.8':
         packages.add('libcloog-isl3:amd64')
       if is_deploy:
         packages.add('openssh-client')
-      elif platform.compiler() == 'gcc_frc' or platform.compiler() == 'clang_frc':
+      elif platform.architecture == 'arm_frc':
         packages.add('gcc-4.9-arm-frc-linux-gnueabi')
         packages.add('g++-4.9-arm-frc-linux-gnueabi')
 
@@ -933,7 +926,7 @@
              '-DSANITIZER=%s' % platform.sanitizer(),
              '-DEXTERNALS_EXTRA=%s' %
              ('-fPIE' if platform.sanitizer() in PrimeProcessor.PIE_SANITIZERS
-              else ('_frc' if platform.compiler().endswith('_frc') else ''))) +
+              else '')) +
             processor.extra_gyp_flags() + (args.main_gyp,),
             stdin=subprocess.PIPE)
         gyp.communicate(("""
diff --git a/aos/linux_code/logging/binary_log_writer.cc b/aos/linux_code/logging/binary_log_writer.cc
index 9943e7b..dbe61e0 100644
--- a/aos/linux_code/logging/binary_log_writer.cc
+++ b/aos/linux_code/logging/binary_log_writer.cc
@@ -108,7 +108,7 @@
          fileindex, directory, previous);
 }
 
-#ifdef AOS_COMPILER_gcc_frc
+#ifdef AOS_ARCHITECTURE_arm_frc
 bool FoundThumbDrive(const char *path) {
   FILE *mnt_fp = setmntent("/etc/mtab", "r");
   if (mnt_fp == nullptr) {
@@ -148,7 +148,7 @@
 int BinaryLogReaderMain() {
   InitNRT();
 
-#ifdef AOS_COMPILER_gcc_frc
+#ifdef AOS_ARCHITECTURE_arm_frc
   char folder[128];
 
   {