| OLD | NEW |
| 1 # -*- python -*- | 1 # -*- python -*- |
| 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 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 | 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 | 6 |
| 7 Import('env') | 7 Import('env') |
| 8 | 8 |
| 9 # NACL_GC_WRAP_SYSCALL uses ({...}) syntax. | 9 # NACL_GC_WRAP_SYSCALL uses ({...}) syntax. |
| 10 env.FilterOut(CCFLAGS=['-pedantic']) | 10 env.FilterOut(CCFLAGS=['-pedantic']) |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 'unlink.c', | 56 'unlink.c', |
| 57 'write.c', | 57 'write.c', |
| 58 ] | 58 ] |
| 59 | 59 |
| 60 SRCS_NEWLIB_MISC = [ | 60 SRCS_NEWLIB_MISC = [ |
| 61 'malloc.c', # malloc wrapper | 61 'malloc.c', # malloc wrapper |
| 62 'stacktrace.c', # stack tracing for use with "-finstrument" | 62 'stacktrace.c', # stack tracing for use with "-finstrument" |
| 63 'start.c', # contains _start, preventing us from making this a .so | 63 'start.c', # contains _start, preventing us from making this a .so |
| 64 'nacl_add_tp.c', | 64 'nacl_add_tp.c', |
| 65 'nacl_read_tp.c', | 65 'nacl_read_tp.c', |
| 66 'pthread_initialize_minimal.c', |
| 66 'pthread_stubs.c', # weak version of __pthread_initialize | 67 'pthread_stubs.c', # weak version of __pthread_initialize |
| 67 ] | |
| 68 | |
| 69 SRCS_NEWLIB_STATIC = [ | |
| 70 'pthread_initialize_minimal.c', | |
| 71 'tls.c', | 68 'tls.c', |
| 72 ] | 69 ] |
| 73 | 70 |
| 74 SRCS_NEWLIB_SHARED = [ | |
| 75 'pthread_initialize_minimal_using_ldso.c', | |
| 76 'tls_using_ldso.c', | |
| 77 ] | |
| 78 | 71 |
| 79 # used by both glibc and newlib | 72 # used by both glibc and newlib |
| 80 SRCS_NACL_EXTENSIONS = [ | 73 SRCS_NACL_EXTENSIONS = [ |
| 81 'gc_hooks.c', | 74 'gc_hooks.c', |
| 82 'nacl_irt.c', | 75 'nacl_irt.c', |
| 83 'nacl_tls_get.c', | 76 'nacl_tls_get.c', |
| 84 'nacl_tls_init.c', | 77 'nacl_tls_init.c', |
| 85 ] | 78 ] |
| 86 | 79 |
| 87 if env.Bit('nacl_glibc'): | 80 if env.Bit('nacl_glibc'): |
| 88 # For nacl-glibc, the standard interfaces are provided by glibc, so | 81 # For nacl-glibc, the standard interfaces are provided by glibc, so |
| 89 # we do not build them here. | 82 # we do not build them here. |
| 90 sources = SRCS_NACL_EXTENSIONS | 83 sources = SRCS_NACL_EXTENSIONS |
| 91 else: | 84 else: |
| 92 sources = SRCS_NACL_EXTENSIONS + SRCS_NEWLIB_SYSCALL + SRCS_NEWLIB_MISC | 85 sources = SRCS_NACL_EXTENSIONS + SRCS_NEWLIB_SYSCALL + SRCS_NEWLIB_MISC |
| 93 if env.Bit('pnacl_shared_newlib'): | 86 if env.Bit('target_arm') and not env.Bit('bitcode'): |
| 94 sources += SRCS_NEWLIB_SHARED | 87 sources.append('aeabi_read_tp.S') |
| 95 else: | |
| 96 sources += SRCS_NEWLIB_STATIC | |
| 97 if env.Bit('target_arm') and not env.Bit('bitcode'): | |
| 98 sources.append('aeabi_read_tp.S') | |
| 99 | 88 |
| 100 # Do not make a shared version of libnacl. | 89 # Do not make a shared version of libnacl. |
| 101 libnacl = env.ComponentLibrary('libnacl', sources) | 90 libnacl = env.ComponentLibrary('libnacl', sources) |
| 102 | 91 |
| 103 env.AddLibraryToSdk(libnacl) | 92 env.AddLibraryToSdk(libnacl) |
| 104 header_install = env.AddHeaderToSdk(['nacl_startup.h', 'nacl_thread.h']) | 93 header_install = env.AddHeaderToSdk(['nacl_startup.h', 'nacl_thread.h']) |
| 105 env.Requires('libnacl', header_install) | 94 env.Requires('libnacl', header_install) |
| 106 | 95 |
| 107 libnacl_dyncode = env.NaClSdkLibrary('libnacl_dyncode', ['dyncode.c']) | 96 libnacl_dyncode = env.NaClSdkLibrary('libnacl_dyncode', ['dyncode.c']) |
| 108 env.AddLibraryToSdk(libnacl_dyncode) | 97 env.AddLibraryToSdk(libnacl_dyncode) |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 # the libnacl_sys_private one. Putting everything important into a | 145 # the libnacl_sys_private one. Putting everything important into a |
| 157 # single .o file avoids this scenario. | 146 # single .o file avoids this scenario. |
| 158 private_combine = [env.ComponentObject(module, '%s.c' % module) | 147 private_combine = [env.ComponentObject(module, '%s.c' % module) |
| 159 for module in ['gc_hooks_private', | 148 for module in ['gc_hooks_private', |
| 160 'sys_private']] | 149 'sys_private']] |
| 161 sys_private.append(env.Command('combined_private${OBJSUFFIX}', | 150 sys_private.append(env.Command('combined_private${OBJSUFFIX}', |
| 162 private_combine, | 151 private_combine, |
| 163 '${LD} -relocatable -o ${TARGET} ${SOURCES}')) | 152 '${LD} -relocatable -o ${TARGET} ${SOURCES}')) |
| 164 | 153 |
| 165 env.ComponentLibrary('libnacl_sys_private', sys_private) | 154 env.ComponentLibrary('libnacl_sys_private', sys_private) |
| OLD | NEW |