Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 | 6 |
| 7 Import('env') | 7 Import('env') |
| 8 | 8 |
| 9 # Since the integrated runtime will be built with newlib, | 9 # Since the integrated runtime will be built with newlib, |
| 10 # there's no need to build this module against glibc. | 10 # there's no need to build this module against glibc. |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 37 blob_env.Append(LINKFLAGS='-Wl,-Ttext-segment=${IRT_BLOB_CODE_START}') | 37 blob_env.Append(LINKFLAGS='-Wl,-Ttext-segment=${IRT_BLOB_CODE_START}') |
| 38 | 38 |
| 39 asm_env = blob_env.Clone() | 39 asm_env = blob_env.Clone() |
| 40 if asm_env.Bit('bitcode'): | 40 if asm_env.Bit('bitcode'): |
| 41 asm_env.Replace(OBJSUFFIX='.o') | 41 asm_env.Replace(OBJSUFFIX='.o') |
| 42 asm_env.Append(ASFLAGS=['-arch', '${TARGET_FULLARCH}']) | 42 asm_env.Append(ASFLAGS=['-arch', '${TARGET_FULLARCH}']) |
| 43 | 43 |
| 44 asm_helper = asm_env.ComponentObject( | 44 asm_helper = asm_env.ComponentObject( |
| 45 'elf_restart_%s.S' % env['TARGET_FULLARCH'].replace('-', '_')) | 45 'elf_restart_%s.S' % env['TARGET_FULLARCH'].replace('-', '_')) |
| 46 | 46 |
| 47 files = ['irt_entry.c', 'irt_sbrk.c', 'irt_elf_utils.c', asm_helper] | 47 files = ['irt_entry.c', |
| 48 # TLS virtualisation only works on x86-64 currently. | 48 'irt_sbrk.c', |
| 49 # TODO(mseaborn): Turn on "-mtls-use-call" for the relevant libraries | 49 'irt_elf_utils.c', |
| 50 # on x86-32 so that this works there too. | 50 asm_helper] |
| 51 if env.Bit('build_x86_64'): | 51 |
| 52 # The bitcode build does not yet use -mtls-use-call and so it improperly | |
| 53 # pollutes user TLS with IRT-private TLS. But until that's fixed, | |
| 54 # overriding the entry points with the irt_tls.c versions would cause a | |
| 55 # mismatch where library code using (what should be reserved for) user TLS | |
| 56 # will crash because it hasn't been initialized. | |
| 57 if not env.Bit('bitcode'): | |
| 52 files.append('irt_tls.c') | 58 files.append('irt_tls.c') |
| 53 blob_env.ComponentProgram( | 59 |
| 60 irt_library = blob_env.ComponentProgram( | |
| 54 'irt.nexe', files, | 61 'irt.nexe', files, |
| 55 EXTRA_LIBS=['ppruntime', 'srpc', 'imc', 'platform', 'gio', | 62 EXTRA_LIBS=['ppruntime', |
| 56 'pthread', 'm']) | 63 'srpc', |
| 64 'imc', | |
| 65 'platform', | |
| 66 'gio', | |
| 67 'pthread', | |
| 68 'm']) | |
| 69 | |
| 70 if env.Bit('build_x86_32'): | |
|
Mark Seaborn
2011/04/13 23:27:34
Actually this is not right: it needs to be
"env
| |
| 71 # Make sure that the linked IRT nexe never uses TLS via %gs access. | |
| 72 # All IRT code must avoid direct use of the TLS ABI register, which | |
| 73 # is reserved for user TLS. Instead, ensure all TLS accesses use a | |
| 74 # call to __nacl_read_tp, which the IRT code overrides to segregate | |
| 75 # IRT-private TLS from user TLS. | |
| 76 node = env.CommandTest('irt_tls_test.out', | |
| 77 ['${PYTHON}', env.File('check_tls.py'), | |
| 78 '${OBJDUMP}', irt_library]) | |
| 79 env.AddNodeToTestSuite(node, ['small_tests'], 'run_irt_tls_test') | |
| OLD | NEW |