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 # TODO(mseaborn): Enable -Wstrict-prototypes here. Currently
10 # dlmalloc/malloc.c does not build with this warning.
11 env.FilterOut(CFLAGS=['-Wstrict-prototypes'])
13 # This module shouldn't be built in an environment that uses glibc.
14 if env.Bit('nacl_glibc'):
15 raise UserError('src/untrusted/irt/nacl.scons in the wrong environment?')
17 blob_env = env.Clone()
18 blob_env.Append(LINKFLAGS=['-Wl,-Trodata-segment=${IRT_BLOB_DATA_START}',
19 '-Wl,-Ttext-segment=${IRT_BLOB_CODE_START}'])
21 irt_support_sources = [
24 'irt_private_pthread.c',
28 # NACL_GC_WRAP_SYSCALL uses ({...}) syntax.
29 blob_env.FilterOut(CCFLAGS=['-pedantic'])
31 irt_common_interfaces = [
46 'irt_exception_handling.c',
47 'irt_dev_list_mappings.c',
52 # These are the objects and libraries that go into every IRT image.
53 irt_support_objs = [blob_env.ComponentObject(x) for x in
54 (irt_support_sources + irt_common_interfaces)]
56 # We also get nc_init_private.c, nc_thread.c and nc_tsd.c via
57 # #includes of .c files.
59 blob_env.ComponentObject(module,
60 '${MAIN_DIR}/src/untrusted/pthread/%s.c' % module)
61 for module in ['nc_mutex',
65 blob_env.ComponentObject('sys_private',
66 '${MAIN_DIR}/src/untrusted/nacl/sys_private.c'),
67 blob_env.ComponentObject(
68 'dynamic_annotations.o',
69 '${MAIN_DIR}/src/untrusted/valgrind/dynamic_annotations.c'),
72 # Build a library so that irt_support_objs can be used in tests that
73 # cover IRT-internal code.
74 env.ComponentLibrary('libirt_support_private', irt_support_objs)
76 irt_nonbrowser = ['irt_interfaces.c',
77 'irt_core_resource.c',
87 irt_core_raw = blob_env.ComponentProgram(
88 'irt_core_raw', irt_support_objs + irt_nonbrowser, EXTRA_LIBS=irt_libs)
90 irt_core_nexe = blob_env.ApplyTLSEdit(
94 irt_core_library = blob_env.Install('${STAGING_DIR}', irt_core_nexe)
95 blob_env.Alias('irt_core', irt_core_library)
96 blob_env.ComponentProgramAlias(irt_core_library)
98 env.SDKInstallBin('irt_core.nexe', irt_core_library)
100 # TODO(mcgrathr): this should be installed, but scons is a mystery
101 #env.AddHeaderToSdk(['irt.h'])