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

Side by Side Diff: ports/pnacl/compiler_wrapper.py

Issue 1607793004: Update pnacl toolchain version (Closed) Base URL: https://chromium.googlesource.com/webports.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « ports/pnacl/build.sh ('k') | ports/pnacl/hello.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2016 The Native Client Authors. All rights reserved. 2 # Copyright (c) 2016 The Native Client Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Compiler wrapper for injecting extra libs at the end of the link 6 """Compiler wrapper for injecting extra libs at the end of the link
7 line. 7 line.
8 8
9 This is used rather than just setting LDFLAGS/LIBS becuase setting 9 This is used rather than just setting LDFLAGS/LIBS becuase setting
10 LIBS/LDFLAGS will effect both host and target builds. 10 LIBS/LDFLAGS will effect both host and target builds.
11 """ 11 """
12 12
13 import os 13 import os
14 import subprocess 14 import subprocess
15 import sys 15 import sys
16 16
17 cmd = sys.argv[1:] 17 cmd = sys.argv[1:]
18 18
19 # Add extra libs when linking 19 is_configuring = 'conftest.c' in cmd or 'conftest.pexe' in cmd
20 is_linking = '-c' not in cmd and '-E' not in cmd 20 is_linking = '-c' not in cmd and '-E' not in cmd
21 if is_linking: 21 is_shared = '-shared' in cmd
22 cmd += os.environ['EXTRA_LIBS'].split() 22
23 # Add extra libs when linking executables
24 if is_linking and not is_shared:
25 cmd += os.environ['WEBPORTS_EXTRA_LIBS'].split()
26
27 if is_configuring:
28 cmd.remove('-include')
29 cmd.remove('spawn.h')
23 30
24 sys.exit(subprocess.call(cmd)) 31 sys.exit(subprocess.call(cmd))
OLDNEW
« no previous file with comments | « ports/pnacl/build.sh ('k') | ports/pnacl/hello.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698