[build] Move to Jessie sysroots from Wheezy sysroots.

Wheezy is not supported anymore (EOL May 2018) and these sysroots are
really outdated, which introduces build problems whenever we try to
use recent enough features and header files.

We are already using Jessie to build Dart SDK distributions and in some cases we use
Jessie to build binaries for testing (e.g. when building on ARM64).

This CL makes it uniform.

Change-Id: Id4d165a41aa37118f5e49edb2122d905219cd377
Reviewed-on: https://dart-review.googlesource.com/c/81409
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
diff --git a/build/.gitignore b/build/.gitignore
index 0c6f306..869cdb4 100644
--- a/build/.gitignore
+++ b/build/.gitignore
@@ -4,7 +4,5 @@
 # Pulled Debian wheezy sysroots
 linux/debian_jessie_arm-sysroot
 linux/debian_jessie_arm64-sysroot
-linux/debian_wheezy_amd64-sysroot
 linux/debian_jessie_amd64-sysroot
-linux/debian_wheezy_arm-sysroot
-linux/debian_wheezy_i386-sysroot
+linux/debian_jessie_i386-sysroot
diff --git a/build/config/linux/BUILD.gn b/build/config/linux/BUILD.gn
index 215025b..62f7524 100644
--- a/build/config/linux/BUILD.gn
+++ b/build/config/linux/BUILD.gn
@@ -18,12 +18,12 @@
                              ],
                              "value") ]
 
-    # When using the pulled wheezy sysroot with gcc, we have to specify these
+    # When using the pulled Debian sysroot with gcc, we have to specify these
     # excplicitly.
-    if (dart_use_wheezy_sysroot && !is_clang) {
+    if (dart_use_debian_sysroot && !is_clang) {
       cflags += [
-        "-I=/usr/include/c++/4.6",
-        "-I=/usr/include/c++/4.6/i486-linux-gnu",
+        "-I=/usr/include/c++/4.8",
+        "-I=/usr/include/c++/4.8/i486-linux-gnu",
       ]
     }
   }
diff --git a/build/config/sysroot.gni b/build/config/sysroot.gni
index b1acdf6..a4364ac 100644
--- a/build/config/sysroot.gni
+++ b/build/config/sysroot.gni
@@ -10,25 +10,21 @@
   # the target toolchain.
   target_sysroot = ""
 
-  # Whether the Debian wheezy sysroot should be used.
-  dart_use_wheezy_sysroot = false
+  # Whether the Debian sysroot should be used.
+  dart_use_debian_sysroot = false
 }
 
-if (is_linux && dart_use_wheezy_sysroot) {
+if (is_linux && dart_use_debian_sysroot) {
   if (current_cpu == "x86") {
-    target_sysroot = rebase_path("//build/linux/debian_wheezy_i386-sysroot", root_build_dir)
+    target_sysroot = rebase_path("//build/linux/debian_jessie_i386-sysroot", root_build_dir)
   } else if (current_cpu == "x64") {
-    if (is_asan || is_lsan || is_msan || is_tsan) {
-      target_sysroot = rebase_path("//build/linux/debian_jessie_amd64-sysroot", root_build_dir)
-    } else {
-      target_sysroot = rebase_path("//build/linux/debian_wheezy_amd64-sysroot", root_build_dir)
-    }
+    target_sysroot = rebase_path("//build/linux/debian_jessie_amd64-sysroot", root_build_dir)
   } else if (current_cpu == "arm") {
-    target_sysroot = rebase_path("//build/linux/debian_wheezy_arm-sysroot", root_build_dir)
+    target_sysroot = rebase_path("//build/linux/debian_jessie_arm-sysroot", root_build_dir)
   } else if (current_cpu == "arm64") {
     target_sysroot = rebase_path("//build/linux/debian_jessie_arm64-sysroot", root_build_dir)
   } else {
-    print("There is no Debian wheezy sysroot present for $current_cpu")
+    print("There is no Debian sysroot present for $current_cpu")
     assert(false)
   }
 }
diff --git a/build/linux/sysroot_scripts/install-sysroot.py b/build/linux/sysroot_scripts/install-sysroot.py
index 88bdd62..4500023 100755
--- a/build/linux/sysroot_scripts/install-sysroot.py
+++ b/build/linux/sysroot_scripts/install-sysroot.py
@@ -95,16 +95,15 @@
 
 def InstallDefaultSysrootForArch(target_arch):
   if target_arch == 'amd64':
-    InstallSysroot('Wheezy', 'amd64')
     InstallSysroot('Jessie', 'amd64')
   elif target_arch == 'arm':
-    InstallSysroot('Wheezy', 'arm')
+    InstallSysroot('Jessie', 'arm')
   elif target_arch == 'arm64':
     InstallSysroot('Jessie', 'arm64')
   elif target_arch == 'i386':
-    InstallSysroot('Wheezy', 'i386')
+    InstallSysroot('Jessie', 'i386')
   elif target_arch == 'mips':
-    InstallSysroot('Wheezy', 'mips')
+    InstallSysroot('Jessie', 'mips')
   else:
     raise Error('Unknown architecture: %s' % target_arch)
 
diff --git a/tools/gn.py b/tools/gn.py
index 50740ef..9b34862 100755
--- a/tools/gn.py
+++ b/tools/gn.py
@@ -248,7 +248,7 @@
 
   # Setup the user-defined sysroot.
   if UseSysroot(args, gn_args):
-    gn_args['dart_use_wheezy_sysroot'] = True
+    gn_args['dart_use_debian_sysroot'] = True
   else:
     sysroot = TargetSysroot(args)
     if sysroot:
diff --git a/tools/set_ia32_sysroot.sh b/tools/set_ia32_sysroot.sh
index c7156ce..1944330 100755
--- a/tools/set_ia32_sysroot.sh
+++ b/tools/set_ia32_sysroot.sh
@@ -4,16 +4,16 @@
 # for details. All rights reserved. Use of this source code is governed by a
 # BSD-style license that can be found in the LICENSE file.
 
-# Sets the compiler environment variables to use a downloaded wheezy sysroot
+# Sets the compiler environment variables to use a downloaded Debian sysroot
 # when building Dart with architecture ia32.
-# Run this in the same working directory that you have run 
+# Run this in the same working directory that you have run
 # sdk/tools/download_chromium_sysroot.sh in.
 # Must be sourced, not run in a subshell, to modify the environment.
 # Run with the command ". sdk/tools/set_ia32_sysroot.sh"
 # Only tested and used on Ubuntu trusty linux. Used to build dart with
 # no requirement for glibc greater than version 2.14.
 
-export CXXFLAGS="--sysroot=$PWD/build/linux/debian_wheezy_i386-sysroot -I=/usr/include/c++/4.6 -I=/usr/include/c++/4.6/i486-linux-gnu"
+export CXXFLAGS="--sysroot=$PWD/build/linux/debian_jessie_i386-sysroot -I=/usr/include/c++/4.8 -I=/usr/include/c++/4.8/i486-linux-gnu"
 
-export LDFLAGS=--sysroot=$PWD/build/linux/debian_wheezy_i386-sysroot
-export CFLAGS=--sysroot=$PWD/build/linux/debian_wheezy_i386-sysroot
+export LDFLAGS=--sysroot=$PWD/build/linux/debian_jessie_i386-sysroot
+export CFLAGS=--sysroot=$PWD/build/linux/debian_jessie_i386-sysroot
diff --git a/tools/set_x64_sysroot.sh b/tools/set_x64_sysroot.sh
index bc28961..9c199ff 100755
--- a/tools/set_x64_sysroot.sh
+++ b/tools/set_x64_sysroot.sh
@@ -4,16 +4,16 @@
 # for details. All rights reserved. Use of this source code is governed by a
 # BSD-style license that can be found in the LICENSE file.
 
-# Sets the compiler environment variables to use a downloaded wheezy sysroot
+# Sets the compiler environment variables to use a downloaded Debian sysroot
 # when building Dart with architecture x64.
-# Run this in the same working directory that you have run 
+# Run this in the same working directory that you have run
 # sdk/tools/download_chromium_sysroot.sh in.
 # Must be sourced, not run in a subshell, to modify the environment.
 # Run with the command ". sdk/tools/set_x64_sysroot.sh"
 # Only tested and used on Ubuntu trusty linux. Used to build dart with
 # no requirement for glibc greater than version 2.14.
 
-export CXXFLAGS="--sysroot=$PWD/build/linux/debian_wheezy_amd64-sysroot -I=/usr/include/c++/4.6 -I=/usr/include/c++/4.6/x86_64-linux-gnu"
+export CXXFLAGS="--sysroot=$PWD/build/linux/debian_jessie_amd64-sysroot -I=/usr/include/c++/4.8 -I=/usr/include/c++/4.8/x86_64-linux-gnu"
 
-export LDFLAGS=--sysroot=$PWD/build/linux/debian_wheezy_amd64-sysroot
-export CFLAGS=--sysroot=$PWD/build/linux/debian_wheezy_amd64-sysroot
+export LDFLAGS=--sysroot=$PWD/build/linux/debian_jessie_amd64-sysroot
+export CFLAGS=--sysroot=$PWD/build/linux/debian_jessie_amd64-sysroot