Commit d30089b1 authored by Nelson Billing's avatar Nelson Billing Committed by Commit Bot

Suppress output from the dwp tool in link scripts.

- The output doesn't seem useful. When data is missing the tool
segfaults rather than printing a message.

Bug: 1122182
Change-Id: I46842793e831b02d169f8d3acc4fa82de3f77951
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2521846
Commit-Queue: Nelson Billing <nbilling@google.com>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824913}
parent 1d4a9717
......@@ -52,7 +52,9 @@ def main():
args.dwp, '-e', args.unstripped_output, '-o',
args.unstripped_output + '.dwp'
]
subprocess.check_call(dwp_args)
# Suppress output here because it doesn't seem to be useful. The most
# common error is a segfault, which will happen if files are missing.
subprocess.check_output(dwp_args, stderr=subprocess.STDOUT)
if __name__ == '__main__':
......
......@@ -68,15 +68,18 @@ def main():
exe_file = args.output
if args.unstripped_file:
exe_file = args.unstripped_file
dwp_proc = subprocess.Popen(
wrapper_utils.CommandToRun(
[args.dwp, '-e', exe_file, '-o', exe_file + '.dwp']))
# Suppress output here because it doesn't seem to be useful. The most
# common error is a segfault, which will happen if files are missing.
with open(os.devnull, "w") as devnull:
dwp_proc = subprocess.Popen(wrapper_utils.CommandToRun(
[args.dwp, '-e', exe_file, '-o', exe_file + '.dwp']),
stdout=devnull,
stderr=subprocess.STDOUT)
# Finally, strip the linked executable (if desired).
if args.strip:
result = subprocess.call(CommandToRun([
args.strip, '-o', args.output, args.unstripped_file
]))
result = subprocess.call(
CommandToRun([args.strip, '-o', args.output, args.unstripped_file]))
if dwp_proc:
dwp_result = dwp_proc.wait()
......
......@@ -164,9 +164,13 @@ def main():
# If dwp is set, then package debug info for this SO.
dwp_proc = None
if args.dwp:
dwp_proc = subprocess.Popen(
wrapper_utils.CommandToRun(
[args.dwp, '-e', args.sofile, '-o', args.sofile + '.dwp']))
# Suppress output here because it doesn't seem to be useful. The most
# common error is a segfault, which will happen if files are missing.
with open(os.devnull, "w") as devnull:
dwp_proc = subprocess.Popen(wrapper_utils.CommandToRun(
[args.dwp, '-e', args.sofile, '-o', args.sofile + '.dwp']),
stdout=devnull,
stderr=subprocess.STDOUT)
# Next, generate the contents of the TOC file.
result, toc = CollectTOC(args)
......
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