Commit d69cba2d authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

mac: Keep libtool warning quiet with newer ld64s

Due to innovation in ld64's warning output, some non-interesting
warnings make it past our filters:

warning: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool:
    archive library: clang_x64_v8_arm64/obj/third_party/perfetto/protos/perfetto/common/libzero.a
    the table of contents is empty (no object file members in the library define global symbols)

Innovate right back.

Also make it clear which of these patterns span several lines.

Bug: none
Change-Id: I8542ab4d82005eaa67fae4a7af398ba1ebf8220f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2416830
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarMark Mentovai <mark@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#808021}
parent bae4b28e
...@@ -12,21 +12,27 @@ import sys ...@@ -12,21 +12,27 @@ import sys
# This script executes libool and filters out logspam lines like: # This script executes libool and filters out logspam lines like:
# '/path/to/libtool: file: foo.o has no symbols' # '/path/to/libtool: file: foo.o has no symbols'
BLACKLIST_PATTERNS = [ SUPPRESSED_PATTERNS = [
re.compile(v) for v in [ re.compile(v) for v in [
r'^.*libtool: (?:for architecture: \S* )?file: .* has no symbols$', r'^.*libtool: (?:for architecture: \S* )?file: .* has no symbols$',
r'^.*libtool: warning for library: .* the table of contents is empty ' # Xcode 11 spelling of the "empty archive" warning.
r'\(no object file members in the library define global symbols\)$', # TODO(thakis): Remove once we require Xcode 12.
r'^.*libtool: warning same member name \(\S*\) in output file used for ' r'^.*libtool: warning for library: .* the table of contents is empty ' \
r'input files: \S* and: \S* \(due to use of basename, truncation, ' r'\(no object file members in the library define global symbols\)$',
r'blank padding or duplicate input files\)$', # Xcode 12 spelling of the "empty archive" warning.
r'^warning: .*libtool: archive library: .* ' \
r'the table of contents is empty ',
r'\(no object file members in the library define global symbols\)$',
r'^.*libtool: warning same member name \(\S*\) in output file used ' \
r'for input files: \S* and: \S* \(due to use of basename, ' \
r'truncation, blank padding or duplicate input files\)$',
] ]
] ]
def IsBlacklistedLine(line): def ShouldSuppressLine(line):
"""Returns whether the line should be filtered out.""" """Returns whether the line should be filtered out."""
for pattern in BLACKLIST_PATTERNS: for pattern in SUPPRESSED_PATTERNS:
if pattern.match(line): if pattern.match(line):
return True return True
return False return False
...@@ -37,7 +43,7 @@ def Main(cmd_list): ...@@ -37,7 +43,7 @@ def Main(cmd_list):
libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE, env=env) libtoolout = subprocess.Popen(cmd_list, stderr=subprocess.PIPE, env=env)
_, err = libtoolout.communicate() _, err = libtoolout.communicate()
for line in err.decode('UTF-8').splitlines(): for line in err.decode('UTF-8').splitlines():
if not IsBlacklistedLine(line): if not ShouldSuppressLine(line):
print(line, file=sys.stderr) print(line, file=sys.stderr)
return libtoolout.returncode return libtoolout.returncode
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment