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 = [
30 'irt_code_data_alloc.c',
44 'irt_exception_handling.c',
45 'irt_dev_list_mappings.c',
50 # These are the objects and libraries that go into every IRT image.
51 irt_support_objs = [blob_env.ComponentObject(x) for x in
52 (irt_support_sources + irt_common_interfaces)]
54 # We also get nc_init_private.c, nc_thread.c and nc_tsd.c via
55 # #includes of .c files.
57 blob_env.ComponentObject(module,
58 '${MAIN_DIR}/src/untrusted/pthread/%s.c' % module)
59 for module in ['nc_mutex',
63 blob_env.ComponentObject('sys_private',
64 '${MAIN_DIR}/src/untrusted/nacl/sys_private.c'),
65 blob_env.ComponentObject(
66 'dynamic_annotations.o',
67 '${MAIN_DIR}/src/untrusted/valgrind/dynamic_annotations.c'),
70 # Build a library so that irt_support_objs can be used in tests that
71 # cover IRT-internal code.
72 env.ComponentLibrary('libirt_support_private', irt_support_objs)
74 irt_nonbrowser = ['irt_interfaces.c',
76 'irt_core_resource.c',
86 irt_core_raw = blob_env.ComponentProgram(
87 'irt_core_raw', irt_support_objs + irt_nonbrowser, EXTRA_LIBS=irt_libs)
89 irt_core_nexe = blob_env.ApplyTLSEdit(
93 irt_core_library = blob_env.Install('${STAGING_DIR}', irt_core_nexe)
94 blob_env.Alias('irt_core', irt_core_library)
95 blob_env.ComponentProgramAlias(irt_core_library)
97 env.SDKInstallBin('irt_core.nexe', irt_core_library)