|
@@ -0,0 +1,92 @@
|
|
|
+# HG changeset patch
|
|
|
+# User Bill Gianopoulos <wgianopoulos@gmail.com>
|
|
|
+# Date 1583764237 14400
|
|
|
+# Mon Mar 09 10:30:37 2020 -0400
|
|
|
+# Node ID c55f266292f6361ef29d511f61a82ef5b091f40e
|
|
|
+# Parent bbfb416e44d2dfe02c77242f7bcb841481b3106c
|
|
|
+Bug 9999999 - Always run library checks if MOZ_SUITE is defined and make library check errors non-fatal unless --enable-stdcxx-compat is specified.
|
|
|
+
|
|
|
+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
|
|
|
+@@ -17,18 +17,28 @@ from mozbuild.util import memoize
|
|
|
+ from mozpack.executables import (
|
|
|
+ get_type,
|
|
|
+ ELF,
|
|
|
+ MACHO,
|
|
|
+ UNKNOWN,
|
|
|
+ )
|
|
|
+
|
|
|
+
|
|
|
+-STDCXX_MAX_VERSION = Version('3.4.17')
|
|
|
+-GLIBC_MAX_VERSION = Version('2.12')
|
|
|
++# Run library tests even if --enable-stdcxx-compat is not specified.
|
|
|
++# For SeaMonkey builds what you specify here will be overriden and forced true.
|
|
|
++RUN_LIBTESTS = False
|
|
|
++
|
|
|
++MOZ_SUITE = buildconfig.substs.get('MOZ_SUITE')
|
|
|
++if MOZ_SUITE:
|
|
|
++ RUN_LIBTESTS = True
|
|
|
++ STDCXX_MAX_VERSION = Version('3.4.19')
|
|
|
++ GLIBC_MAX_VERSION = Version('2.17')
|
|
|
++else:
|
|
|
++ STDCXX_MAX_VERSION = Version('3.4.17')
|
|
|
++ GLIBC_MAX_VERSION = Version('2.12')
|
|
|
+ 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',
|
|
|
+ }
|
|
|
+@@ -287,17 +291,17 @@ def check_networking(binary):
|
|
|
+
|
|
|
+
|
|
|
+ def checks(target, binary):
|
|
|
+ # The clang-plugin is built as target but is really a host binary.
|
|
|
+ # Cheat and pretend we were passed the right argument.
|
|
|
+ if 'clang-plugin' in binary:
|
|
|
+ target = HOST
|
|
|
+ checks = []
|
|
|
+- if target['MOZ_LIBSTDCXX_VERSION']:
|
|
|
++ if target['MOZ_LIBSTDCXX_VERSION'] or RUN_LIBTESTS:
|
|
|
+ checks.append(check_stdcxx)
|
|
|
+ checks.append(check_libgcc)
|
|
|
+ checks.append(check_glibc)
|
|
|
+
|
|
|
+ # Disabled for local builds because of readelf performance: See bug 1472496
|
|
|
+ if not buildconfig.substs.get('DEVELOPER_OPTIONS'):
|
|
|
+ checks.append(check_textrel)
|
|
|
+ checks.append(check_pt_load)
|
|
|
+@@ -309,20 +312,26 @@ def checks(target, binary):
|
|
|
+ try:
|
|
|
+ name = c.__name__
|
|
|
+ c(target, binary)
|
|
|
+ if buildconfig.substs.get('MOZ_AUTOMATION'):
|
|
|
+ print('TEST-PASS | {} | {}'.format(name, basename))
|
|
|
+ except Skip:
|
|
|
+ pass
|
|
|
+ except RuntimeError as e:
|
|
|
+- print('TEST-UNEXPECTED-FAIL | {} | {} | {}'
|
|
|
+- .format(name, basename, str(e)),
|
|
|
+- file=sys.stderr)
|
|
|
+- retcode = 1
|
|
|
++ if target['MOZ_LIBSTDCXX_VERSION'] or (name != 'check_stdcxx' \
|
|
|
++ and name != 'check_libgcc' and name != 'check_glibc'):
|
|
|
++ print('TEST-UNEXPECTED-FAIL | {} | {} | {}'
|
|
|
++ .format(name, basename, str(e)),
|
|
|
++ file=sys.stderr)
|
|
|
++ retcode = 1
|
|
|
++ else:
|
|
|
++ print('TEST-NOTICE CHECK USED LIBRARY VERSION | {} | {} | {}'
|
|
|
++ .format(name, basename, str(e)),
|
|
|
++ file=sys.stderr)
|
|
|
+ return retcode
|
|
|
+
|
|
|
+
|
|
|
+ def main(args):
|
|
|
+ parser = argparse.ArgumentParser(
|
|
|
+ description='Check built binaries')
|
|
|
+
|
|
|
+ parser.add_argument('--host', action='store_true',
|