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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « scripts/macports-gcc-wrapper/gcc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/usr/bin/python
2
3 # Copyright (c) 2010 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
6 import os
7 import subprocess
8 import sys
9
10 # This python script wraps gcc-mp-4.X so it can handle
11 # compilation options memcheck uses on Mac, including:
12 # a) skip "-arch XXX"
13 # b) define empty "__private_extern__" macro so it doesn't bark
14 # on mac-specific code using this keyword.
15 # c) skip "-mno-dynamic-no-pic" and "-mdynamic-no-pic"
16 # This may not be a very clean solution in general but it works.
17
18 # The gcc command should be passes as an environment variable,
19 # e.g. GCC_BINARY_MASK=/opt/local/bin/XXX-mp-4.4
20 assert os.environ.has_key("GCC_BINARY_MASK")
21 gcc_binary_mask = os.environ["GCC_BINARY_MASK"]
22 gcc = gcc_binary_mask.replace("XXX", sys.argv[1])
23
24 gcc_command = [gcc, "-D__private_extern__="]
25 skip = 0
26 for arg in sys.argv[2:]:
27 if skip > 0:
28 skip -= 1
29 continue
30 if arg == "-arch":
31 skip = 1
32 continue
33 if arg == "-mno-dynamic-no-pic":
34 continue
35 if arg == "-mdynamic-no-pic":
36 continue
37 gcc_command.append(arg)
38
39 subprocess.call(gcc_command)
OLDNEW
« 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