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

Side by Side Diff: site_scons/site_tools/naclsdk.py

Issue 7276050: Change startup ABI for untrusted code to be C-compatible (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: Created 9 years, 5 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
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. 2 # Copyright (c) 2011 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 """Nacl SDK tool SCons.""" 6 """Nacl SDK tool SCons."""
7 7
8 import __builtin__ 8 import __builtin__
9 import re 9 import re
10 import os 10 import os
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 CC=GetEnvOrDummy('CC'), 270 CC=GetEnvOrDummy('CC'),
271 CXX=GetEnvOrDummy('CXX'), 271 CXX=GetEnvOrDummy('CXX'),
272 AR=GetEnvOrDummy('AR'), 272 AR=GetEnvOrDummy('AR'),
273 # NOTE: use g++ for linking so we can handle c AND c++ 273 # NOTE: use g++ for linking so we can handle c AND c++
274 LINK=GetEnvOrDummy('LINK'), 274 LINK=GetEnvOrDummy('LINK'),
275 RANLIB=GetEnvOrDummy('RANLIB'), 275 RANLIB=GetEnvOrDummy('RANLIB'),
276 ) 276 )
277 277
278 def PNaClForceNative(env): 278 def PNaClForceNative(env):
279 assert(env.Bit('bitcode')) 279 assert(env.Bit('bitcode'))
280 env.Replace(OBJSUFFIX='.o') 280 env.Replace(OBJSUFFIX='.o',
281 env.Replace(SHLIBSUFFIX='.so') 281 SHLIBSUFFIX='.so')
282 env.Append(CCFLAGS=['-arch', '${TARGET_FULLARCH}', 282 env.Append(ASFLAGS=['-arch', '${TARGET_FULLARCH}'],
283 '--pnacl-allow-translate']) 283 CCFLAGS=['-arch', '${TARGET_FULLARCH}', '--pnacl-allow-translate'],
284 env.Append(LINKFLAGS=['--pnacl-allow-native']) 284 LINKFLAGS=['--pnacl-allow-native'])
285 285
286 # Get an environment for nacl-gcc when in PNaCl mode. 286 # Get an environment for nacl-gcc when in PNaCl mode.
287 def PNaClGetNNaClEnv(env): 287 def PNaClGetNNaClEnv(env):
288 assert(env.Bit('bitcode')) 288 assert(env.Bit('bitcode'))
289 assert(not env.Bit('target_arm')) 289 assert(not env.Bit('target_arm'))
290 290
291 # This is kind of a hack. We clone the environment, 291 # This is kind of a hack. We clone the environment,
292 # clear the bitcode bit, and then reload naclsdk.py 292 # clear the bitcode bit, and then reload naclsdk.py
293 native_env = env.Clone() 293 native_env = env.Clone()
294 native_env.ClearBits('bitcode') 294 native_env.ClearBits('bitcode')
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 # if bitcode=1 use pnacl toolchain 398 # if bitcode=1 use pnacl toolchain
399 if env.Bit('bitcode'): 399 if env.Bit('bitcode'):
400 _SetEnvForPnacl(env, root) 400 _SetEnvForPnacl(env, root)
401 elif env.Bit('target_x86'): 401 elif env.Bit('target_x86'):
402 _SetEnvForX86Sdk(env, root) 402 _SetEnvForX86Sdk(env, root)
403 else: 403 else:
404 print "ERROR: unknown TARGET_ARCHITECTURE: ", env['TARGET_ARCHITECTURE'] 404 print "ERROR: unknown TARGET_ARCHITECTURE: ", env['TARGET_ARCHITECTURE']
405 assert 0 405 assert 0
406 406
407 env.Prepend(LIBPATH='${NACL_SDK_LIB}') 407 env.Prepend(LIBPATH='${NACL_SDK_LIB}')
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698