GN: Add PPC/s390 Linux support

Adding ppc/s390 architecture support to build config and
bootstrap.py to be able build GN binary.

BUG=
R=dpranke@chromium.org, brettw@chromium.org

Review-Url: https://codereview.chromium.org/2417443002
Cr-Original-Commit-Position: refs/heads/master@{#425502}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: fbf038170dc0bd29ead8630013b28c6008047ec1
diff --git a/tools/gn/args.cc b/tools/gn/args.cc
index 9aaafb0..72480f5 100644
--- a/tools/gn/args.cc
+++ b/tools/gn/args.cc
@@ -269,6 +269,8 @@
   static const char kX64[] = "x64";
   static const char kArm[] = "arm";
   static const char kMips[] = "mipsel";
+  static const char kS390X[] = "s390x";
+  static const char kPPC64[] = "ppc64";
   const char* arch = nullptr;
 
   // Set the host CPU architecture based on the underlying OS, not
@@ -282,8 +284,12 @@
     arch = kArm;
   else if (os_arch == "mips")
     arch = kMips;
+  else if (os_arch == "s390x")
+    arch = kS390X;
+  else if (os_arch == "mips")
+    arch = kPPC64;
   else
-    CHECK(false) << "OS architecture not handled.";
+    CHECK(false) << "OS architecture not handled. (" << os_arch << ")";
 
   // Save the OS and architecture as build arguments that are implicitly
   // declared. This is so they can be overridden in a toolchain build args
diff --git a/tools/gn/bootstrap/bootstrap.py b/tools/gn/bootstrap/bootstrap.py
index 9fc1c76..b86757a 100755
--- a/tools/gn/bootstrap/bootstrap.py
+++ b/tools/gn/bootstrap/bootstrap.py
@@ -299,7 +299,7 @@
 
   # //base/allocator/allocator_extension.cc needs this macro defined,
   # otherwise there would be link errors.
-  cflags.extend(['-DNO_TCMALLOC'])
+  cflags.extend(['-DNO_TCMALLOC', '-D__STDC_FORMAT_MACROS'])
 
   if is_posix:
     if options.debug: