2 # Copyright (c) 2012 The Native Client Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
9 # This module shouldn't be built in an environment that uses glibc.
10 if env.Bit('nacl_glibc'):
11 raise Exception('src/untrusted/irt/nacl.scons in the wrong environment?')
13 blob_env = env.Clone()
14 blob_env.Append(LINKFLAGS=['-Wl,-Trodata-segment=${IRT_BLOB_DATA_START}',
15 '-Wl,-Ttext-segment=${IRT_BLOB_CODE_START}'])
17 irt_support_sources = [
21 'irt_private_pthread.c',
25 # NACL_GC_WRAP_SYSCALL uses ({...}) syntax.
26 blob_env.FilterOut(CCFLAGS=['-pedantic'])
28 irt_common_interfaces = [
43 'irt_exception_handling.c',
44 'irt_dev_list_mappings.c',
49 # These are the objects and libraries that go into every IRT image.
50 irt_support_objs = [blob_env.ComponentObject(x) for x in
51 (irt_support_sources + irt_common_interfaces)]
53 # We also get nc_init_private.c, nc_thread.c and nc_tsd.c via
54 # #includes of .c files.
56 blob_env.ComponentObject(module,
57 '${MAIN_DIR}/src/untrusted/pthread/%s.c' % module)
58 for module in ['nc_mutex',
62 blob_env.ComponentObject('sys_private',
63 '${MAIN_DIR}/src/untrusted/nacl/sys_private.c'),
64 blob_env.ComponentObject(
65 'dynamic_annotations.o',
66 '${MAIN_DIR}/src/untrusted/valgrind/dynamic_annotations.c'),
69 # Build a library so that irt_support_objs can be used in tests that
70 # cover IRT-internal code.
71 env.ComponentLibrary('libirt_support_private', irt_support_objs)
73 irt_nonbrowser = ['irt_interfaces.c',
74 'irt_core_resource.c',
84 irt_core_raw = blob_env.ComponentProgram(
85 'irt_core_raw', irt_support_objs + irt_nonbrowser, EXTRA_LIBS=irt_libs)
87 irt_core_nexe = blob_env.ApplyTLSEdit(
91 irt_core_library = blob_env.Install('${STAGING_DIR}', irt_core_nexe)
92 blob_env.Alias('irt_core', irt_core_library)
93 blob_env.ComponentProgramAlias(irt_core_library)
95 env.SDKInstallBin('irt_core.nexe', irt_core_library)