taskcluster/scripts/misc/gn.patch
author Gregory Szorc <gps@mozilla.com>
Wed, 09 May 2018 14:36:45 -0700
changeset 818149 2f346200eee8f6576823c84526081c34b2b13be2
parent 656566 4228b24f255939968e738cc42f2b28d5130f06a9
permissions -rw-r--r--
Bug 1460650 - Rename sixgill task name so it has "gcc" in it; r=nalexander Mainly so searching "toolchain" + "gcc" yields something useful in the taskgraph. MozReview-Commit-ID: HWiT3AwwYQ2

diff --git a/bootstrap/bootstrap.py b/bootstrap/bootstrap.py
index ff2ae57..7e12436 100755
--- a/bootstrap/bootstrap.py
+++ b/bootstrap/bootstrap.py
@@ -29,9 +29,10 @@ BOOTSTRAP_DIR = os.path.dirname(os.path.abspath(__file__))
 GN_ROOT = os.path.dirname(BOOTSTRAP_DIR)
 SRC_ROOT = os.path.dirname(os.path.dirname(GN_ROOT))
 
+is_mac_cross = os.environ.get('MAC_CROSS', False)
 is_win = sys.platform.startswith('win')
-is_linux = sys.platform.startswith('linux')
-is_mac = sys.platform.startswith('darwin')
+is_linux = sys.platform.startswith('linux') and not is_mac_cross
+is_mac = sys.platform.startswith('darwin') or is_mac_cross
 is_aix = sys.platform.startswith('aix')
 is_posix = is_linux or is_mac or is_aix
 
@@ -595,7 +596,6 @@ def write_gn_ninja(path, root_gen_dir, options):
         'base/synchronization/condition_variable_posix.cc',
         'base/synchronization/lock_impl_posix.cc',
         'base/synchronization/read_write_lock_posix.cc',
-        'base/synchronization/waitable_event_posix.cc',
         'base/sys_info_posix.cc',
         'base/task_scheduler/task_tracker_posix.cc',
         'base/threading/platform_thread_internal_posix.cc',
@@ -603,10 +603,19 @@ def write_gn_ninja(path, root_gen_dir, options):
         'base/threading/thread_local_storage_posix.cc',
         'base/threading/worker_pool_posix.cc',
         'base/time/time_conversion_posix.cc',
+    ])
+
+    if not is_mac:
+      static_libraries['base']['sources'].extend([
+        'base/synchronization/waitable_event_posix.cc',
         'base/time/time_exploded_posix.cc',
         'base/time/time_now_posix.cc',
-        'base/trace_event/heap_profiler_allocation_register_posix.cc',
+      ])
+
+    static_libraries['base']['sources'].extend([
+      'base/trace_event/heap_profiler_allocation_register_posix.cc',
     ])
+
     static_libraries['libevent'] = {
         'sources': [
             'base/third_party/libevent/buffer.c',
@@ -685,6 +694,7 @@ def write_gn_ninja(path, root_gen_dir, options):
         'base/mac/call_with_eh_frame.cc',
         'base/mac/call_with_eh_frame_asm.S',
         'base/mac/foundation_util.mm',
+        'base/mac/mac_util.mm',
         'base/mac/mach_logging.cc',
         'base/mac/scoped_mach_port.cc',
         'base/mac/scoped_mach_vm.cc',
@@ -697,6 +707,7 @@ def write_gn_ninja(path, root_gen_dir, options):
         'base/process/process_iterator_mac.cc',
         'base/process/process_metrics_mac.cc',
         'base/strings/sys_string_conversions_mac.mm',
+        'base/synchronization/waitable_event_mac.cc',
         'base/sys_info_mac.mm',
         'base/time/time_mac.cc',
         'base/threading/platform_thread_mac.mm',
@@ -735,6 +746,7 @@ def write_gn_ninja(path, root_gen_dir, options):
         'base/memory/memory_pressure_monitor_win.cc',
         'base/memory/shared_memory_handle_win.cc',
         'base/memory/shared_memory_win.cc',
+        'base/memory/shared_memory_tracker.cc',
         'base/message_loop/message_pump_win.cc',
         'base/native_library_win.cc',
         'base/power_monitor/power_monitor_device_source_win.cc',
@@ -799,6 +811,7 @@ def write_gn_ninja(path, root_gen_dir, options):
         'version.lib',
         'winmm.lib',
         'ws2_32.lib',
+        'shlwapi.lib',
     ])
 
   # we just build static libraries that GN needs