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

Side by Side Diff: src/untrusted/stubs/nacl.scons

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: disable bogus stack_frame.cc test for now 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
« no previous file with comments | « src/untrusted/stubs/crt1_x86_64.S ('k') | tests/startup_message/test_startup.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # -*- python -*- 1 # -*- 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 Import('env') 6 Import('env')
7 import os
7 8
8 # This directory contains untrusted C and ASM source for low-level 9 # This directory contains untrusted C and ASM source for low-level
9 # CPU-specific libraries implicitly supplied by the compiler driver. 10 # CPU-specific libraries implicitly supplied by the compiler driver.
10 # Unlike most untrusted SDK code, conditional compilation may be 11 # Unlike most untrusted SDK code, conditional compilation may be
11 # freely used, as the target will never be PNaCl. 12 # freely used, as the target will never be PNaCl.
12 13
13 def GetPlatformSuffix(env): 14 def GetPlatformSuffix(env):
14 platform = env.get('TARGET_FULLARCH') 15 platform = env.get('TARGET_FULLARCH')
15 assert platform in ['x86-32', 'x86-64', 'arm'] 16 assert platform in ['x86-32', 'x86-64', 'arm']
16 # we do not like hyphens in file names 17 # we do not like hyphens in file names
17 return platform.replace('-', '_') 18 return platform.replace('-', '_')
18 19
19 platform = GetPlatformSuffix(env) 20 platform = GetPlatformSuffix(env)
20 21
22 native_env = env.Clone()
23 if native_env.Bit('bitcode'):
24 native_env.PNaClForceNative()
21 25
22 if env.Bit('bitcode'): 26 # This is a dummy linker script (a source file), not an actual object file.
23 # NOTE: we make sure everything in this directory gets compiled 27 # Note that even for the bitcode case we call it crt1.o rather than crt1.bc,
24 # all the way down into native code. 28 # just because of the tradition of using that exact name in linking rules.
25 # This is tricky in the pnacl case where a .c file would 29 crt1 = env.InstallAs('crt1.o', 'crt1.x')
26 # normally compiled into a bitcode file. 30 env.AddObjectToSdk([crt1])
27 env.Replace(OBJSUFFIX='.o')
28 env.Append(ASFLAGS=['-arch', '${TARGET_FULLARCH}'])
29 env.Append(CCFLAGS=['-arch', '${TARGET_FULLARCH}',
30 '--pnacl-allow-translate'])
31 31
32 32 # TODO(mcgrathr): The multilib in the gcc driver logic defeats -Bx/ under -m32.
33 # the nacl-gcc toolchain does not want to switch to using 33 # Figure out a way to make -B really override everything else.
34 # src/untrusted/startup/nacl_startup.c 34 if platform == 'x86_32':
35 # c.f. http://code.google.com/p/nativeclient/issues/detail?id=651 35 env.Install(os.path.join('${LIB_DIR}', '32'), crt1)
36 if env.Bit('bitcode'):
37 crt1 = env.ComponentObject('crt1', ['crt1_%s.S' % platform])
38 else:
39 crt1 = env.ComponentObject('crt1', ['crt1_x86.S'])
40
41 if env.Bit('bitcode'):
42 bookends = []
43 else:
44 bookends = [env.ComponentObject('crti', ['crti_%s.S' % platform]),
45 env.ComponentObject('crtn', ['crtn_%s.S' % platform])]
46 36
47 # NOTE: we only provide setjmp/longjmp for pnacl, nacl-gcc obtains 37 # NOTE: we only provide setjmp/longjmp for pnacl, nacl-gcc obtains
48 # them from newlib, while pnacl's newlib is arch neutral 38 # them from newlib, while pnacl's newlib is arch neutral
49 platform_objs = [] 39 platform_objs = []
50 40
51 if env.Bit('bitcode'): 41 if env.Bit('bitcode'):
52 platform_objs.append(env.StaticObject('setjmp.o', ['setjmp_%s.S' % platform])) 42 bookends = []
43 platform_objs.append(native_env.StaticObject('setjmp.o',
44 ['setjmp_%s.S' % platform]))
45 else:
46 bookends = [native_env.ComponentObject('crti', ['crti_%s.S' % platform]),
47 native_env.ComponentObject('crtn', ['crtn_%s.S' % platform])]
53 48
54 if env.Bit('target_arm'): 49 if env.Bit('target_arm'):
55 platform_objs.append('aeabi_read_tp.S') 50 platform_objs.append('aeabi_read_tp.S')
56 51
57 crt_platform = env.StaticLibrary('crt_platform', platform_objs) 52 crt_platform = native_env.StaticLibrary('crt_platform', platform_objs)
58 53
59 env.AddObjectToSdk([crt1, crt_platform] + bookends, is_platform=True) 54 native_env.AddObjectToSdk([crt_platform] + bookends, is_platform=True)
OLDNEW
« no previous file with comments | « src/untrusted/stubs/crt1_x86_64.S ('k') | tests/startup_message/test_startup.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698