Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1194)

Unified Diff: scripts/macports-gcc-wrapper/wrapper.py

Issue 1596015: Use gcc-mp-4.4 to build TSan on Mac.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/deps/third_party/valgrind/
Patch Set: '' Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « scripts/macports-gcc-wrapper/gcc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/macports-gcc-wrapper/wrapper.py
===================================================================
--- scripts/macports-gcc-wrapper/wrapper.py (revision 0)
+++ scripts/macports-gcc-wrapper/wrapper.py (revision 0)
@@ -0,0 +1,39 @@
+#!/usr/bin/python
+
+# Copyright (c) 2010 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+import os
+import subprocess
+import sys
+
+# This python script wraps gcc-mp-4.X so it can handle
+# compilation options memcheck uses on Mac, including:
+# a) skip "-arch XXX"
+# b) define empty "__private_extern__" macro so it doesn't bark
+# on mac-specific code using this keyword.
+# c) skip "-mno-dynamic-no-pic" and "-mdynamic-no-pic"
+# This may not be a very clean solution in general but it works.
+
+# The gcc command should be passes as an environment variable,
+# e.g. GCC_BINARY_MASK=/opt/local/bin/XXX-mp-4.4
+assert os.environ.has_key("GCC_BINARY_MASK")
+gcc_binary_mask = os.environ["GCC_BINARY_MASK"]
+gcc = gcc_binary_mask.replace("XXX", sys.argv[1])
+
+gcc_command = [gcc, "-D__private_extern__="]
+skip = 0
+for arg in sys.argv[2:]:
+ if skip > 0:
+ skip -= 1
+ continue
+ if arg == "-arch":
+ skip = 1
+ continue
+ if arg == "-mno-dynamic-no-pic":
+ continue
+ if arg == "-mdynamic-no-pic":
+ continue
+ gcc_command.append(arg)
+
+subprocess.call(gcc_command)
« no previous file with comments | « scripts/macports-gcc-wrapper/gcc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698