--- a/flutter/build/secondary/third_party/libtess2/BUILD.gn
+++ b/flutter/build/secondary/third_party/libtess2/BUILD.gn
@@ -1,31 +1,9 @@
-# Copyright 2013 The Flutter Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-source_root = "//flutter/third_party/libtess2"
+# Unbundled system libtess2
+config("libtess2_config") {
+  include_dirs = [ "/usr/include" ]
+  libs = [ "tess2" ]
+}
 
 source_set("libtess2") {
-  public = [ "$source_root/Include/tesselator.h" ]
-
-  include_dirs = [ "$source_root/Include/" ]
-
-  configs -= [ "//build/config/compiler:chromium_code" ]
-  configs += [ "//build/config/compiler:no_chromium_code" ]
-
-  sources = [
-    "$source_root/Source/bucketalloc.c",
-    "$source_root/Source/bucketalloc.h",
-    "$source_root/Source/dict.c",
-    "$source_root/Source/dict.h",
-    "$source_root/Source/geom.c",
-    "$source_root/Source/geom.h",
-    "$source_root/Source/mesh.c",
-    "$source_root/Source/mesh.h",
-    "$source_root/Source/priorityq.c",
-    "$source_root/Source/priorityq.h",
-    "$source_root/Source/sweep.c",
-    "$source_root/Source/sweep.h",
-    "$source_root/Source/tess.c",
-    "$source_root/Source/tess.h",
-  ]
+  public_configs = [ ":libtess2_config" ]
 }
--- a/flutter/impeller/renderer/backend/gles/BUILD.gn
+++ b/flutter/impeller/renderer/backend/gles/BUILD.gn
@@ -10,3 +10,3 @@
   # because they are there.
-  include_dirs = [ "//flutter/third_party/angle/include" ]
+  include_dirs = [ "/usr/include" ]
 }
@@ -100,3 +100,3 @@
     sources += [
-      "//flutter/third_party/angle/include/GLES2/gl2ext.h",
+      
 
@@ -104,3 +104,3 @@
       # some GLES3 features if the driver supports them.
-      "//flutter/third_party/angle/include/GLES3/gl3.h",
+      
     ]
--- a/flutter/impeller/tessellator/tessellator_libtess.cc
+++ b/flutter/impeller/tessellator/tessellator_libtess.cc
@@ -5,7 +5,7 @@
 #include "impeller/tessellator/tessellator_libtess.h"
 
 #include "impeller/tessellator/path_tessellator.h"
-#include "third_party/libtess2/Include/tesselator.h"
+#include <tesselator.h>
 
 namespace impeller {
 
--- a/flutter/shell/testing/BUILD.gn
+++ b/flutter/shell/testing/BUILD.gn
@@ -11,9 +11,7 @@
 
 group("testing") {
   public_deps = [ ":flutter_tester" ]
-  if (current_toolchain == host_toolchain) {
-    public_deps += [ ":flutter_tester_opengles" ]
-  }
+  # opengles tester omitted without angle
 }
 
 shell_gpu_configuration("tester_gpu_configuration") {
@@ -111,7 +109,7 @@
   }
 }
 
-if (current_toolchain == host_toolchain) {
+if (enable_unittests && current_toolchain == host_toolchain) {
   tester("flutter_tester_opengles") {
     output_name = "flutter_tester_opengles"
 
--- a/flutter/testing/BUILD.gn
+++ b/flutter/testing/BUILD.gn
@@ -233,7 +233,7 @@
   }
 }
 
-if (current_toolchain == host_toolchain) {
+if (enable_unittests && current_toolchain == host_toolchain) {
   source_set("test_swangle_utils") {
     sources = [
       "test_swangle_utils.cc",
--- /dev/null
+++ b/flutter/third_party/freetype2/BUILD.gn
@@ -0,0 +1,9 @@
+# Unbundled system freetype
+config("freetype_config") {
+  include_dirs = [ "/usr/include/freetype2" ]
+  libs = [ "freetype" ]
+}
+
+target(default_library_type, "freetype2") {
+  public_configs = [ ":freetype_config" ]
+}
--- a/flutter/third_party/libjpeg-turbo/BUILD.gn
+++ b/flutter/third_party/libjpeg-turbo/BUILD.gn
@@ -1,185 +1,8 @@
-# Copyright 2013 The Flutter Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-_source_location = "//flutter/third_party/libjpeg-turbo/src"
-
-if (current_cpu == "arm") {
-  import("//build/config/arm.gni")
-}
-
-if (is_fuchsia) {
-  import("//flutter/tools/fuchsia/gn-sdk/src/gn_configs.gni")
-}
-
-if ((current_cpu == "x86" || current_cpu == "x64") && is_fuchsia &&
-    !using_fuchsia_sdk) {
-  import("//third_party/yasm/yasm_assemble.gni")
-
-  yasm_assemble("simd_asm") {
-    defines = []
-
-    if (current_cpu == "x86") {
-      sources = [
-        "$_source_location/simd/jccolor-mmx.asm",
-        "$_source_location/simd/jccolor-sse2.asm",
-        "$_source_location/simd/jcgray-mmx.asm",
-        "$_source_location/simd/jcgray-sse2.asm",
-        "$_source_location/simd/jchuff-sse2.asm",
-        "$_source_location/simd/jcsample-mmx.asm",
-        "$_source_location/simd/jcsample-sse2.asm",
-        "$_source_location/simd/jdcolor-mmx.asm",
-        "$_source_location/simd/jdcolor-sse2.asm",
-        "$_source_location/simd/jdmerge-mmx.asm",
-        "$_source_location/simd/jdmerge-sse2.asm",
-        "$_source_location/simd/jdsample-mmx.asm",
-        "$_source_location/simd/jdsample-sse2.asm",
-        "$_source_location/simd/jfdctflt-3dn.asm",
-        "$_source_location/simd/jfdctflt-sse.asm",
-        "$_source_location/simd/jfdctfst-mmx.asm",
-        "$_source_location/simd/jfdctfst-sse2.asm",
-        "$_source_location/simd/jfdctint-mmx.asm",
-        "$_source_location/simd/jfdctint-sse2.asm",
-        "$_source_location/simd/jidctflt-3dn.asm",
-        "$_source_location/simd/jidctflt-sse.asm",
-        "$_source_location/simd/jidctflt-sse2.asm",
-        "$_source_location/simd/jidctfst-mmx.asm",
-        "$_source_location/simd/jidctfst-sse2.asm",
-        "$_source_location/simd/jidctint-mmx.asm",
-        "$_source_location/simd/jidctint-sse2.asm",
-        "$_source_location/simd/jidctred-mmx.asm",
-        "$_source_location/simd/jidctred-sse2.asm",
-        "$_source_location/simd/jquant-3dn.asm",
-        "$_source_location/simd/jquant-mmx.asm",
-        "$_source_location/simd/jquant-sse.asm",
-        "$_source_location/simd/jquantf-sse2.asm",
-        "$_source_location/simd/jquanti-sse2.asm",
-        "$_source_location/simd/jsimdcpu.asm",
-      ]
-
-      defines += [
-        "__x86__",
-        "PIC",
-      ]
-    } else if (current_cpu == "x64") {
-      sources = [
-        "$_source_location/simd/jccolor-sse2-64.asm",
-        "$_source_location/simd/jcgray-sse2-64.asm",
-        "$_source_location/simd/jchuff-sse2-64.asm",
-        "$_source_location/simd/jcsample-sse2-64.asm",
-        "$_source_location/simd/jdcolor-sse2-64.asm",
-        "$_source_location/simd/jdmerge-sse2-64.asm",
-        "$_source_location/simd/jdsample-sse2-64.asm",
-        "$_source_location/simd/jfdctflt-sse-64.asm",
-        "$_source_location/simd/jfdctfst-sse2-64.asm",
-        "$_source_location/simd/jfdctint-sse2-64.asm",
-        "$_source_location/simd/jidctflt-sse2-64.asm",
-        "$_source_location/simd/jidctfst-sse2-64.asm",
-        "$_source_location/simd/jidctint-sse2-64.asm",
-        "$_source_location/simd/jidctred-sse2-64.asm",
-        "$_source_location/simd/jquantf-sse2-64.asm",
-        "$_source_location/simd/jquanti-sse2-64.asm",
-      ]
-
-      defines += [
-        "__x86_64__",
-        "PIC",
-      ]
-    }
-
-    defines += [ "ELF" ]
-  }
-}
-
+# Unbundled system libjpeg-turbo
 config("libjpeg_config") {
-  include_dirs = [ _source_location ]
-}
-
-static_library("simd") {
-  configs += [ ":libjpeg_config" ]
-
-  if (!is_fuchsia || using_fuchsia_sdk) {
-    sources = [ "$_source_location/jsimd_none.c" ]
-  } else if (current_cpu == "x86") {
-    deps = [ ":simd_asm" ]
-
-    sources = [ "$_source_location/simd/jsimd_i386.c" ]
-  } else if (current_cpu == "x64") {
-    deps = [ ":simd_asm" ]
-
-    sources = [ "$_source_location/simd/jsimd_x86_64.c" ]
-  } else if (current_cpu == "arm" && arm_version >= 7 &&
-             (arm_use_neon || arm_optionally_use_neon)) {
-    sources = [
-      "$_source_location/simd/jsimd_arm.c",
-      "$_source_location/simd/jsimd_arm_neon.S",
-    ]
-  } else if (current_cpu == "arm64") {
-    sources = [
-      "$_source_location/simd/jsimd_arm64.c",
-      "$_source_location/simd/jsimd_arm64_neon.S",
-    ]
-  } else {
-    sources = [ "$_source_location/jsimd_none.c" ]
-  }
+  libs = [ "jpeg" ]
 }
 
 static_library("libjpeg") {
-  sources = [
-    "$_source_location/jcapimin.c",
-    "$_source_location/jcapistd.c",
-    "$_source_location/jccoefct.c",
-    "$_source_location/jccolor.c",
-    "$_source_location/jcdctmgr.c",
-    "$_source_location/jchuff.c",
-    "$_source_location/jcinit.c",
-    "$_source_location/jcmainct.c",
-    "$_source_location/jcmarker.c",
-    "$_source_location/jcmaster.c",
-    "$_source_location/jcomapi.c",
-    "$_source_location/jcparam.c",
-    "$_source_location/jcphuff.c",
-    "$_source_location/jcprepct.c",
-    "$_source_location/jcsample.c",
-    "$_source_location/jdapimin.c",
-    "$_source_location/jdapistd.c",
-    "$_source_location/jdatadst.c",
-    "$_source_location/jdatasrc.c",
-    "$_source_location/jdcoefct.c",
-    "$_source_location/jdcolor.c",
-    "$_source_location/jddctmgr.c",
-    "$_source_location/jdhuff.c",
-    "$_source_location/jdinput.c",
-    "$_source_location/jdmainct.c",
-    "$_source_location/jdmarker.c",
-    "$_source_location/jdmaster.c",
-    "$_source_location/jdmerge.c",
-    "$_source_location/jdphuff.c",
-    "$_source_location/jdpostct.c",
-    "$_source_location/jdsample.c",
-    "$_source_location/jerror.c",
-    "$_source_location/jfdctflt.c",
-    "$_source_location/jfdctfst.c",
-    "$_source_location/jfdctint.c",
-    "$_source_location/jidctflt.c",
-    "$_source_location/jidctfst.c",
-    "$_source_location/jidctint.c",
-    "$_source_location/jidctred.c",
-    "$_source_location/jmemmgr.c",
-    "$_source_location/jmemnobs.c",
-    "$_source_location/jquant1.c",
-    "$_source_location/jquant2.c",
-    "$_source_location/jutils.c",
-  ]
-
-  defines = [
-    "WITH_SIMD",
-    "NO_GETENV",
-  ]
-
-  configs += [ ":libjpeg_config" ]
-
   public_configs = [ ":libjpeg_config" ]
-
-  deps = [ ":simd" ]
 }
--- /dev/null
+++ b/flutter/third_party/libpng/BUILD.gn
@@ -0,0 +1,8 @@
+# Unbundled system libpng
+config("libpng_config") {
+  libs = [ "png" ]
+}
+
+source_set("libpng") {
+  public_configs = [ ":libpng_config" ]
+}
--- /dev/null
+++ b/flutter/build/secondary/flutter/third_party/rapidjson/BUILD.gn
@@ -0,0 +1,15 @@
+# Unbundled system rapidjson
+config("rapidjson_config") {
+  include_dirs = [ "/usr/include" ]
+  defines = [
+    "RAPIDJSON_HAS_STDSTRING",
+    "RAPIDJSON_HAS_CXX11_RANGE_FOR",
+    "RAPIDJSON_HAS_CXX11_RVALUE_REFS",
+    "RAPIDJSON_HAS_CXX11_TYPETRAITS",
+    "RAPIDJSON_HAS_CXX11_NOEXCEPT",
+  ]
+}
+
+source_set("rapidjson") {
+  public_configs = [ ":rapidjson_config" ]
+}
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -485,13 +485,16 @@
 config("cxx_disable_modules") {
   disable_modules_flags = [
     "-fno-modules",
-
+  ]
+  if (is_clang) {
     # Some Clang versions do not disable ObjC modules (as tested by
     # __has_feature(objc_modules)) when just -fno-modules is present.
-    "-Xclang",
-    "-fno-cxx-modules",
-  ]
-  cflags_c = disable_modules_flags
+    disable_modules_flags += [
+      "-Xclang",
+      "-fno-cxx-modules",
+    ]
+    cflags_c = disable_modules_flags
+  }
   cflags_cc = disable_modules_flags
   cflags_objc = disable_modules_flags
   cflags_objcc = disable_modules_flags
@@ -667,7 +670,7 @@
   # We compile our own libc++ on all Linux targets except i386 (for
   # gen_snapshot) where this is not supported.
   if (is_linux) {
-    if (!use_flutter_cxx) {
+    if (!use_flutter_cxx && is_clang) {
       cflags_cc += [ "-stdlib=libstdc++" ]
       ldflags += [ "-stdlib=libstdc++" ]
       libs += [ "gcc" ]
