Merge tools/gyp from https://chromium.googlesource.com/external/gyp.git at 63a1f78eb0ec6c4ddcc23e920230bdb0b14f7855

This commit was generated by merge_from_chromium.py.

Change-Id: Icf1d2b6edb94073be5324995d265507a1a2e3967
diff --git a/buildbot/buildbot_run.py b/buildbot/buildbot_run.py
index cc3a25a..b20a424 100755
--- a/buildbot/buildbot_run.py
+++ b/buildbot/buildbot_run.py
@@ -73,6 +73,9 @@
   CallSubProcess( ['make', 'cmake'], cwd=CMAKE_DIR)
 
 
+_ANDROID_SETUP = 'source build/envsetup.sh && lunch full-eng'
+
+
 def PrepareAndroidTree():
   """Prepare an Android tree to run 'android' format tests."""
   if os.environ['BUILDBOT_CLOBBER'] == '1':
@@ -103,10 +106,31 @@
   print '@@@BUILD_STEP Build Android@@@'
   CallSubProcess(
       ['/bin/bash',
-       '-c', 'source build/envsetup.sh && lunch full-eng && make -j4'],
+       '-c', '%s && make -j4' % _ANDROID_SETUP],
       cwd=ANDROID_DIR)
 
 
+def StartAndroidEmulator():
+  """Start an android emulator from the built android tree."""
+  print '@@@BUILD_STEP Start Android emulator@@@'
+  android_host_bin = '$ANDROID_HOST_OUT/bin'
+  subprocess.Popen(
+      ['/bin/bash', '-c',
+       '%s && %s/emulator -no-window' % (_ANDROID_SETUP, android_host_bin)],
+      cwd=ANDROID_DIR)
+  CallSubProcess(
+      ['/bin/bash', '-c',
+       '%s && %s/adb wait-for-device' % (_ANDROID_SETUP, android_host_bin)],
+      cwd=ANDROID_DIR)
+
+
+def StopAndroidEmulator():
+  """Stop all android emulators."""
+  print '@@@BUILD_STEP Stop Android emulator@@@'
+  # If this fails, it's because there is no emulator running.
+  subprocess.call(['pkill', 'emulator.*'])
+
+
 def GypTestFormat(title, format=None, msvs_version=None, tests=[]):
   """Run the gyp tests for a given format, emitting annotator tags.
 
@@ -137,8 +161,7 @@
     # using the 'android' backend, so this is done in a single shell.
     retcode = subprocess.call(
         ['/bin/bash',
-         '-c', 'source build/envsetup.sh && lunch full-eng && cd %s && %s'
-         % (ROOT_DIR, command)],
+         '-c', '%s && cd %s && %s' % (_ANDROID_SETUP, ROOT_DIR, command)],
         cwd=ANDROID_DIR, env=env)
   else:
     retcode = subprocess.call(command, cwd=ROOT_DIR, env=env, shell=True)
@@ -160,7 +183,11 @@
   # The Android gyp bot runs on linux so this must be tested first.
   if os.environ['BUILDBOT_BUILDERNAME'] == 'gyp-android':
     PrepareAndroidTree()
-    retcode += GypTestFormat('android')
+    StartAndroidEmulator()
+    try:
+      retcode += GypTestFormat('android')
+    finally:
+      StopAndroidEmulator()
   elif sys.platform.startswith('linux'):
     retcode += GypTestFormat('ninja')
     retcode += GypTestFormat('make')
diff --git a/pylib/gyp/generator/analyzer.py b/pylib/gyp/generator/analyzer.py
new file mode 100644
index 0000000..007d17d
--- /dev/null
+++ b/pylib/gyp/generator/analyzer.py
@@ -0,0 +1,192 @@
+# Copyright (c) 2014 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""
+This script is intended for use as a GYP_GENERATOR. It takes as input (by way of
+the generator flag file_path) the list of relative file paths to consider. If
+any target has at least one of the paths as a source (or input to an action or
+rule) then 'Found dependency' is output, otherwise 'No dependencies' is output.
+"""
+
+import gyp.common
+import gyp.ninja_syntax as ninja_syntax
+import os
+import posixpath
+
+generator_supports_multiple_toolsets = True
+
+generator_wants_static_library_dependencies_adjusted = False
+
+generator_default_variables = {
+}
+for dirname in ['INTERMEDIATE_DIR', 'SHARED_INTERMEDIATE_DIR', 'PRODUCT_DIR',
+                'LIB_DIR', 'SHARED_LIB_DIR']:
+  generator_default_variables[dirname] = '!!!'
+
+for unused in ['RULE_INPUT_PATH', 'RULE_INPUT_ROOT', 'RULE_INPUT_NAME',
+               'RULE_INPUT_DIRNAME', 'RULE_INPUT_EXT',
+               'EXECUTABLE_PREFIX', 'EXECUTABLE_SUFFIX',
+               'STATIC_LIB_PREFIX', 'STATIC_LIB_SUFFIX',
+               'SHARED_LIB_PREFIX', 'SHARED_LIB_SUFFIX',
+               'CONFIGURATION_NAME']:
+  generator_default_variables[unused] = ''
+
+def __MakeRelativeTargetName(path):
+  """Converts a gyp target name into a relative name. For example, the path to a
+  gyp file may be something like c:\foo\bar.gyp:target, this converts it to
+  bar.gyp.
+  """
+  prune_path = os.getcwd()
+  if path.startswith(prune_path):
+    path = path[len(prune_path):]
+  # Gyp paths are always posix style.
+  path = path.replace('\\', '/')
+  if path.endswith('#target'):
+    path = path[0:len(path) - len('#target')]
+  return path
+
+def __ExtractBasePath(target):
+  """Extracts the path components of the specified gyp target path."""
+  last_index = target.rfind('/')
+  if last_index == -1:
+    return ''
+  return target[0:(last_index + 1)]
+
+def __AddSources(sources, base_path, base_path_components, result):
+  """Extracts valid sources from |sources| and adds them to |result|. Each
+  source file is relative to |base_path|, but may contain '..'. To make
+  resolving '..' easier |base_path_components| contains each of the
+  directories in |base_path|. Additionally each source may contain variables.
+  Such sources are ignored as it is assumed dependencies on them are expressed
+  and tracked in some other means."""
+  # NOTE: gyp paths are always posix style.
+  for source in sources:
+    if not len(source) or source.startswith('!!!') or source.startswith('$'):
+      continue
+    # variable expansion may lead to //.
+    source = source[0] + source[1:].replace('//', '/')
+    if source.startswith('../'):
+      path_components = base_path_components[:]
+      # Resolve relative paths.
+      while source.startswith('../'):
+        path_components.pop(len(path_components) - 1)
+        source = source[3:]
+      result.append('/'.join(path_components) + source)
+      continue
+    result.append(base_path + source)
+
+def __ExtractSourcesFromAction(action, base_path, base_path_components,
+                               results):
+  if 'inputs' in action:
+    __AddSources(action['inputs'], base_path, base_path_components, results)
+
+def __ExtractSources(target, target_dict):
+  base_path = posixpath.dirname(target)
+  base_path_components = base_path.split('/')
+  # Add a trailing '/' so that __AddSources() can easily build paths.
+  if len(base_path):
+    base_path += '/'
+  results = []
+  if 'sources' in target_dict:
+    __AddSources(target_dict['sources'], base_path, base_path_components,
+                 results)
+  # Include the inputs from any actions. Any changes to these effect the
+  # resulting output.
+  if 'actions' in target_dict:
+    for action in target_dict['actions']:
+      __ExtractSourcesFromAction(action, base_path, base_path_components,
+                                 results)
+  if 'rules' in target_dict:
+    for rule in target_dict['rules']:
+      __ExtractSourcesFromAction(rule, base_path, base_path_components, results)
+
+  return results
+
+class Target(object):
+  """Holds information about a particular target:
+  sources: set of source files defined by this target. This includes inputs to
+           actions and rules.
+  deps: list of direct dependencies."""
+  def __init__(self):
+    self.sources = []
+    self.deps = []
+
+def __GenerateTargets(target_list, target_dicts):
+  """Generates a dictionary with the key the name of a target and the value a
+  Target."""
+  targets = {}
+
+  # Queue of targets to visit.
+  targets_to_visit = target_list[:]
+
+  while len(targets_to_visit) > 0:
+    absolute_target_name = targets_to_visit.pop()
+    # |absolute_target| may be an absolute path and may include #target.
+    # References to targets are relative, so we need to clean the name.
+    relative_target_name = __MakeRelativeTargetName(absolute_target_name)
+    if relative_target_name in targets:
+      continue
+
+    target = Target()
+    targets[relative_target_name] = target
+    target.sources.extend(__ExtractSources(relative_target_name,
+                                           target_dicts[absolute_target_name]))
+
+    for dep in target_dicts[absolute_target_name].get('dependencies', []):
+      targets[relative_target_name].deps.append(__MakeRelativeTargetName(dep))
+      targets_to_visit.append(dep)
+
+  return targets
+
+def __GetFiles(params):
+  """Returns the list of files to analyze, or None if none specified."""
+  generator_flags = params.get('generator_flags', {})
+  file_path = generator_flags.get('file_path', None)
+  if not file_path:
+    return None
+  try:
+    f = open(file_path, 'r')
+    result = []
+    for file_name in f:
+      if file_name.endswith('\n'):
+        file_name = file_name[0:len(file_name) - 1]
+      if len(file_name):
+        result.append(file_name)
+    f.close()
+    return result
+  except IOError:
+    print 'Unable to open file', file_path
+  return None
+
+def CalculateVariables(default_variables, params):
+  """Calculate additional variables for use in the build (called by gyp)."""
+  flavor = gyp.common.GetFlavor(params)
+  if flavor == 'mac':
+    default_variables.setdefault('OS', 'mac')
+  elif flavor == 'win':
+    default_variables.setdefault('OS', 'win')
+  else:
+    operating_system = flavor
+    if flavor == 'android':
+      operating_system = 'linux'  # Keep this legacy behavior for now.
+    default_variables.setdefault('OS', operating_system)
+
+def GenerateOutput(target_list, target_dicts, data, params):
+  """Called by gyp as the final stage. Outputs results."""
+  files = __GetFiles(params)
+  if not files:
+    print 'Must specify files to analyze via file_path generator flag'
+    return
+
+  targets = __GenerateTargets(target_list, target_dicts)
+
+  files_set = frozenset(files)
+  found_in_all_sources = 0
+  for target_name, target in targets.iteritems():
+    sources = files_set.intersection(target.sources)
+    if len(sources):
+      print 'Found dependency'
+      return
+
+  print 'No dependencies'
diff --git a/pylib/gyp/generator/android.py b/pylib/gyp/generator/android.py
index 37b8b13..d7aa902 100644
--- a/pylib/gyp/generator/android.py
+++ b/pylib/gyp/generator/android.py
@@ -689,7 +689,7 @@
     E.g., the loadable module 'foobar' in directory 'baz' will produce
       '$(obj)/baz/libfoobar.so'
     """
-    if self.type == 'executable' and self.toolset == 'host':
+    if self.type == 'executable':
       # We install host executables into shared_intermediate_dir so they can be
       # run by gyp rules that refer to PRODUCT_DIR.
       path = '$(gyp_shared_intermediate_dir)'
@@ -880,13 +880,9 @@
       self.WriteLn('LOCAL_PRELINK_MODULE := false')
       self.WriteLn('include $(BUILD_%sSHARED_LIBRARY)' % modifier)
     elif self.type == 'executable':
-      if self.toolset == 'host':
-        self.WriteLn('LOCAL_MODULE_PATH := $(gyp_shared_intermediate_dir)')
-      else:
-        # Don't install target executables for now, as it results in them being
-        # included in ROM. This can be revisited if there's a reason to install
-        # them later.
-        self.WriteLn('LOCAL_UNINSTALLABLE_MODULE := true')
+      # Executables are for build and test purposes only, so they're installed
+      # to a directory that doesn't get included in the system image.
+      self.WriteLn('LOCAL_MODULE_PATH := $(gyp_shared_intermediate_dir)')
       self.WriteLn('include $(BUILD_%sEXECUTABLE)' % modifier)
     else:
       self.WriteLn('LOCAL_MODULE_PATH := $(PRODUCT_OUT)/gyp_stamp')
diff --git a/pylib/gyp/generator/msvs.py b/pylib/gyp/generator/msvs.py
index a4ebd7c..b18bff1 100644
--- a/pylib/gyp/generator/msvs.py
+++ b/pylib/gyp/generator/msvs.py
@@ -1828,8 +1828,7 @@
         path_to_ninja,
         '-C',
         '$(OutDir)',
-        '-t',
-        'clean',
+        '-tclean',
         '$(ProjectName)',
       ]
 
diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py
index e3fafb5..f31068a 100644
--- a/pylib/gyp/generator/ninja.py
+++ b/pylib/gyp/generator/ninja.py
@@ -393,6 +393,8 @@
       self.ninja.variable('arch', self.win_env[arch])
       self.ninja.variable('cc', '$cl_' + arch)
       self.ninja.variable('cxx', '$cl_' + arch)
+      self.ninja.variable('cc_host', '$cl_' + arch)
+      self.ninja.variable('cxx_host', '$cl_' + arch)
 
     if self.flavor == 'mac':
       self.archs = self.xcode_settings.GetActiveArchs(config_name)
@@ -1582,6 +1584,10 @@
 
 def GetDefaultConcurrentLinks():
   """Returns a best-guess for a number of concurrent links."""
+  pool_size = int(os.getenv('GYP_LINK_CONCURRENCY', 0))
+  if pool_size:
+    return pool_size
+
   if sys.platform in ('win32', 'cygwin'):
     import ctypes
 
@@ -1711,14 +1717,15 @@
   #   'CC_host'/'CXX_host' enviroment variable, cc_host/cxx_host should be set
   #   to cc/cxx.
   if flavor == 'win':
-    # Overridden by local arch choice in the use_deps case.
-    # Chromium's ffmpeg c99conv.py currently looks for a 'cc =' line in
-    # build.ninja so needs something valid here. http://crbug.com/233985
-    cc = 'cl.exe'
-    cxx = 'cl.exe'
+    ar = 'lib.exe'
+    # cc and cxx must be set to the correct architecture by overriding with one
+    # of cl_x86 or cl_x64 below.
+    cc = 'UNSET'
+    cxx = 'UNSET'
     ld = 'link.exe'
     ld_host = '$ld'
   else:
+    ar = 'ar'
     cc = 'cc'
     cxx = 'c++'
     ld = '$cc'
@@ -1726,6 +1733,7 @@
     ld_host = '$cc_host'
     ldxx_host = '$cxx_host'
 
+  ar_host = 'ar'
   cc_host = None
   cxx_host = None
   cc_host_global_setting = None
@@ -1738,6 +1746,10 @@
                                                 options.toplevel_dir)
   wrappers = {}
   for key, value in make_global_settings:
+    if key == 'AR':
+      ar = os.path.join(build_to_root, value)
+    if key == 'AR.host':
+      ar_host = os.path.join(build_to_root, value)
     if key == 'CC':
       cc = os.path.join(build_to_root, value)
       if cc.endswith('clang-cl'):
@@ -1750,6 +1762,10 @@
     if key == 'CXX.host':
       cxx_host = os.path.join(build_to_root, value)
       cxx_host_global_setting = value
+    if key == 'LD':
+      ld = os.path.join(build_to_root, value)
+    if key == 'LD.host':
+      ld_host = os.path.join(build_to_root, value)
     if key.endswith('_wrapper'):
       wrappers[key[:-len('_wrapper')]] = os.path.join(build_to_root, value)
 
@@ -1782,14 +1798,14 @@
   if flavor == 'win':
     master_ninja.variable('ld', ld)
     master_ninja.variable('idl', 'midl.exe')
-    master_ninja.variable('ar', 'lib.exe')
+    master_ninja.variable('ar', ar)
     master_ninja.variable('rc', 'rc.exe')
     master_ninja.variable('asm', 'ml.exe')
     master_ninja.variable('mt', 'mt.exe')
   else:
     master_ninja.variable('ld', CommandWithWrapper('LINK', wrappers, ld))
     master_ninja.variable('ldxx', CommandWithWrapper('LINK', wrappers, ldxx))
-    master_ninja.variable('ar', GetEnvironFallback(['AR_target', 'AR'], 'ar'))
+    master_ninja.variable('ar', GetEnvironFallback(['AR_target', 'AR'], ar))
 
   if generator_supports_multiple_toolsets:
     if not cc_host:
@@ -1797,7 +1813,7 @@
     if not cxx_host:
       cxx_host = cxx
 
-    master_ninja.variable('ar_host', GetEnvironFallback(['AR_host'], 'ar'))
+    master_ninja.variable('ar_host', GetEnvironFallback(['AR_host'], ar_host))
     cc_host = GetEnvironFallback(['CC_host'], cc_host)
     cxx_host = GetEnvironFallback(['CXX_host'], cxx_host)
 
@@ -1937,13 +1953,13 @@
       restat=True,
       command=mtime_preserving_solink_base % {'suffix': '@$link_file_list'},
       rspfile='$link_file_list',
-      rspfile_content='-Wl,--start-group $in $solibs -Wl,--end-group $libs',
+      rspfile_content='-Wl,--start-group $in -Wl,--end-group $solibs $libs',
       pool='link_pool')
     master_ninja.rule(
       'link',
       description='LINK $out',
       command=('$ld $ldflags -o $out '
-               '-Wl,--start-group $in $solibs -Wl,--end-group $libs'),
+               '-Wl,--start-group $in -Wl,--end-group $solibs $libs'),
       pool='link_pool')
   elif flavor == 'win':
     master_ninja.rule(
diff --git a/pylib/gyp/input.py b/pylib/gyp/input.py
index dc143d9..b09a2c8 100644
--- a/pylib/gyp/input.py
+++ b/pylib/gyp/input.py
@@ -603,7 +603,7 @@
         'multiple_toolsets': globals()['multiple_toolsets']}
 
       if not parallel_state.pool:
-        parallel_state.pool = multiprocessing.Pool(8)
+        parallel_state.pool = multiprocessing.Pool(multiprocessing.cpu_count())
       parallel_state.pool.apply_async(
           CallLoadTargetBuildFile,
           args = (global_flags, dependency,
diff --git a/test/actions/gyptest-generated-header.py b/test/actions/gyptest-generated-header.py
index cd5bd69..fa680ab 100644
--- a/test/actions/gyptest-generated-header.py
+++ b/test/actions/gyptest-generated-header.py
@@ -13,6 +13,12 @@
 
 test = TestGyp.TestGyp()
 
+if test.format == 'android':
+  # This test currently fails on android. Investigate why, fix the issues
+  # responsible, and reenable this test on android. See bug:
+  # https://code.google.com/p/gyp/issues/detail?id=436
+  test.skip_test(message='Test fails on android. Fix and reenable.\n')
+
 CHDIR = 'generated-header'
 
 test.run_gyp('test.gyp', chdir=CHDIR)
diff --git a/test/actions/src/subdir1/program.c b/test/actions/src/subdir1/program.c
index d5f661d..c093153 100644
--- a/test/actions/src/subdir1/program.c
+++ b/test/actions/src/subdir1/program.c
@@ -3,7 +3,7 @@
 extern void prog1(void);

 extern void prog2(void);

 

-int main(int argc, char *argv[])

+int main(void)
 {

   printf("Hello from program.c\n");

   prog1();

diff --git a/test/actions/src/subdir3/generate_main.py b/test/actions/src/subdir3/generate_main.py
index b90b3aa..804d38d 100755
--- a/test/actions/src/subdir3/generate_main.py
+++ b/test/actions/src/subdir3/generate_main.py
@@ -9,7 +9,7 @@
 contents = """
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from generate_main.py\\n");
   return 0;
diff --git a/test/analyzer/gyptest-analyzer.py b/test/analyzer/gyptest-analyzer.py
new file mode 100644
index 0000000..a42748f
--- /dev/null
+++ b/test/analyzer/gyptest-analyzer.py
@@ -0,0 +1,76 @@
+#!/usr/bin/env python
+# Copyright (c) 2014 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""Tests for analyzer
+"""
+
+import TestGyp
+
+found = 'Found dependency\n'
+not_found = 'No dependencies\n'
+
+def __CreateTestFile(files):
+  f = open('test_file', 'w')
+  for file in files:
+    f.write(file + '\n')
+  f.close()
+
+test = TestGyp.TestGypCustom(format='analyzer')
+
+# Verifies file_path must be specified.
+test.run_gyp('test.gyp',
+             stdout='Must specify files to analyze via file_path generator '
+             'flag\n')
+
+# Trivial test of a source.
+__CreateTestFile(['foo.c'])
+test.run_gyp('test.gyp', '-Gfile_path=test_file', stdout=found)
+
+# Conditional source that is excluded.
+__CreateTestFile(['conditional_source.c'])
+test.run_gyp('test.gyp', '-Gfile_path=test_file', stdout=not_found)
+
+# Conditional source that is included by way of argument.
+__CreateTestFile(['conditional_source.c'])
+test.run_gyp('test.gyp', '-Gfile_path=test_file', '-Dtest_variable=1',
+             stdout=found)
+
+# Two unknown files.
+__CreateTestFile(['unknown1.c', 'unoknow2.cc'])
+test.run_gyp('test.gyp', '-Gfile_path=test_file', stdout=not_found)
+
+# Two unknown files.
+__CreateTestFile(['unknown1.c', 'subdir/subdir_sourcex.c'])
+test.run_gyp('test.gyp', '-Gfile_path=test_file', stdout=not_found)
+
+# Included dependency
+__CreateTestFile(['unknown1.c', 'subdir/subdir_source.c'])
+test.run_gyp('test.gyp', '-Gfile_path=test_file', stdout=found)
+
+# Included inputs to actions.
+__CreateTestFile(['action_input.c'])
+test.run_gyp('test.gyp', '-Gfile_path=test_file', stdout=found)
+
+# Don't consider outputs.
+__CreateTestFile(['action_output.c'])
+test.run_gyp('test.gyp', '-Gfile_path=test_file', stdout=not_found)
+
+# Rule inputs.
+__CreateTestFile(['rule_input.c'])
+test.run_gyp('test.gyp', '-Gfile_path=test_file', stdout=found)
+
+# Ignore patch specified with PRODUCT_DIR.
+__CreateTestFile(['product_dir_input.c'])
+test.run_gyp('test.gyp', '-Gfile_path=test_file', stdout=not_found)
+
+# Path specified via a variable.
+__CreateTestFile(['subdir/subdir_source2.c'])
+test.run_gyp('test.gyp', '-Gfile_path=test_file', stdout=found)
+
+# Verifies paths with // are fixed up correctly.
+__CreateTestFile(['parent_source.c'])
+test.run_gyp('test.gyp', '-Gfile_path=test_file', stdout=found)
+
+test.pass_test()
diff --git a/test/analyzer/subdir/subdir.gyp b/test/analyzer/subdir/subdir.gyp
new file mode 100644
index 0000000..cd0f013
--- /dev/null
+++ b/test/analyzer/subdir/subdir.gyp
@@ -0,0 +1,19 @@
+# Copyright (c) 2014 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+  'variables': {
+    'trailing_dir_path': '../',
+   },
+  'targets': [
+    {
+      'target_name': 'foo',
+      'type': 'static_library',
+      'sources': [
+        'subdir_source.c',
+        '<(trailing_dir_path)/parent_source.c',
+      ],
+    },
+  ],
+}
diff --git a/test/analyzer/test.gyp b/test/analyzer/test.gyp
new file mode 100644
index 0000000..b3fcdd3
--- /dev/null
+++ b/test/analyzer/test.gyp
@@ -0,0 +1,54 @@
+# Copyright (c) 2014 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+{
+  'variables': {
+    'test_variable%': 0,
+    'variable_path': 'subdir',
+   },
+  'targets': [
+    {
+      'target_name': 'exe',
+      'type': 'executable',
+      'dependencies': [
+        'subdir/subdir.gyp:foo',
+      ],
+      'sources': [
+        'foo.c',
+        '<(variable_path)/subdir_source2.c',
+      ],
+      'conditions': [
+        ['test_variable==1', {
+          'sources': [
+            'conditional_source.c',
+          ],
+        }],
+      ],
+      'actions': [
+        {
+          'action_name': 'action',
+          'inputs': [
+            '<(PRODUCT_DIR)/product_dir_input.c',
+            'action_input.c',
+          ],
+          'outputs': [
+            'action_output.c',
+          ],
+        },
+      ],
+      'rules': [
+        {
+          'rule_name': 'rule',
+          'extension': 'pdf',
+          'inputs': [
+            'rule_input.c',
+          ],
+          'outputs': [
+            'rule_output.pdf',
+          ],
+        },
+      ],
+    },
+  ],
+}
diff --git a/test/assembly/src/program.c b/test/assembly/src/program.c
index ecce3b0..eee8627 100644
--- a/test/assembly/src/program.c
+++ b/test/assembly/src/program.c
@@ -2,7 +2,7 @@
 
 extern int lib1_function(void);
 
-int main(int argc, char *argv[])
+int main(void)
 {
   fprintf(stdout, "Hello from program.c\n");
   fflush(stdout);
diff --git a/test/build-option/gyptest-build.py b/test/build-option/gyptest-build.py
index 602c435..6dfadb2 100755
--- a/test/build-option/gyptest-build.py
+++ b/test/build-option/gyptest-build.py
@@ -13,6 +13,12 @@
 
 test = TestGyp.TestGyp(workdir='workarea_default')
 
+if test.format == 'android':
+  # This test currently fails on android. Investigate why, fix the issues
+  # responsible, and reenable this test on android. See bug:
+  # https://code.google.com/p/gyp/issues/detail?id=436
+  test.skip_test(message='Test fails on android. Fix and reenable.\n')
+
 test.run_gyp('hello.gyp', '--build=Default')
 
 test.run_built_executable('hello', stdout="Hello, world!\n")
diff --git a/test/build-option/hello.c b/test/build-option/hello.c
index 78a67b5..f6ad129 100644
--- a/test/build-option/hello.c
+++ b/test/build-option/hello.c
@@ -6,7 +6,7 @@
 
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello, world!\n");
   return 0;
diff --git a/test/builddir/src/prog1.c b/test/builddir/src/prog1.c
index 674ca74..a32aaf0 100644
--- a/test/builddir/src/prog1.c
+++ b/test/builddir/src/prog1.c
@@ -2,7 +2,7 @@
 
 extern void func1(void);
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from prog1.c\n");
   func1();
diff --git a/test/builddir/src/subdir2/prog2.c b/test/builddir/src/subdir2/prog2.c
index bbdf4f0..9d682cd 100644
--- a/test/builddir/src/subdir2/prog2.c
+++ b/test/builddir/src/subdir2/prog2.c
@@ -2,7 +2,7 @@
 
 extern void func2(void);
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from subdir2/prog2.c\n");
   func2();
diff --git a/test/builddir/src/subdir2/subdir3/prog3.c b/test/builddir/src/subdir2/subdir3/prog3.c
index 10c530b..da74965 100644
--- a/test/builddir/src/subdir2/subdir3/prog3.c
+++ b/test/builddir/src/subdir2/subdir3/prog3.c
@@ -2,7 +2,7 @@
 
 extern void func3(void);
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from subdir2/subdir3/prog3.c\n");
   func3();
diff --git a/test/builddir/src/subdir2/subdir3/subdir4/prog4.c b/test/builddir/src/subdir2/subdir3/subdir4/prog4.c
index dcba9a9..5787d5f 100644
--- a/test/builddir/src/subdir2/subdir3/subdir4/prog4.c
+++ b/test/builddir/src/subdir2/subdir3/subdir4/prog4.c
@@ -2,7 +2,7 @@
 
 extern void func4(void);
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from subdir2/subdir3/subdir4/prog4.c\n");
   func4();
diff --git a/test/builddir/src/subdir2/subdir3/subdir4/subdir5/prog5.c b/test/builddir/src/subdir2/subdir3/subdir4/subdir5/prog5.c
index 69132e5..c6e2ab5 100644
--- a/test/builddir/src/subdir2/subdir3/subdir4/subdir5/prog5.c
+++ b/test/builddir/src/subdir2/subdir3/subdir4/subdir5/prog5.c
@@ -2,7 +2,7 @@
 
 extern void func5(void);
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from subdir2/subdir3/subdir4/subdir5/prog5.c\n");
   func5();
diff --git a/test/cflags/cflags.c b/test/cflags/cflags.c
index 276abe6..0a02ba9 100644
--- a/test/cflags/cflags.c
+++ b/test/cflags/cflags.c
@@ -4,7 +4,7 @@
 
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
 #ifdef FOO
   printf("FOO defined\n");
diff --git a/test/compilable/src/program.cpp b/test/compilable/src/program.cpp
index 81420ba..8af2c9b 100644
--- a/test/compilable/src/program.cpp
+++ b/test/compilable/src/program.cpp
@@ -1,7 +1,7 @@
 #include <stdio.h>
 #include "lib1.hpp"
 
-int main(int argc, char *argv[]) {
+int main(void) {
   fprintf(stdout, "Hello from program.c\n");
   fflush(stdout);
   lib1_function();
diff --git a/test/configurations/basics/configurations.c b/test/configurations/basics/configurations.c
index 6c1f900..39e13c9 100644
--- a/test/configurations/basics/configurations.c
+++ b/test/configurations/basics/configurations.c
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
 #ifdef FOO
   printf("Foo configuration\n");
diff --git a/test/configurations/basics/gyptest-configurations.py b/test/configurations/basics/gyptest-configurations.py
index 27cd2e8..1cf1995 100755
--- a/test/configurations/basics/gyptest-configurations.py
+++ b/test/configurations/basics/gyptest-configurations.py
@@ -12,6 +12,12 @@
 
 test = TestGyp.TestGyp()
 
+if test.format == 'android':
+  # This test currently fails on android. Investigate why, fix the issues
+  # responsible, and reenable this test on android. See bug:
+  # https://code.google.com/p/gyp/issues/detail?id=436
+  test.skip_test(message='Test fails on android. Fix and reenable.\n')
+
 test.run_gyp('configurations.gyp')
 
 test.set_configuration('Release')
diff --git a/test/configurations/inheritance/configurations.c b/test/configurations/inheritance/configurations.c
index 2d5565e..ebb9f84 100644
--- a/test/configurations/inheritance/configurations.c
+++ b/test/configurations/inheritance/configurations.c
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
 #ifdef BASE
   printf("Base configuration\n");
diff --git a/test/configurations/inheritance/gyptest-inheritance.py b/test/configurations/inheritance/gyptest-inheritance.py
index 22c73a3..ecc9d08 100755
--- a/test/configurations/inheritance/gyptest-inheritance.py
+++ b/test/configurations/inheritance/gyptest-inheritance.py
@@ -12,6 +12,12 @@
 
 test = TestGyp.TestGyp()
 
+if test.format == 'android':
+  # This test currently fails on android. Investigate why, fix the issues
+  # responsible, and reenable this test on android. See bug:
+  # https://code.google.com/p/gyp/issues/detail?id=436
+  test.skip_test(message='Test fails on android. Fix and reenable.\n')
+
 test.run_gyp('configurations.gyp')
 
 test.set_configuration('Release')
diff --git a/test/configurations/target_platform/front.c b/test/configurations/target_platform/front.c
index 12b1d0a..7a91689 100644
--- a/test/configurations/target_platform/front.c
+++ b/test/configurations/target_platform/front.c
@@ -2,7 +2,7 @@
 
 const char *message(void);
 
-int main(int argc, char *argv[]) {
+int main(void) {
   printf("%s\n", message());
   return 0;
 }
diff --git a/test/configurations/x64/configurations.c b/test/configurations/x64/configurations.c
index 72c97e3..3701843 100644
--- a/test/configurations/x64/configurations.c
+++ b/test/configurations/x64/configurations.c
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main(int argc, char *argv[]) {
+int main(void) {
   if (sizeof(void*) == 4) {
     printf("Running Win32\n");
   } else if (sizeof(void*) == 8) {
diff --git a/test/cxxflags/cxxflags.cc b/test/cxxflags/cxxflags.cc
index 44b299c..e70e39d 100644
--- a/test/cxxflags/cxxflags.cc
+++ b/test/cxxflags/cxxflags.cc
@@ -4,7 +4,7 @@
 
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
 #ifdef ABC
   printf("With define\n");
diff --git a/test/defines-escaping/defines-escaping.c b/test/defines-escaping/defines-escaping.c
index 4407572..a0aa4c2 100644
--- a/test/defines-escaping/defines-escaping.c
+++ b/test/defines-escaping/defines-escaping.c
@@ -4,7 +4,7 @@
 
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf(TEST_FORMAT, TEST_ARGS);
   return 0;
diff --git a/test/defines/defines.c b/test/defines/defines.c
index e0ef521..dda1392 100644
--- a/test/defines/defines.c
+++ b/test/defines/defines.c
@@ -4,7 +4,7 @@
 
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
 #ifdef FOO
   printf("FOO is defined\n");
diff --git a/test/dependency-copy/src/file1.c b/test/dependency-copy/src/file1.c
index 3caf5d6..d7c3159 100644
--- a/test/dependency-copy/src/file1.c
+++ b/test/dependency-copy/src/file1.c
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from file1.c\n");
   return 0;
diff --git a/test/dependency-copy/src/file2.c b/test/dependency-copy/src/file2.c
index ed45cc0..cf40f57 100644
--- a/test/dependency-copy/src/file2.c
+++ b/test/dependency-copy/src/file2.c
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from file2.c\n");
   return 0;
diff --git a/test/exclusion/hello.c b/test/exclusion/hello.c
index 30e8d54..6e7dc8e 100644
--- a/test/exclusion/hello.c
+++ b/test/exclusion/hello.c
@@ -8,7 +8,7 @@
   return 42;
 }
 
-int main(int argc, char *argv[]) {
+int main(void) {
   printf("Hello, world!\n");
   printf("%d\n", func1());
   return 0;
diff --git a/test/external-cross-compile/src/program.cc b/test/external-cross-compile/src/program.cc
index a50ca36..5172ae9 100644
--- a/test/external-cross-compile/src/program.cc
+++ b/test/external-cross-compile/src/program.cc
@@ -10,7 +10,7 @@
 #include "cross_program.h"
 };
 
-int main(int argc, char *argv[]) {
+int main(void) {
   fwrite(data, 1, sizeof(data), stdout);
   return 0;
 }
diff --git a/test/generator-output/actions/subdir1/program.c b/test/generator-output/actions/subdir1/program.c
index d5f661d..c093153 100644
--- a/test/generator-output/actions/subdir1/program.c
+++ b/test/generator-output/actions/subdir1/program.c
@@ -3,7 +3,7 @@
 extern void prog1(void);

 extern void prog2(void);

 

-int main(int argc, char *argv[])

+int main(void)
 {

   printf("Hello from program.c\n");

   prog1();

diff --git a/test/generator-output/rules/subdir1/program.c b/test/generator-output/rules/subdir1/program.c
index 27fd31e..56b3206 100644
--- a/test/generator-output/rules/subdir1/program.c
+++ b/test/generator-output/rules/subdir1/program.c
@@ -7,7 +7,7 @@
 extern void function3(void);
 extern void function4(void);
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from program.c\n");
   function1();
diff --git a/test/generator-output/src/prog1.c b/test/generator-output/src/prog1.c
index 656f81d..bf7c2a1 100644
--- a/test/generator-output/src/prog1.c
+++ b/test/generator-output/src/prog1.c
@@ -6,7 +6,7 @@
 #include "include3.h"
 #include "deeper.h"
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from prog1.c\n");
   printf("Hello from %s\n", INC_STRING);
diff --git a/test/generator-output/src/subdir2/deeper/deeper.c b/test/generator-output/src/subdir2/deeper/deeper.c
index 56c49d1..843505c 100644
--- a/test/generator-output/src/subdir2/deeper/deeper.c
+++ b/test/generator-output/src/subdir2/deeper/deeper.c
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from deeper.c\n");
   return 0;
diff --git a/test/generator-output/src/subdir2/prog2.c b/test/generator-output/src/subdir2/prog2.c
index 38d6c84..d80d871 100644
--- a/test/generator-output/src/subdir2/prog2.c
+++ b/test/generator-output/src/subdir2/prog2.c
@@ -6,7 +6,7 @@
 #include "include3.h"
 #include "deeper.h"
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from prog2.c\n");
   printf("Hello from %s\n", INC_STRING);
diff --git a/test/generator-output/src/subdir3/prog3.c b/test/generator-output/src/subdir3/prog3.c
index 7848b45..c72233d 100644
--- a/test/generator-output/src/subdir3/prog3.c
+++ b/test/generator-output/src/subdir3/prog3.c
@@ -6,7 +6,7 @@
 #include "include3.h"
 #include "deeper.h"
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from prog3.c\n");
   printf("Hello from %s\n", INC_STRING);
diff --git a/test/hello/hello.c b/test/hello/hello.c
index 8dbecc0..0a4c806 100644
--- a/test/hello/hello.c
+++ b/test/hello/hello.c
@@ -4,7 +4,7 @@
 
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello, world!\n");
   return 0;
diff --git a/test/hello/hello2.c b/test/hello/hello2.c
index 19ef3fb..b14299c 100644
--- a/test/hello/hello2.c
+++ b/test/hello/hello2.c
@@ -4,7 +4,7 @@
 
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello, two!\n");
   return 0;
diff --git a/test/home_dot_gyp/src/printfoo.c b/test/home_dot_gyp/src/printfoo.c
index 92d2cba..9bb6718 100644
--- a/test/home_dot_gyp/src/printfoo.c
+++ b/test/home_dot_gyp/src/printfoo.c
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("FOO is %s\n", FOO);
   return 0;
diff --git a/test/include_dirs/src/includes.c b/test/include_dirs/src/includes.c
index e2afbd3..6e2a23c 100644
--- a/test/include_dirs/src/includes.c
+++ b/test/include_dirs/src/includes.c
@@ -5,7 +5,7 @@
 #include "include2.h"
 #include "shadow.h"
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from includes.c\n");
   printf("Hello from %s\n", INC_STRING);
diff --git a/test/include_dirs/src/subdir/subdir_includes.c b/test/include_dirs/src/subdir/subdir_includes.c
index 727f682..4623543 100644
--- a/test/include_dirs/src/subdir/subdir_includes.c
+++ b/test/include_dirs/src/subdir/subdir_includes.c
@@ -4,7 +4,7 @@
 #include "include1.h"
 #include "include2.h"
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from subdir/subdir_includes.c\n");
   printf("Hello from %s\n", INC_STRING);
diff --git a/test/lib/TestGyp.py b/test/lib/TestGyp.py
index cde04ca..3cea15e 100644
--- a/test/lib/TestGyp.py
+++ b/test/lib/TestGyp.py
@@ -151,6 +151,9 @@
     # Clear $GYP_DEFINES for the same reason.
     if 'GYP_DEFINES' in os.environ:
       del os.environ['GYP_DEFINES']
+    # Override the user's language settings, which could
+    # otherwise make the output vary from what is expected.
+    os.environ['LC_ALL'] = 'C'
 
   def built_file_must_exist(self, name, type=None, **kw):
     """
@@ -406,10 +409,6 @@
   """
   Subclass for testing the GYP Android makefile generator. Note that
   build/envsetup.sh and lunch must have been run before running tests.
-
-  TODO: This is currently an incomplete implementation. We do not support
-  run_built_executable(), so we pass only tests which do not use this. As a
-  result, support for host targets is not properly tested.
   """
   format = 'android'
 
@@ -452,6 +451,20 @@
           os.remove(os.path.join(out_dir, x, d))
 
     super(TestGypAndroid, self).__init__(*args, **kw)
+    self._adb_path = os.path.join(os.environ['ANDROID_HOST_OUT'], 'bin', 'adb')
+    self._device_serial = None
+    adb_devices_out = self._call_adb(['devices'])
+    devices = [l.split()[0] for l in adb_devices_out.splitlines()[1:-1]
+               if l.split()[1] == 'device']
+    if len(devices) == 0:
+      self._device_serial = None
+    else:
+      if len(devices) > 1:
+        self._device_serial = random.choice(devices)
+      else:
+        self._device_serial = devices[0]
+      self._call_adb(['root'])
+    self._to_install = set()
 
   def target_name(self, target):
     if target == self.ALL:
@@ -462,6 +475,8 @@
       return self.ALL
     return target
 
+  _INSTALLABLE_PREFIX = 'Install: '
+
   def build(self, gyp_file, target=None, **kw):
     """
     Runs a build using the Android makefiles generated from the specified
@@ -476,6 +491,11 @@
     makefile = os.path.join(self.workdir, chdir, 'GypAndroid.mk')
     os.environ['ONE_SHOT_MAKEFILE'] = makefile
     result = self.run(program=self.build_tool, **kw)
+    for l in self.stdout().splitlines():
+      if l.startswith(TestGypAndroid._INSTALLABLE_PREFIX):
+        self._to_install.add(os.path.abspath(os.path.join(
+            os.environ['ANDROID_BUILD_TOP'],
+            l[len(TestGypAndroid._INSTALLABLE_PREFIX):])))
     del os.environ['ONE_SHOT_MAKEFILE']
     return result
 
@@ -498,15 +518,10 @@
     """
     # Built files are in $ANDROID_PRODUCT_OUT. This requires copying logic from
     # the Android build system.
-    if type == None:
+    if type == None or type == self.EXECUTABLE:
       return os.path.join(os.environ['ANDROID_PRODUCT_OUT'], 'obj', 'GYP',
                           'shared_intermediates', name)
     subdir = kw.get('subdir')
-    if type == self.EXECUTABLE:
-      # We don't install executables
-      group = 'EXECUTABLES'
-      module_name = self.android_module(group, name, subdir)
-      return os.path.join(self.intermediates_dir(group, module_name), name)
     if type == self.STATIC_LIB:
       group = 'STATIC_LIBRARIES'
       module_name = self.android_module(group, name, subdir)
@@ -519,23 +534,98 @@
                           '%s.so' % module_name)
     assert False, 'Unhandled type'
 
+  def _adb_failure(self, command, msg, stdout, stderr):
+    """ Reports a failed adb command and fails the containing test.
+
+    Args:
+      command: The adb command that failed.
+      msg: The error description.
+      stdout: The standard output.
+      stderr: The standard error.
+    """
+    print '%s failed%s' % (' '.join(command), ': %s' % msg if msg else '')
+    print self.banner('STDOUT ')
+    stdout.seek(0)
+    print stdout.read()
+    print self.banner('STDERR ')
+    stderr.seek(0)
+    print stderr.read()
+    self.fail_test()
+
+  def _call_adb(self, command):
+    """ Calls the provided adb command.
+
+    If the command fails, the test fails.
+
+    Args:
+      command: The adb command to call.
+    Returns:
+      The command's output.
+    """
+    with tempfile.TemporaryFile(bufsize=0) as adb_out:
+      with tempfile.TemporaryFile(bufsize=0) as adb_err:
+        adb_command = [self._adb_path]
+        if self._device_serial:
+          adb_command += ['-s', self._device_serial]
+        is_shell = (command[0] == 'shell')
+        if is_shell:
+          command = [command[0], '%s; echo "\n$?";' % ' '.join(command[1:])]
+        adb_command += command
+        if subprocess.call(adb_command, stdout=adb_out, stderr=adb_err) != 0:
+          self._adb_failure(adb_command, None, adb_out, adb_err)
+        else:
+          adb_out.seek(0)
+          output = adb_out.read()
+          if is_shell:
+            output = output.splitlines(True)
+            try:
+              output[-2] = output[-2].rstrip('\r\n')
+              output, rc = (''.join(output[:-1]), int(output[-1]))
+            except ValueError:
+              self._adb_failure(adb_command, 'unexpected output format',
+                                adb_out, adb_err)
+            if rc != 0:
+              self._adb_failure(adb_command, 'exited with %d' % rc, adb_out,
+                                adb_err)
+          return output
+
   def run_built_executable(self, name, *args, **kw):
     """
     Runs an executable program built from a gyp-generated configuration.
-
-    This is not correctly implemented for Android. For now, we simply check
-    that the executable file exists.
     """
-    # Running executables requires a device. Even if we build for target x86,
-    # the binary is not built with the correct toolchain options to actually
-    # run on the host.
-
-    # Copied from TestCommon.run()
     match = kw.pop('match', self.match)
-    status = None
-    if os.path.exists(self.built_file_path(name)):
-      status = 1
-    self._complete(None, None, None, None, status, match)
+
+    executable_file = self.built_file_path(name, type=self.EXECUTABLE, **kw)
+    if executable_file not in self._to_install:
+      self.fail_test()
+
+    if not self._device_serial:
+      self.skip_test(message='No devices attached.\n')
+
+    storage = self._call_adb(['shell', 'echo', '$ANDROID_DATA']).strip()
+    if not len(storage):
+      self.fail_test()
+
+    installed = set()
+    try:
+      for i in self._to_install:
+        a = os.path.abspath(
+            os.path.join(os.environ['ANDROID_BUILD_TOP'], i))
+        dest = '%s/%s' % (storage, os.path.basename(a))
+        self._call_adb(['push', os.path.abspath(a), dest])
+        installed.add(dest)
+        if i == executable_file:
+          device_executable = dest
+          self._call_adb(['shell', 'chmod', '755', device_executable])
+
+      out = self._call_adb(
+          ['shell', 'LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%s' % storage,
+           device_executable])
+      out = out.replace('\r\n', '\n')
+      self._complete(out, kw.pop('stdout', None), None, None, None, match)
+    finally:
+      if len(installed):
+        self._call_adb(['shell', 'rm'] + list(installed))
 
   def match_single_line(self, lines = None, expected_line = None):
     """
diff --git a/test/library/gyptest-shared.py b/test/library/gyptest-shared.py
index a1d2985..b30b50c 100755
--- a/test/library/gyptest-shared.py
+++ b/test/library/gyptest-shared.py
@@ -14,6 +14,12 @@
 
 test = TestGyp.TestGyp()
 
+if test.format == 'android':
+  # This test currently fails on android. Investigate why, fix the issues
+  # responsible, and reenable this test on android. See bug:
+  # https://code.google.com/p/gyp/issues/detail?id=436
+  test.skip_test(message='Test fails on android. Fix and reenable.\n')
+
 test.run_gyp('library.gyp',
              '-Dlibrary=shared_library',
              '-Dmoveable_function=lib1',
diff --git a/test/library/gyptest-static.py b/test/library/gyptest-static.py
index 4bc71c4..27d8aa3 100755
--- a/test/library/gyptest-static.py
+++ b/test/library/gyptest-static.py
@@ -14,6 +14,12 @@
 
 test = TestGyp.TestGyp()
 
+if test.format == 'android':
+  # This test currently fails on android. Investigate why, fix the issues
+  # responsible, and reenable this test on android. See bug:
+  # https://code.google.com/p/gyp/issues/detail?id=436
+  test.skip_test(message='Test fails on android. Fix and reenable.\n')
+
 test.run_gyp('library.gyp',
              '-Dlibrary=static_library',
              '-Dmoveable_function=lib1',
diff --git a/test/library/src/program.c b/test/library/src/program.c
index d7712cc..d460f60 100644
--- a/test/library/src/program.c
+++ b/test/library/src/program.c
@@ -4,7 +4,7 @@
 extern void lib2_function(void);
 extern void moveable_function(void);
 
-int main(int argc, char *argv[])
+int main(void)
 {
   fprintf(stdout, "Hello from program.c\n");
   fflush(stdout);
diff --git a/test/link-dependency/mymalloc.c b/test/link-dependency/mymalloc.c
index 23d034f..f80bc02 100644
--- a/test/link-dependency/mymalloc.c
+++ b/test/link-dependency/mymalloc.c
@@ -7,5 +7,6 @@
 #endif
 
 void *malloc(size_t size) {
+  (void)size;
   return (void*)0xdeadbeef;
 }
diff --git a/test/link-objects/base.c b/test/link-objects/base.c
index 2bc29a1..3327459 100644
--- a/test/link-objects/base.c
+++ b/test/link-objects/base.c
@@ -1,6 +1,6 @@
 void extra();
 
-int main(int argc, char** argv) {
+int main(void) {
   extra();
   return 0;
 }
diff --git a/test/make/main.cc b/test/make/main.cc
index 70ac6e4..3b9a705 100644
--- a/test/make/main.cc
+++ b/test/make/main.cc
@@ -6,7 +6,7 @@
 
 #include "main.h"
 
-int main(int argc, char *argv[]) {
+int main(void) {
   printf("hello world\n");
   return 0;
 }
diff --git a/test/make/noload/main.c b/test/make/noload/main.c
index 46d3c52..26ec188 100644
--- a/test/make/noload/main.c
+++ b/test/make/noload/main.c
@@ -2,7 +2,7 @@
 
 #include "lib/shared.h"
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from %s.\n", kSharedStr);
   return 0;
diff --git a/test/make_global_settings/ar/gyptest-make_global_settings_ar.py b/test/make_global_settings/ar/gyptest-make_global_settings_ar.py
new file mode 100644
index 0000000..f935e23
--- /dev/null
+++ b/test/make_global_settings/ar/gyptest-make_global_settings_ar.py
@@ -0,0 +1,123 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2014 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""
+Verifies 'AR' in make_global_settings.
+"""
+
+import os
+import sys
+import TestGyp
+
+def resolve_path(test, path):
+  if path is None:
+    return None
+  elif test.format == 'make':
+    return '$(abspath %s)' % path
+  elif test.format == 'ninja':
+    return os.path.join('..', '..', path)
+  else:
+    test.fail_test()
+
+
+def verify_ar_target(test, ar=None, rel_path=False):
+  if rel_path:
+    ar_expected = resolve_path(test, ar)
+  else:
+    ar_expected = ar
+  # Resolve default values
+  if ar_expected is None:
+    if test.format == 'make':
+      # Make generator hasn't set the default value for AR.
+      # You can remove the following assertion as long as it doesn't
+      # break existing projects.
+      test.must_not_contain('Makefile', 'AR ?= ')
+      return
+    elif test.format == 'ninja':
+      if sys.platform == 'win32':
+        ar_expected = 'lib.exe'
+      else:
+        ar_expected = 'ar'
+  if test.format == 'make':
+    test.must_contain('Makefile', 'AR ?= %s' % ar_expected)
+  elif test.format == 'ninja':
+    test.must_contain('out/Default/build.ninja', 'ar = %s' % ar_expected)
+  else:
+    test.fail_test()
+
+
+def verify_ar_host(test, ar=None, rel_path=False):
+  if rel_path:
+    ar_expected = resolve_path(test, ar)
+  else:
+    ar_expected = ar
+  # Resolve default values
+  if ar_expected is None:
+    ar_expected = 'ar'
+  if test.format == 'make':
+    test.must_contain('Makefile', 'AR.host ?= %s' % ar_expected)
+  elif test.format == 'ninja':
+    test.must_contain('out/Default/build.ninja', 'ar_host = %s' % ar_expected)
+  else:
+    test.fail_test()
+
+
+test_format = ['ninja']
+if sys.platform in ('linux2', 'darwin'):
+  test_format += ['make']
+
+test = TestGyp.TestGyp(formats=test_format)
+
+# Check default values
+test.run_gyp('make_global_settings_ar.gyp')
+verify_ar_target(test)
+
+
+# Check default values with GYP_CROSSCOMPILE enabled.
+with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1'}):
+  test.run_gyp('make_global_settings_ar.gyp')
+verify_ar_target(test)
+verify_ar_host(test)
+
+
+# Test 'AR' in 'make_global_settings'.
+with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1'}):
+  test.run_gyp('make_global_settings_ar.gyp', '-Dcustom_ar_target=my_ar')
+verify_ar_target(test, ar='my_ar', rel_path=True)
+
+
+# Test 'AR'/'AR.host' in 'make_global_settings'.
+with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1'}):
+  test.run_gyp('make_global_settings_ar.gyp',
+               '-Dcustom_ar_target=my_ar_target1',
+               '-Dcustom_ar_host=my_ar_host1')
+verify_ar_target(test, ar='my_ar_target1', rel_path=True)
+verify_ar_host(test, ar='my_ar_host1', rel_path=True)
+
+
+# Test $AR and $AR_host environment variables.
+with TestGyp.LocalEnv({'AR': 'my_ar_target2',
+                       'AR_host': 'my_ar_host2'}):
+  test.run_gyp('make_global_settings_ar.gyp')
+# Ninja generator resolves $AR in gyp phase. Make generator doesn't.
+if test.format == 'ninja':
+  if sys.platform == 'win32':
+    # TODO(yukawa): Make sure if this is an expected result or not.
+    verify_ar_target(test, ar='lib.exe', rel_path=False)
+  else:
+    verify_ar_target(test, ar='my_ar_target2', rel_path=False)
+verify_ar_host(test, ar='my_ar_host2', rel_path=False)
+
+
+# Test 'AR' in 'make_global_settings' with $AR_host environment variable.
+with TestGyp.LocalEnv({'AR_host': 'my_ar_host3'}):
+  test.run_gyp('make_global_settings_ar.gyp',
+               '-Dcustom_ar_target=my_ar_target3')
+verify_ar_target(test, ar='my_ar_target3', rel_path=True)
+verify_ar_host(test, ar='my_ar_host3', rel_path=False)
+
+
+test.pass_test()
diff --git a/test/make_global_settings/ar/make_global_settings_ar.gyp b/test/make_global_settings/ar/make_global_settings_ar.gyp
new file mode 100644
index 0000000..3430d82
--- /dev/null
+++ b/test/make_global_settings/ar/make_global_settings_ar.gyp
@@ -0,0 +1,29 @@
+# Copyright (c) 2014 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style licence that can be
+# found in the LICENSE file.
+
+{
+  'variables': {
+    'custom_ar_target%': '',
+    'custom_ar_host%': '',
+  },
+  'conditions': [
+    ['"<(custom_ar_target)"!=""', {
+      'make_global_settings': [
+        ['AR', '<(custom_ar_target)'],
+      ],
+    }],
+    ['"<(custom_ar_host)"!=""', {
+      'make_global_settings': [
+        ['AR.host', '<(custom_ar_host)'],
+      ],
+    }],
+  ],
+  'targets': [
+    {
+      'target_name': 'make_global_settings_ar_test',
+      'type': 'static_library',
+      'sources': [ 'foo.c' ],
+    },
+  ],
+}
diff --git a/test/make_global_settings/ld/gyptest-make_global_settings_ld.py b/test/make_global_settings/ld/gyptest-make_global_settings_ld.py
new file mode 100644
index 0000000..c0b0a38
--- /dev/null
+++ b/test/make_global_settings/ld/gyptest-make_global_settings_ld.py
@@ -0,0 +1,130 @@
+#!/usr/bin/env python
+
+# Copyright (c) 2014 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+"""
+Verifies 'LD' in make_global_settings.
+"""
+
+import os
+import sys
+import TestGyp
+
+def resolve_path(test, path):
+  if path is None:
+    return None
+  elif test.format == 'make':
+    return '$(abspath %s)' % path
+  elif test.format == 'ninja':
+    return os.path.join('..', '..', path)
+  else:
+    test.fail_test()
+
+
+def verify_ld_target(test, ld=None, rel_path=False):
+  if rel_path:
+    ld_expected = resolve_path(test, ld)
+  else:
+    ld_expected = ld
+  # Resolve default values
+  if ld_expected is None:
+    if test.format == 'make':
+      # Make generator hasn't set the default value for LD.
+      # You can remove the following assertion as long as it doesn't
+      # break existing projects.
+      test.must_not_contain('Makefile', 'LD ?= ')
+      return
+    elif test.format == 'ninja':
+      if sys.platform == 'win32':
+        ld_expected = 'link.exe'
+      else:
+        ld_expected = '$cc'
+  if test.format == 'make':
+    test.must_contain('Makefile', 'LD ?= %s' % ld_expected)
+  elif test.format == 'ninja':
+    test.must_contain('out/Default/build.ninja', 'ld = %s' % ld_expected)
+  else:
+    test.fail_test()
+
+
+def verify_ld_host(test, ld=None, rel_path=False):
+  if rel_path:
+    ld_expected = resolve_path(test, ld)
+  else:
+    ld_expected = ld
+  # Resolve default values
+  if ld_expected is None:
+    if test.format == 'make':
+      # Make generator hasn't set the default value for LD.host.
+      # You can remove the following assertion as long as it doesn't
+      # break existing projects.
+      test.must_not_contain('Makefile', 'LD.host ?= ')
+      return
+    elif test.format == 'ninja':
+      if sys.platform == 'win32':
+        ld_expected = '$ld'
+      else:
+        ld_expected = '$cc_host'
+  if test.format == 'make':
+    test.must_contain('Makefile', 'LD.host ?= %s' % ld_expected)
+  elif test.format == 'ninja':
+    test.must_contain('out/Default/build.ninja', 'ld_host = %s' % ld_expected)
+  else:
+    test.fail_test()
+
+
+test_format = ['ninja']
+if sys.platform in ('linux2', 'darwin'):
+  test_format += ['make']
+
+test = TestGyp.TestGyp(formats=test_format)
+
+# Check default values
+test.run_gyp('make_global_settings_ld.gyp')
+verify_ld_target(test)
+
+
+# Check default values with GYP_CROSSCOMPILE enabled.
+with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1'}):
+  test.run_gyp('make_global_settings_ld.gyp')
+verify_ld_target(test)
+verify_ld_host(test)
+
+
+# Test 'LD' in 'make_global_settings'.
+with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1'}):
+  test.run_gyp('make_global_settings_ld.gyp', '-Dcustom_ld_target=my_ld')
+verify_ld_target(test, ld='my_ld', rel_path=True)
+
+
+# Test 'LD'/'LD.host' in 'make_global_settings'.
+with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1'}):
+  test.run_gyp('make_global_settings_ld.gyp',
+               '-Dcustom_ld_target=my_ld_target1',
+               '-Dcustom_ld_host=my_ld_host1')
+verify_ld_target(test, ld='my_ld_target1', rel_path=True)
+verify_ld_host(test, ld='my_ld_host1', rel_path=True)
+
+
+# Unlike other environment variables such as $AR/$AR_host, $CC/$CC_host,
+# and $CXX/$CXX_host, neither Make generator nor Ninja generator recognizes
+# $LD/$LD_host environment variables as of r1935. This may or may not be
+# intentional, but here we leave a test case to verify this behavior just for
+# the record.
+# If you want to support $LD/$LD_host, please revise the following test case as
+# well as the generator.
+with TestGyp.LocalEnv({'GYP_CROSSCOMPILE': '1',
+                       'LD': 'my_ld_target2',
+                       'LD_host': 'my_ld_host2'}):
+  test.run_gyp('make_global_settings_ld.gyp')
+if test.format == 'make':
+  test.must_not_contain('Makefile', 'my_ld_target2')
+  test.must_not_contain('Makefile', 'my_ld_host2')
+elif test.format == 'ninja':
+  test.must_not_contain('out/Default/build.ninja', 'my_ld_target2')
+  test.must_not_contain('out/Default/build.ninja', 'my_ld_host2')
+
+
+test.pass_test()
diff --git a/test/make_global_settings/ld/make_global_settings_ld.gyp b/test/make_global_settings/ld/make_global_settings_ld.gyp
new file mode 100644
index 0000000..6837c77
--- /dev/null
+++ b/test/make_global_settings/ld/make_global_settings_ld.gyp
@@ -0,0 +1,29 @@
+# Copyright (c) 2014 Google Inc. All rights reserved.
+# Use of this source code is governed by a BSD-style licence that can be
+# found in the LICENSE file.
+
+{
+  'variables': {
+    'custom_ld_target%': '',
+    'custom_ld_host%': '',
+  },
+  'conditions': [
+    ['"<(custom_ld_target)"!=""', {
+      'make_global_settings': [
+        ['LD', '<(custom_ld_target)'],
+      ],
+    }],
+    ['"<(custom_ld_host)"!=""', {
+      'make_global_settings': [
+        ['LD.host', '<(custom_ld_host)'],
+      ],
+    }],
+  ],
+  'targets': [
+    {
+      'target_name': 'make_global_settings_ld_test',
+      'type': 'static_library',
+      'sources': [ 'foo.c' ],
+    },
+  ],
+}
diff --git a/test/msvs/config_attrs/hello.c b/test/msvs/config_attrs/hello.c
index 5a8072d..faadc75 100644
--- a/test/msvs/config_attrs/hello.c
+++ b/test/msvs/config_attrs/hello.c
@@ -4,8 +4,8 @@
 
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello, world!\n");
   return 0;
-}
\ No newline at end of file
+}
diff --git a/test/msvs/external_builder/hello.cpp b/test/msvs/external_builder/hello.cpp
index 69acc38..bc0c026 100644
--- a/test/msvs/external_builder/hello.cpp
+++ b/test/msvs/external_builder/hello.cpp
@@ -4,7 +4,7 @@
 
 #include <stdio.h>
 
-int main(int argc, char *argv[]) {
+int main(void) {
   printf("Hello, world!\n");
   return 0;
 }
diff --git a/test/msvs/list_excluded/hello.cpp b/test/msvs/list_excluded/hello.cpp
index 69acc38..bc0c026 100644
--- a/test/msvs/list_excluded/hello.cpp
+++ b/test/msvs/list_excluded/hello.cpp
@@ -4,7 +4,7 @@
 
 #include <stdio.h>
 
-int main(int argc, char *argv[]) {
+int main(void) {
   printf("Hello, world!\n");
   return 0;
 }
diff --git a/test/msvs/props/hello.c b/test/msvs/props/hello.c
index b41318d..faadc75 100644
--- a/test/msvs/props/hello.c
+++ b/test/msvs/props/hello.c
@@ -4,7 +4,7 @@
 
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello, world!\n");
   return 0;
diff --git a/test/msvs/shared_output/hello.c b/test/msvs/shared_output/hello.c
index 44d1b0d..698e4fd 100644
--- a/test/msvs/shared_output/hello.c
+++ b/test/msvs/shared_output/hello.c
@@ -6,7 +6,7 @@
 
 #include <stdio.h>
 
-int main(int argc, char *argv[]) {
+int main(void) {
   printf("Hello, world!\n");
   return 0;
 }
diff --git a/test/msvs/shared_output/there/there.c b/test/msvs/shared_output/there/there.c
index 44d1b0d..698e4fd 100644
--- a/test/msvs/shared_output/there/there.c
+++ b/test/msvs/shared_output/there/there.c
@@ -6,7 +6,7 @@
 
 #include <stdio.h>
 
-int main(int argc, char *argv[]) {
+int main(void) {
   printf("Hello, world!\n");
   return 0;
 }
diff --git a/test/msvs/uldi2010/hello.c b/test/msvs/uldi2010/hello.c
index 2769093..06e6a02 100644
--- a/test/msvs/uldi2010/hello.c
+++ b/test/msvs/uldi2010/hello.c
@@ -6,7 +6,7 @@
 
 extern int hello2();
 
-int main(int argc, char *argv[]) {
+int main(void) {
   printf("Hello, world!\n");
   hello2();
   return 0;
diff --git a/test/multiple-targets/src/prog1.c b/test/multiple-targets/src/prog1.c
index d55f8af..fbf8d4c 100644
--- a/test/multiple-targets/src/prog1.c
+++ b/test/multiple-targets/src/prog1.c
@@ -2,7 +2,7 @@
 
 extern void common(void);
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("hello from prog1.c\n");
   common();
diff --git a/test/multiple-targets/src/prog2.c b/test/multiple-targets/src/prog2.c
index 760590e..a94b5c1 100644
--- a/test/multiple-targets/src/prog2.c
+++ b/test/multiple-targets/src/prog2.c
@@ -2,7 +2,7 @@
 
 extern void common(void);
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("hello from prog2.c\n");
   common();
diff --git a/test/ninja/chained-dependency/chained.c b/test/ninja/chained-dependency/chained.c
index e4eb5e8..c1ff1a7 100644
--- a/test/ninja/chained-dependency/chained.c
+++ b/test/ninja/chained-dependency/chained.c
@@ -1,5 +1,5 @@
 #include "generated/header.h"
 
-int main(int argc, char** argv) {
+int main(void) {
   return 0;
 }
diff --git a/test/product/hello.c b/test/product/hello.c
index 94798f3..41fdff0 100644
--- a/test/product/hello.c
+++ b/test/product/hello.c
@@ -8,7 +8,7 @@
   return 42;
 }
 
-int main(int argc, char *argv[]) {
+int main(void) {
   printf("Hello, world!\n");
   printf("%d\n", func1());
   return 0;
diff --git a/test/rules-rebuild/src/main.c b/test/rules-rebuild/src/main.c
index bdc5ec8..bd8fbb2 100644
--- a/test/rules-rebuild/src/main.c
+++ b/test/rules-rebuild/src/main.c
@@ -3,7 +3,7 @@
 extern void prog1(void);
 extern void prog2(void);
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from main.c\n");
   prog1();
diff --git a/test/rules/src/subdir1/program.c b/test/rules/src/subdir1/program.c
index 258d7f9..6b11ff9 100644
--- a/test/rules/src/subdir1/program.c
+++ b/test/rules/src/subdir1/program.c
@@ -3,7 +3,7 @@
 extern void function1(void);
 extern void function2(void);
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from program.c\n");
   function1();
diff --git a/test/rules/src/subdir2/program.c b/test/rules/src/subdir2/program.c
index c9ae7cd..e5db175 100644
--- a/test/rules/src/subdir2/program.c
+++ b/test/rules/src/subdir2/program.c
@@ -5,7 +5,7 @@
 
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from program.c\n");
   return 0;
diff --git a/test/rules/src/subdir3/program.c b/test/rules/src/subdir3/program.c
index 94f6c50..c38eead 100644
--- a/test/rules/src/subdir3/program.c
+++ b/test/rules/src/subdir3/program.c
@@ -2,7 +2,7 @@
 
 extern void function3(void);
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from program.c\n");
   function3();
diff --git a/test/rules/src/subdir4/program.c b/test/rules/src/subdir4/program.c
index 4247590..ad647f4 100644
--- a/test/rules/src/subdir4/program.c
+++ b/test/rules/src/subdir4/program.c
@@ -9,7 +9,7 @@
 }
 #endif
 
-int main(int argc, char *argv[])
+int main(void)
 {
   fprintf(stdout, "Hello from program.c\n");
   fflush(stdout);
diff --git a/test/same-source-file-name/src/prog1.c b/test/same-source-file-name/src/prog1.c
index c8940fe..604e2b9 100644
--- a/test/same-source-file-name/src/prog1.c
+++ b/test/same-source-file-name/src/prog1.c
@@ -2,7 +2,7 @@
 
 extern void func(void);
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from prog1.c\n");
   func();
diff --git a/test/same-source-file-name/src/prog2.c b/test/same-source-file-name/src/prog2.c
index e6605c2..466ee35 100644
--- a/test/same-source-file-name/src/prog2.c
+++ b/test/same-source-file-name/src/prog2.c
@@ -2,7 +2,7 @@
 
 extern void func(void);
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from prog2.c\n");
   func();
diff --git a/test/same-source-file-name/src/prog3.c b/test/same-source-file-name/src/prog3.c
index a162a98..34d495c 100644
--- a/test/same-source-file-name/src/prog3.c
+++ b/test/same-source-file-name/src/prog3.c
@@ -8,7 +8,7 @@
 extern void subdir1_func(void);
 extern void subdir2_func(void);
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from prog3.c\n");
   func();
diff --git a/test/sibling/src/prog1/prog1.c b/test/sibling/src/prog1/prog1.c
index 161ae8a..218e994 100644
--- a/test/sibling/src/prog1/prog1.c
+++ b/test/sibling/src/prog1/prog1.c
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from prog1.c\n");
   return 0;
diff --git a/test/sibling/src/prog2/prog2.c b/test/sibling/src/prog2/prog2.c
index 7635ae8..12a3188 100644
--- a/test/sibling/src/prog2/prog2.c
+++ b/test/sibling/src/prog2/prog2.c
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from prog2.c\n");
   return 0;
diff --git a/test/standalone-static-library/prog.c b/test/standalone-static-library/prog.c
index dc12b68..8af5c90 100644
--- a/test/standalone-static-library/prog.c
+++ b/test/standalone-static-library/prog.c
@@ -1,6 +1,6 @@
 extern void print(void);
 
-int main(int argc, char *argv[])
+int main(void)
 {
   print();
   return 0;
diff --git a/test/subdirectory/src/prog1.c b/test/subdirectory/src/prog1.c
index 161ae8a..218e994 100644
--- a/test/subdirectory/src/prog1.c
+++ b/test/subdirectory/src/prog1.c
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from prog1.c\n");
   return 0;
diff --git a/test/subdirectory/src/subdir/prog2.c b/test/subdirectory/src/subdir/prog2.c
index 7635ae8..12a3188 100644
--- a/test/subdirectory/src/subdir/prog2.c
+++ b/test/subdirectory/src/subdir/prog2.c
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from prog2.c\n");
   return 0;
diff --git a/test/subdirectory/src/subdir/subdir2/prog3.c b/test/subdirectory/src/subdir/subdir2/prog3.c
index 7cfb0fa..a326dc6 100644
--- a/test/subdirectory/src/subdir/subdir2/prog3.c
+++ b/test/subdirectory/src/subdir/subdir2/prog3.c
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from prog3.c\n");
   return 0;
diff --git a/test/toolsets/main.cc b/test/toolsets/main.cc
index 4904a16..bc47da9 100644
--- a/test/toolsets/main.cc
+++ b/test/toolsets/main.cc
@@ -7,7 +7,7 @@
 const char *GetToolset();
 const char *GetToolsetShared();
 
-int main(int argc, char *argv[]) {
+int main(void) {
   printf("%s\n", GetToolset());
   printf("Shared: %s\n", GetToolsetShared());
 }
diff --git a/test/toplevel-dir/src/sub1/prog1.c b/test/toplevel-dir/src/sub1/prog1.c
index 161ae8a..218e994 100644
--- a/test/toplevel-dir/src/sub1/prog1.c
+++ b/test/toplevel-dir/src/sub1/prog1.c
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from prog1.c\n");
   return 0;
diff --git a/test/toplevel-dir/src/sub2/prog2.c b/test/toplevel-dir/src/sub2/prog2.c
index 7635ae8..12a3188 100644
--- a/test/toplevel-dir/src/sub2/prog2.c
+++ b/test/toplevel-dir/src/sub2/prog2.c
@@ -1,6 +1,6 @@
 #include <stdio.h>
 
-int main(int argc, char *argv[])
+int main(void)
 {
   printf("Hello from prog2.c\n");
   return 0;
diff --git a/test/variables/latelate/src/program.cc b/test/variables/latelate/src/program.cc
index 4c6d6e0..97c98ae 100644
--- a/test/variables/latelate/src/program.cc
+++ b/test/variables/latelate/src/program.cc
@@ -7,7 +7,7 @@
 #include <stdio.h>
 
 
-int main(int argc, char *argv[]) {
+int main(void) {
   printf(FOO "\n");
   return 0;
 }
diff --git a/test/win/generator-output-different-drive/prog.c b/test/win/generator-output-different-drive/prog.c
index 2f855c4..7937f5d 100644
--- a/test/win/generator-output-different-drive/prog.c
+++ b/test/win/generator-output-different-drive/prog.c
@@ -4,7 +4,7 @@
 
 #include <stdio.h>
 
-int main(int argc, char *argv[]) {
+int main(void) {
   printf("Hello from prog.c\n");
   return 0;
 }
diff --git a/test/win/large-pdb/main.cc b/test/win/large-pdb/main.cc
index adf7120..c3da8e9 100644
--- a/test/win/large-pdb/main.cc
+++ b/test/win/large-pdb/main.cc
@@ -2,6 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-int main(int argc, const char** argv) {
+int main(void) {
   return 0;
 }
diff --git a/test/win/precompiled/hello.c b/test/win/precompiled/hello.c
index d1abbb9..ffb47bf 100644
--- a/test/win/precompiled/hello.c
+++ b/test/win/precompiled/hello.c
@@ -7,7 +7,7 @@
 
 extern int hello2();
 
-int main(int argc, char *argv[]) {
+int main(void) {
   printf("Hello, world!\n");
   hello2();
   return 0;