msan: build expat from source

This should let us test it on the MSAN bot.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1674053002

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-MSAN-Trybot

Review URL: https://codereview.chromium.org/1674053002
diff --git a/DEPS b/DEPS
index 80c6b18..de69d8c 100644
--- a/DEPS
+++ b/DEPS
@@ -29,7 +29,7 @@
   "third_party/externals/yasm/source/patched-yasm/" : "https://chromium.googlesource.com/chromium/deps/yasm/patched-yasm.git@4671120cd8558ce62ee8672ebf3eb6f5216f909b",
   "third_party/externals/yasm/binaries"             : "https://chromium.googlesource.com/chromium/deps/yasm/binaries.git@52f9b3f4b0aa06da24ef8b123058bb61ee468881",
 
-  "platform_tools/android/third_party/externals/expat" : "https://android.googlesource.com/platform/external/expat.git@android-5.1.0_r3",
+  "third_party/externals/expat" : "https://android.googlesource.com/platform/external/expat.git@android-5.1.0_r3",
 
   "platform_tools/chromeos/toolchain/src/third_party/chromite": "https://chromium.googlesource.com/chromiumos/chromite.git@d6a4c7e0ee4d53ddc5238dbddfc0417796a70e54",
   "platform_tools/chromeos/toolchain/src/third_party/pyelftools": "https://chromium.googlesource.com/chromiumos/third_party/pyelftools.git@bdc1d380acd88d4bfaf47265008091483b0d614e",
diff --git a/gyp/expat.gyp b/gyp/expat.gyp
new file mode 100644
index 0000000..9e18383
--- /dev/null
+++ b/gyp/expat.gyp
@@ -0,0 +1,25 @@
+# Copyright 2016 Google Inc.
+#
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# Build expat from source.
+# Used on Linux bots for testing the Android FontMgr xml parsing.
+# This is mostly important for the MSAN bot's instrumentation.
+
+{
+    'targets': [{
+        'target_name': 'expat',
+        'type': 'static_library',
+        'cflags': [ '-w' ],
+        'defines': [ 'HAVE_MEMMOVE' ],
+        'sources': [
+            '../third_party/externals/expat/lib/xmlparse.c',
+            '../third_party/externals/expat/lib/xmlrole.c',
+            '../third_party/externals/expat/lib/xmltok.c',
+        ],
+        'direct_dependent_settings': {
+            'include_dirs': [ '../third_party/externals/expat/lib' ],
+        },
+    }]
+}
diff --git a/gyp/ports.gyp b/gyp/ports.gyp
index 0c2d099..2c41ecf 100644
--- a/gyp/ports.gyp
+++ b/gyp/ports.gyp
@@ -88,17 +88,11 @@
             'freetype.gyp:freetype',
           ],
           'conditions': [
-            [ 'skia_os == "android"', {
-              'dependencies': [
-                 'android_deps.gyp:expat',
-              ],
+            [ 'skia_android_framework', {
+              'link_settings': { 'libraries': [ '-lexpat' ] },
             }, {
-              'link_settings': {
-                'libraries': [
-                  '-ldl',
-                  '-lexpat',
-                ],
-              },
+              'link_settings': { 'libraries': [ '-ldl' ] },
+              'dependencies': [ 'expat.gyp:expat' ],
             }],
             [ 'skia_embedded_fonts', {
               'variables': {
diff --git a/platform_tools/android/gyp/dependencies.gypi b/platform_tools/android/gyp/dependencies.gypi
index eb34f10..49937b0 100644
--- a/platform_tools/android/gyp/dependencies.gypi
+++ b/platform_tools/android/gyp/dependencies.gypi
@@ -33,7 +33,7 @@
       'cflags': [
         '-w',
       ],
-    }, 
+    },
     {
       'target_name': 'cpu_features',
       'type': 'static_library',
@@ -64,31 +64,6 @@
       },
     },
     {
-      'target_name': 'expat',
-      'type': 'static_library',
-      'sources': [
-        '../third_party/externals/expat/lib/xmlparse.c',
-        '../third_party/externals/expat/lib/xmlrole.c',
-        '../third_party/externals/expat/lib/xmltok.c',
-      ],
-      'include_dirs': [
-        '../third_party/externals/expat',
-        '../third_party/externals/expat/lib',
-      ],
-      'cflags': [
-        '-w',
-        '-fexceptions',
-      ],
-      'defines': [
-        'HAVE_EXPAT_CONFIG_H',
-      ],
-      'direct_dependent_settings': {
-        'include_dirs': [
-          '../third_party/externals/expat/lib',  # For expat.h
-        ],
-      }
-    },
-    {
       # This target is a dependency for all console-type Skia applications which
       # will run on Android.  Since Android requires us to load native code in
       # shared libraries, we need a common entry point to wrap around main().
diff --git a/tools/dm_flags.json b/tools/dm_flags.json
index 8f3e7dc..251a952 100644
--- a/tools/dm_flags.json
+++ b/tools/dm_flags.json
@@ -1975,9 +1975,7 @@
     "_", 
     "image", 
     "_", 
-    ".bmp", 
-    "--match", 
-    "~FontMgrAndroidParser"
+    ".bmp"
   ], 
   "Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-TSAN": [
     "--pre_log", 
diff --git a/tools/dm_flags.py b/tools/dm_flags.py
index b37d0dd..5fd8a2b 100755
--- a/tools/dm_flags.py
+++ b/tools/dm_flags.py
@@ -195,8 +195,6 @@
     blacklist.extend(('_ image _ .png').split(' '))  # I8 .png color tables
     blacklist.extend(('_ image _ .bmp').split(' '))  # I8 .bmp color tables
 
-    match.append('~FontMgrAndroidParser')  # expat currently uninstrumented.
-
   if blacklist:
     args.append('--blacklist')
     args.extend(blacklist)