Browse Source

backout bug 2526338 to fix bustage

Bill Gianopoulos 2 months ago
parent
commit
02de11d9ac

+ 0 - 74
mozilla-release/patches/1516228-1-66a1.patch

@@ -1,74 +0,0 @@
-# HG changeset patch
-# User Mike Hommey <mh+mozilla@glandium.org>
-# Date 1548344027 0
-# Node ID 8456feb780f7a4b44dc879268e6390aa4f4ce0b1
-# Parent  f638856845113e0d8be636af303895b1b438a581
-Bug 1516228 - Add a configure check for llvm-objdump. r=firefox-build-system-reviewers,mshal
-
-Differential Revision: https://phabricator.services.mozilla.com/D17462
-
-diff --git a/build/moz.configure/init.configure b/build/moz.configure/init.configure
---- a/build/moz.configure/init.configure
-+++ b/build/moz.configure/init.configure
-@@ -4,16 +4,19 @@
- # 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/.
- 
- include('util.configure')
- include('checks.configure')
- 
- # Make `toolkit` available when toolkit/moz.configure is not included.
- toolkit = dependable(None)
-+# Likewise with `bindgen_config_paths` when
-+# build/moz.configure/bindgen.configure is not included.
-+bindgen_config_paths = dependable(None)
- 
- option(env='DIST', nargs=1, help='DIST directory')
- 
- 
- # Do not allow objdir == srcdir builds.
- # ==============================================================
- @depends('--help', 'DIST')
- @imports(_from='__builtin__', _import='open')
-diff --git a/moz.configure b/moz.configure
---- a/moz.configure
-+++ b/moz.configure
-@@ -584,16 +584,38 @@ def nsis_flags(host):
-         return '-nocd'
-     return ''
- 
- set_config('MAKENSISU_FLAGS', nsis_flags)
- 
- check_prog('7Z', ('7z', '7za'), allow_missing=True, when=target_is_windows)
- 
- 
-+@depends(c_compiler, bindgen_config_paths)
-+def llvm_objdump(c_compiler, bindgen_config_paths):
-+    clang = None
-+    if c_compiler and c_compiler.type == 'clang':
-+        clang = c_compiler.compiler
-+    elif c_compiler and c_compiler.type == 'clang-cl':
-+        clang = os.path.join(os.path.dirname(c_compiler.compiler), 'clang')
-+    elif bindgen_config_paths:
-+        clang = bindgen_config_paths.clang_path
-+    llvm_objdump = 'llvm-objdump'
-+    if clang:
-+        out = check_cmd_output(clang, '--print-prog-name=llvm-objdump',
-+                               onerror=lambda: None)
-+        if out:
-+            llvm_objdump = out.rstrip()
-+    return (llvm_objdump,)
-+
-+
-+check_prog('LLVM_OBJDUMP', llvm_objdump, what='llvm-objdump',
-+           when='--enable-compile-environment')
-+
-+
- js_option('--enable-dtrace', help='Build with dtrace support')
- 
- dtrace = check_header('sys/sdt.h', when='--enable-dtrace',
-                       onerror=lambda: die('dtrace enabled but sys/sdt.h not found'))
- 
- set_config('HAVE_DTRACE', True, when=dtrace)
- set_define('INCLUDE_MOZILLA_DTRACE', True, when=dtrace)
- add_old_configure_assignment('enable_dtrace', 'yes', when=dtrace)

+ 0 - 59
mozilla-release/patches/1516228-2no3or4-66a1.patch

@@ -1,59 +0,0 @@
-# HG changeset patch
-# User Mike Hommey <mh+mozilla@glandium.org>
-# Date 1548344458 0
-# Node ID 94dd43dcc7f2e444b8a1b201a84fb082da8b5dcd
-# Parent  a5f4bf2847968d240ecb504180a932603b714aab
-Bug 1516228 - Use llvm-objdump instead of objdump in old-configure. r=mshal
-
-Depends on D17462
-
-Differential Revision: https://phabricator.services.mozilla.com/D17463
-
-diff --git a/build/autoconf/compiler-opts.m4 b/build/autoconf/compiler-opts.m4
---- a/build/autoconf/compiler-opts.m4
-+++ b/build/autoconf/compiler-opts.m4
-@@ -109,17 +109,17 @@ if test "$GNU_CC" -a "$GCC_USE_GNU_LD" -
-         LD_SUPPORTS_ICF,
-         [echo 'int foo() {return 42;}' \
-               'int bar() {return 42;}' \
-               'int main() {return foo() - bar();}' > conftest.${ac_ext}
-         # If the linker supports ICF, foo and bar symbols will have
-         # the same address
-         if AC_TRY_COMMAND([${CC-cc} -o conftest${ac_exeext} $LDFLAGS -Wl,--icf=safe -ffunction-sections conftest.${ac_ext} $LIBS 1>&2]) &&
-            test -s conftest${ac_exeext} &&
--           objdump -t conftest${ac_exeext} | awk changequote(<<, >>)'{a[<<$>>6] = <<$>>1} END {if (a["foo"] && (a["foo"] != a["bar"])) { exit 1 }}'changequote([, ]); then
-+           $LLVM_OBJDUMP -t conftest${ac_exeext} | awk changequote(<<, >>)'{a[<<$>>6] = <<$>>1} END {if (a["foo"] && (a["foo"] != a["bar"])) { exit 1 }}'changequote([, ]); then
-             LD_SUPPORTS_ICF=yes
-         else
-             LD_SUPPORTS_ICF=no
-         fi
-         rm -rf conftest*])
-     if test "$LD_SUPPORTS_ICF" = yes; then
-         _SAVE_LDFLAGS="$LDFLAGS -Wl,--icf=safe"
-         LDFLAGS="$LDFLAGS -Wl,--icf=safe -Wl,--print-icf-sections"
-diff --git a/moz.configure b/moz.configure
---- a/moz.configure
-+++ b/moz.configure
-@@ -602,18 +602,20 @@ def llvm_objdump(c_compiler, bindgen_con
-     if clang:
-         out = check_cmd_output(clang, '--print-prog-name=llvm-objdump',
-                                onerror=lambda: None)
-         if out:
-             llvm_objdump = out.rstrip()
-     return (llvm_objdump,)
- 
- 
--check_prog('LLVM_OBJDUMP', llvm_objdump, what='llvm-objdump',
--           when='--enable-compile-environment')
-+llvm_objdump = check_prog('LLVM_OBJDUMP', llvm_objdump, what='llvm-objdump',
-+                          when='--enable-compile-environment')
-+
-+add_old_configure_assignment('LLVM_OBJDUMP', llvm_objdump)
- 
- 
- js_option('--enable-dtrace', help='Build with dtrace support')
- 
- dtrace = check_header('sys/sdt.h', when='--enable-dtrace',
-                       onerror=lambda: die('dtrace enabled but sys/sdt.h not found'))
- 
- set_config('HAVE_DTRACE', True, when=dtrace)

+ 0 - 290
mozilla-release/patches/1516228-5-66a1.patch

@@ -1,290 +0,0 @@
-# HG changeset patch
-# User Mike Hommey <mh+mozilla@glandium.org>
-# Date 1548372749 0
-# Node ID d1b523e67100557e4adceabe8ca6ea434f6cb5e7
-# Parent  2e12f8ff052c6449f80f0b4fe0cca5fb00a6e313
-Bug 1516228 - Use llvm-objdump for symbol related tests in check_binary.py. r=mshal
-
-Depends on D17466
-
-Differential Revision: https://phabricator.services.mozilla.com/D17467
-
-diff --git a/python/mozbuild/mozbuild/action/check_binary.py b/python/mozbuild/mozbuild/action/check_binary.py
---- a/python/mozbuild/mozbuild/action/check_binary.py
-+++ b/python/mozbuild/mozbuild/action/check_binary.py
-@@ -1,53 +1,54 @@
- # 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/.
- 
- from __future__ import absolute_import, print_function, unicode_literals
- 
- import argparse
- import os
-+import re
- import subprocess
- import sys
- 
- from packaging.version import Version
- 
- import buildconfig
- from mozbuild.util import memoize
- from mozpack.executables import (
-     get_type,
-     ELF,
-     MACHO,
-+    UNKNOWN,
- )
- 
- 
- STDCXX_MAX_VERSION = Version('3.4.19')
- CXXABI_MAX_VERSION = Version('1.3.7')
- GLIBC_MAX_VERSION = Version('2.17')
- LIBGCC_MAX_VERSION = Version('4.8')
- 
- HOST = {
-     'MOZ_LIBSTDCXX_VERSION':
-         buildconfig.substs.get('MOZ_LIBSTDCXX_HOST_VERSION'),
-     'platform': buildconfig.substs['HOST_OS_ARCH'],
-     'readelf': 'readelf',
--    'nm': 'nm',
- }
- 
- TARGET = {
-     'MOZ_LIBSTDCXX_VERSION':
-         buildconfig.substs.get('MOZ_LIBSTDCXX_TARGET_VERSION'),
-     'platform': buildconfig.substs['OS_TARGET'],
-     'readelf': '{}readelf'.format(
-         buildconfig.substs.get('TOOLCHAIN_PREFIX', '')),
--    'nm': '{}nm'.format(buildconfig.substs.get('TOOLCHAIN_PREFIX', '')),
--    'readobj': '{}readobj'.format(buildconfig.substs.get('TOOLCHAIN_PREFIX', '')),
- }
- 
-+ADDR_RE = re.compile(r'[0-9a-f]{8,16}')
-+
- if buildconfig.substs.get('HAVE_64BIT_BUILD'):
-     GUESSED_NSMODULE_SIZE = 8
- else:
-     GUESSED_NSMODULE_SIZE = 4
- 
- 
- get_type = memoize(get_type)
- 
-@@ -71,62 +72,107 @@ def at_least_one(iter):
-     saw_one = False
-     for item in iter:
-         saw_one = True
-         yield item
-     if not saw_one:
-         raise Empty()
- 
- 
--def iter_readelf_symbols(target, binary):
--    for line in get_output(target['readelf'], '-sW', binary):
--        data = line.split()
--        if len(data) >= 8 and data[0].endswith(':') and data[0][:-1].isdigit():
--            n, addr, size, type, bind, vis, index, name = data[:8]
-+# Iterates the symbol table on ELF and MACHO, and the export table on
-+# COFF/PE.
-+def iter_symbols(binary):
-+    ty = get_type(binary)
-+    # XXX: Static libraries on ELF, MACHO and COFF/PE systems are all
-+    # ar archives. So technically speaking, the following is wrong
-+    # but is enough for now. llvm-objdump -t can actually be used on all
-+    # platforms for static libraries, but its format is different for
-+    # Windows .obj files, so the following won't work for them, but
-+    # it currently doesn't matter.
-+    if ty == UNKNOWN and open(binary).read(8) == '!<arch>\n':
-+        ty = ELF
-+    if ty in (ELF, MACHO):
-+        for line in get_output(buildconfig.substs['LLVM_OBJDUMP'], '-t',
-+                               binary):
-+            m = ADDR_RE.match(line)
-+            if not m:
-+                continue
-+            addr = int(m.group(0), 16)
-+            # The second "column" is 7 one-character items that can be
-+            # whitespaces. We don't have use for their value, so just skip
-+            # those.
-+            rest = line[m.end() + 9:].split()
-+            # The number of remaining colums will vary between ELF and MACHO.
-+            # On ELF, we have:
-+            #   Section Size .hidden? Name
-+            # On Macho, the size is skipped.
-+            # In every case, the symbol name is last.
-+            name = rest[-1]
-             if '@' in name:
-                 name, ver = name.rsplit('@', 1)
-                 while name.endswith('@'):
-                     name = name[:-1]
-             else:
-                 ver = None
-             yield {
--                'addr': int(addr, 16),
--                # readelf output may contain decimal values or hexadecimal
--                # values prefixed with 0x for the size. Let python autodetect.
--                'size': int(size, 0),
--                'type': type,
--                'binding': bind,
--                'visibility': vis,
--                'index': index,
-+                'addr': addr,
-+                'size': int(rest[1], 16) if ty == ELF else 0,
-                 'name': name,
--                'version': ver,
-+                'version': ver or None,
-+            }
-+    else:
-+        export_table = False
-+        for line in get_output(buildconfig.substs['LLVM_OBJDUMP'], '-p',
-+                               binary):
-+            if line.strip() == 'Export Table:':
-+                export_table = True
-+                continue
-+            elif not export_table:
-+                continue
-+
-+            cols = line.split()
-+            # The data we're interested in comes in 3 columns, and the first
-+            # column is a number.
-+            if len(cols) != 3 or not cols[0].isdigit():
-+                continue
-+            _, rva, name = cols
-+            # - The MSVC mangling has some type info following `@@`
-+            # - Any namespacing that can happen on the symbol appears as a
-+            #   suffix, after a `@`.
-+            # - Mangled symbols are prefixed with `?`.
-+            name = name.split('@@')[0].split('@')[0].lstrip('?')
-+            yield {
-+                'addr': int(rva, 16),
-+                'size': 0,
-+                'name': name,
-+                'version': None,
-             }
- 
- 
- def iter_readelf_dynamic(target, binary):
-     for line in get_output(target['readelf'], '-d', binary):
-         data = line.split(None, 2)
-         if data and len(data) == 3 and data[0].startswith('0x'):
-             yield data[1].rstrip(')').lstrip('('), data[2]
- 
- 
- def check_dep_versions(target, binary, lib, prefix, max_version):
-     if get_type(binary) != ELF:
-         raise Skip()
-     unwanted = []
-     prefix = prefix + '_'
-     try:
--        for sym in at_least_one(iter_readelf_symbols(target, binary)):
--            if sym['index'] == 'UND' and sym['version'] and \
-+        for sym in at_least_one(iter_symbols(binary)):
-+            if sym['addr'] == 0 and sym['version'] and \
-                     sym['version'].startswith(prefix):
-                 version = Version(sym['version'][len(prefix):])
-                 if version > max_version:
-                     unwanted.append(sym)
-     except Empty:
--        raise RuntimeError('Could not parse readelf output?')
-+        raise RuntimeError('Could not parse llvm-objdump output?')
-     if unwanted:
-         print('\n'.join([
-             'TEST-NOTICE We do not want these {} symbol versions to be used:'.format(lib)
-         ] + [
-             ' {} ({})'.format(s['name'], s['version']) for s in unwanted
-         ]), file=sys.stderr)
- 
- 
-@@ -178,73 +224,35 @@ def check_nsmodules(target, binary):
- 
-     test_msvc = (buildconfig.substs.get('CC_TYPE') in ('msvc', 'clang-cl') and \
-         buildconfig.substs.get('DEVELOPER_OPTIONS'))
-     test_clang_win = (buildconfig.substs.get('CC_TYPE') == 'clang' and \
-         buildconfig.substs.get('OS_ARCH') == 'WINNT')
-     test_gcc_win = (buildconfig.substs.get('CC_TYPE') == 'gcc' and \
-         buildconfig.substs.get('OS_ARCH') == 'WINNT')
- 
--    if buildconfig.substs.get('CC_TYPE') in ('msvc', 'clang-cl'):
--        for line in get_output('dumpbin.exe', '-exports', binary):
--            data = line.split(None, 3)
--            if data and len(data) == 4 and data[0].isdigit() and \
--                    ishex(data[1]) and ishex(data[2]):
--                # - Some symbols in the table can be aliases, and appear as
--                #   `foo = bar`.
--                # - The MSVC mangling has some type info following `@@`
--                # - Any namespacing that can happen on the symbol appears as a
--                #   suffix, after a `@`.
--                # - Mangled symbols are prefixed with `?`.
--                name = data[3].split(' = ')[0].split('@@')[0].split('@')[0] \
--                              .lstrip('?')
--                if name.endswith('_NSModule') or name in (
--                        '__start_kPStaticModules',
--                        '__stop_kPStaticModules'):
--                    symbols.append((int(data[2], 16), GUESSED_NSMODULE_SIZE,
--                                    name))
--    else:
--        # MinGW-Clang, when building pdbs, doesn't include the symbol table into
--        # the final module. To get the NSModule info, we can look at the exported
--        # symbols. (#1475562)
--        if test_clang_win:
--            readobj_output = get_output(target['readobj'], '-coff-exports', binary)
--            # Transform the output of readobj into nm-like output
--            output = []
--            for line in readobj_output:
--                if "Name" in line:
--                    name = line.replace("Name:", "").strip()
--                elif "RVA" in line:
--                    rva = line.replace("RVA:", "").strip()
--                    output.append("%s r %s" % (name, rva))
--        else:
--            output = get_output(target['nm'], '-P', binary)
--
--        for line in output:
--            data = line.split()
--            # Some symbols may not have a size listed at all.
--            if len(data) == 3:
--                data.append('0')
--            if len(data) == 4:
--                sym, _, addr, size = data
--                # NSModules symbols end with _NSModule or _NSModuleE when
--                # C++-mangled.
--                if sym.endswith(('_NSModule', '_NSModuleE')):
--                    if test_gcc_win and any(x in data[0] for x in [".refptr", "_GLOBAL"]):
--                        continue
--                    # On mac, nm doesn't actually print anything other than 0
--                    # for the size. So take our best guess.
--                    size = int(size, 16) or GUESSED_NSMODULE_SIZE
--                    symbols.append((int(addr, 16), size, sym))
--                elif sym.endswith(('__start_kPStaticModules',
--                                   '__stop_kPStaticModules')):
--                    # On ELF and mac systems, these symbols have no size, such
--                    # that the first actual NSModule has the same address as
--                    # the start symbol.
--                    symbols.append((int(addr, 16), 0, sym))
-+    for sym in iter_symbols(binary):
-+        if sym['addr'] == 0:
-+            continue
-+        name = sym['name']
-+        # NSModules symbols end with _NSModule or _NSModuleE when C++-mangled.
-+        if name.endswith(('_NSModule', '_NSModuleE')):
-+            if test_gcc_win and any(x in data[0] for x in [".refptr", "_GLOBAL"]):
-+                continue
-+            # We don't have a valid size in the symbol list for macho and coff.
-+            # Use our guesstimate.
-+            size = sym['size'] or GUESSED_NSMODULE_SIZE
-+            symbols.append((sym['addr'], size, name))
-+        elif name in ('__start_kPStaticModules', '__stop_kPStaticModules'):
-+            # For coff, these symbols have a size.
-+            if get_type(binary) not in (ELF, MACHO):
-+                size = GUESSED_NSMODULE_SIZE
-+            else:
-+                size = 0
-+            symbols.append((sym['addr'], size, name))
-     if not symbols:
-         raise RuntimeError('Could not find NSModules')
- 
-     def print_symbols(symbols):
-         for addr, size, sym in symbols:
-             print('%x %d %s' % (addr, size, sym))
- 
-     symbols = sorted(symbols)

+ 0 - 3
mozilla-release/patches/series

@@ -7226,6 +7226,3 @@ TOP-1909714-NSS3904-11514.patch
 1517077-66a1.patch
 1520149-66a1.patch
 1521133-66a1.patch
-1516228-1-66a1.patch
-1516228-2no3or4-66a1.patch
-1516228-5-66a1.patch