Browse Source

backports

Frank-Rainer Grahl 1 month ago
parent
commit
cbcd502ca9

+ 79 - 0
mozilla-release/patches/1651207-80a1.patch

@@ -0,0 +1,79 @@
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1594297256 0
+# Node ID 6675dd827c46b23c1a58cb3205bbe94ce3d15d0e
+# Parent  189b890a81b7ceea654ae037a056366c12d06220
+Bug 1651207 - Build the ICU data through an assembly file. r=froydnj
+
+... instead of a C file. This avoids issues with sccache (via dist or
+caching), because sccache doesn't do anything with assembly files,
+but with a C file, it doesn't know about the incbin-included data file.
+
+This has the unfortunate side effect of requiring some manual work to
+mark the file for safeseh on 32-bits Windows.
+
+Differential Revision: https://phabricator.services.mozilla.com/D82814
+
+diff --git a/config/external/icu/data/icudata.c b/config/external/icu/data/icu_data.S
+rename from config/external/icu/data/icudata.c
+rename to config/external/icu/data/icu_data.S
+--- a/config/external/icu/data/icudata.c
++++ b/config/external/icu/data/icu_data.S
+@@ -1,21 +1,24 @@
+ /* This Source Code Form is subject to the terms of the Mozilla Public
+  * License, v. 2.0. If a copy of the MPL was not distributed with this
+  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+ 
+-#ifdef __APPLE__
+-#  define RODATA ".data\n.const"
+-#else
+-#  define RODATA ".section .rodata"
++#if defined(_WIN32) && defined(__i386__)
++// Mark the object as SAFESEH-enabled.
++.def @feat.00;
++.scl 3;
++.type 0;
++.endef
++.global @feat.00
++.set @feat.00, 1
+ #endif
+ 
+-#define DATA(sym, file) DATA2(sym, file)
+-// clang-format off
+-#define DATA2(sym, file)              \
+-  __asm__(".global " #sym "\n"        \
+-          RODATA "\n"                 \
+-          ".balign 16\n"              \
+-          #sym ":\n"                  \
+-          "    .incbin " #file "\n")
+-// clang-format on
+-
+-DATA(ICU_DATA_SYMBOL, ICU_DATA_FILE);
++.global ICU_DATA_SYMBOL
++#ifdef __APPLE__
++.data
++.const
++#else
++.section .rodata
++#endif
++.balign 16
++ICU_DATA_SYMBOL:
++    .incbin ICU_DATA_FILE
+diff --git a/config/external/icu/data/moz.build b/config/external/icu/data/moz.build
+--- a/config/external/icu/data/moz.build
++++ b/config/external/icu/data/moz.build
+@@ -27,10 +27,13 @@ if CONFIG['OS_TARGET'] == 'WINNT' and CO
+     SOURCES += [
+         'icudata.s',
+     ]
+ else:
+     DEFINES['ICU_DATA_FILE'] = data_file
+     DEFINES['ICU_DATA_SYMBOL'] = data_symbol
+ 
+     SOURCES += [
+-        'icudata.c',
++        'icu_data.S',
+     ]
++
++if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['CC_TYPE'] == 'clang-cl':
++    USE_INTEGRATED_CLANGCL_AS = True

+ 80 - 0
mozilla-release/patches/1651305-80a1.patch

@@ -0,0 +1,80 @@
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1594216407 0
+# Node ID 38443050a4947c2769c656e87d49fc6bcb4d217a
+# Parent  8dc91932c0b801d1b4e3092b31c4680b939fa5a4
+Bug 1651305 - Simplify how USE_INTEGRATED_CLANGCL_AS is handled. r=froydnj
+
+The current setup sets /some/ flags via CLANGCL_ASFLAGS (handling of x86
+is notably missing, for instance), and uses "clang-cl" as the assembler,
+assuming it's in $PATH.
+
+This can be simplified by just using `CC`, which will contain the full
+path to "clang-cl" and the right flags for the targets, which makes
+CLANGCL_ASFLAGS unnecessary.
+
+Differential Revision: https://phabricator.services.mozilla.com/D82660
+
+diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolchain.configure
+--- a/build/moz.configure/toolchain.configure
++++ b/build/moz.configure/toolchain.configure
+@@ -2218,29 +2218,16 @@ def have_yasm(yasm_asflags):
+ 
+ set_config('HAVE_NASM', have_nasm)
+ 
+ set_config('HAVE_YASM', have_yasm)
+ # Until the YASM variable is not necessary in old-configure.
+ add_old_configure_assignment('YASM', have_yasm)
+ 
+ 
+-# clang-cl integrated assembler support
+-# ==============================================================
+-@depends(target)
+-def clangcl_asflags(target):
+-    asflags = None
+-    if target.os == 'WINNT' and target.cpu == 'aarch64':
+-        asflags = ['--target=aarch64-windows-msvc']
+-    return asflags
+-
+-
+-set_config('CLANGCL_ASFLAGS', clangcl_asflags)
+-
+-
+ # Code Coverage
+ # ==============================================================
+ 
+ js_option('--enable-coverage', env='MOZ_CODE_COVERAGE',
+           help='Enable code coverage')
+ 
+ @depends('--enable-coverage')
+ def code_coverage(value):
+diff --git a/python/mozbuild/mozbuild/frontend/emitter.py b/python/mozbuild/mozbuild/frontend/emitter.py
+--- a/python/mozbuild/mozbuild/frontend/emitter.py
++++ b/python/mozbuild/mozbuild/frontend/emitter.py
+@@ -1328,24 +1328,21 @@ class TreeMetadataEmitter(LoggingMixin):
+                 raise SandboxValidationError('nasm is not available', context)
+             passthru.variables['AS'] = nasm
+             passthru.variables['AS_DASH_C_FLAG'] = ''
+             passthru.variables['ASOUTOPTION'] = '-o '
+             computed_as_flags.resolve_flags('OS',
+                                             context.config.substs.get('NASM_ASFLAGS', []))
+ 
+         if context.get('USE_INTEGRATED_CLANGCL_AS') is True:
+-            clangcl = context.config.substs.get('CLANG_CL')
+-            if not clangcl:
++            if context.config.substs.get('CC_TYPE') != 'clang-cl':
+                 raise SandboxValidationError('clang-cl is not available', context)
+-            passthru.variables['AS'] = 'clang-cl'
++            passthru.variables['AS'] = context.config.substs.get('CC')
+             passthru.variables['AS_DASH_C_FLAG'] = '-c'
+             passthru.variables['ASOUTOPTION'] = '-o '
+-            computed_as_flags.resolve_flags('OS',
+-                                            context.config.substs.get('CLANGCL_ASFLAGS', []))
+ 
+         if passthru.variables:
+             yield passthru
+ 
+         if context.objdir in self._compile_dirs:
+             self._compile_flags[context.objdir] = computed_flags
+             yield computed_link_flags
+ 

+ 8 - 8
mozilla-release/patches/1692940-02-88a1.patch

@@ -3,7 +3,7 @@
 # Date 1614043603 0
 #      Tue Feb 23 01:26:43 2021 +0000
 # Node ID a22f5d28effbce01de85f81f00339389727e29ff
-# Parent  9d7ea1896cd11743c773a1d72b1e00161c0632d8
+# Parent  e06a443a0fe44fb57060add4e0f543b001da5c06
 Bug 1692940 - Change the logic to check for nasm. r=firefox-build-system-reviewers,dmajor
 
 Instead of preemptively check for it, and then check if it's good enough to
@@ -65,13 +65,13 @@ diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolc
 -set_config('NASM_ASFLAGS', nasm_asflags)
 -
  
- # clang-cl integrated assembler support
+ # Code Coverage
  # ==============================================================
- @depends(target)
- def clangcl_asflags(target):
-     asflags = None
-     if target.os == 'WINNT' and target.cpu == 'aarch64':
-         asflags = ['--target=aarch64-windows-msvc']
+ 
+ js_option('--enable-coverage', env='MOZ_CODE_COVERAGE',
+           help='Enable code coverage')
+ 
+ @depends('--enable-coverage')
 diff --git a/toolkit/moz.configure b/toolkit/moz.configure
 --- a/toolkit/moz.configure
 +++ b/toolkit/moz.configure
@@ -113,7 +113,7 @@ diff --git a/toolkit/moz.configure b/toolkit/moz.configure
  set_define('MOZ_AV1', av1)
  
  # Built-in fragmented MP4 support.
-@@ -1533,16 +1534,92 @@ def valid_yasm_version(yasm_version, for
+@@ -1494,16 +1495,92 @@ def valid_yasm_version(yasm_version, for
      by_version = sorted(versioned.items(), key=lambda x: x[1])
      if by_version:
          what, version = by_version[-1]

+ 7 - 7
mozilla-release/patches/1692945-2-87a1.patch

@@ -2,7 +2,7 @@
 # User Mike Hommey <mh+mozilla@glandium.org>
 # Date 1613510226 0
 # Node ID 44e6140070a0b4088e1ca8017611af569e57c6d7
-# Parent  4e0e7d9feca0f1152637d1add13c3d145d5eca46
+# Parent  52724e40d03a347983b69077caeb874dd22c099b
 Bug 1692945 - Remove unused [YN]ASM variables. r=firefox-build-system-reviewers,andi,dmajor
 
 None of HAVE_NASM, HAVE_YASM, NASM_MAJOR_VERSION and NASM_MINOR_VERSION are
@@ -71,10 +71,10 @@ diff --git a/build/moz.configure/toolchain.configure b/build/moz.configure/toolc
 -add_old_configure_assignment('YASM', have_yasm)
 -
  
- # clang-cl integrated assembler support
+ # Code Coverage
  # ==============================================================
- @depends(target)
- def clangcl_asflags(target):
-     asflags = None
-     if target.os == 'WINNT' and target.cpu == 'aarch64':
-         asflags = ['--target=aarch64-windows-msvc']
+ 
+ js_option('--enable-coverage', env='MOZ_CODE_COVERAGE',
+           help='Enable code coverage')
+ 
+ @depends('--enable-coverage')

+ 2 - 0
mozilla-release/patches/series

@@ -7370,6 +7370,8 @@ TOP-NOBUG-blockquad0-25319.patch
 1585359-71a1.patch
 1525393-1-75a1.patch
 1650299-80a1.patch
+1651305-80a1.patch
+1651207-80a1.patch
 1656063-81a1.patch
 1669888-83a1.patch
 1692945-1-87a1.patch