aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn/ar.py
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2016-11-06 11:20:09 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-07 14:19:32 +0000
commit44b36a210462dbc8c62bf705d002dbba591c8e7f (patch)
tree71f2a805d132f6b6a7b8f5f98c4b6d4194ca179d /gn/ar.py
parent4b6b503c06655d0d0f7245315ff234e9e5a7b616 (diff)
GN: quiet alink spam on Mac
When building on Mac you see lots of spam about object files with no symbols when linking libskia.a. This filters them out. We have to do this in a Python script anyway, so I've consolidated into the existing gn/ar.py. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4447 Change-Id: I9b18051ba687ec1fcf464a87a8a5929d29c70f24 Reviewed-on: https://skia-review.googlesource.com/4447 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'gn/ar.py')
-rw-r--r--gn/ar.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/gn/ar.py b/gn/ar.py
index dc3ae8d948..c7ffb04f67 100644
--- a/gn/ar.py
+++ b/gn/ar.py
@@ -15,4 +15,16 @@ ar, output, rspfile = sys.argv[1:]
if os.path.exists(output):
os.remove(output)
-sys.exit(subprocess.call([ar, "rcs", output, "@" + rspfile]))
+
+if sys.platform != 'darwin':
+ sys.exit(subprocess.call([ar, "rcs", output, "@" + rspfile]))
+
+# Mac ar doesn't support @rspfile syntax.
+objects = open(rspfile).read().split()
+# It also spams stderr with warnings about objects having no symbols.
+pipe = subprocess.Popen([ar, "rcs", output] + objects, stderr=subprocess.PIPE)
+_, err = pipe.communicate()
+for line in err.splitlines():
+ if 'has no symbols' not in line:
+ sys.stderr.write(line + '\n')
+sys.exit(pipe.returncode)