OLD | NEW |
1 # -*- python -*- | 1 # -*- python -*- |
2 # Copyright (c) 2013 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2013 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 Import('env') | 6 Import('env') |
7 | 7 |
8 # IRT backward compatibility test | 8 # IRT backward compatibility test |
9 | 9 |
10 # This test uses a nexe built by another test. Nexes do not get | 10 # This test uses a nexe built by another test. Nexes do not get |
11 # staged in pexe mode, so only run this test in nonpexe mode. | 11 # staged in pexe mode, so only run this test in nonpexe mode. |
12 if env.Bit('pnacl_generate_pexe'): | 12 if env.Bit('pnacl_generate_pexe'): |
13 Return() | 13 Return() |
14 | 14 |
15 blob_env = env['NACL_IRT_ENV'].Clone() | 15 blob_env = env['NACL_IRT_ENV'].Clone() |
16 blob_env.Append(LINKFLAGS=blob_env.RodataSwitch('${IRT_BLOB_DATA_START}')) | 16 blob_env.Append(LINKFLAGS=[blob_env.RodataSwitch('${IRT_BLOB_DATA_START}'), |
17 # The PNaCl linker (gold) does not implement the "-Ttext-segment" | 17 blob_env.TextSwitch('${IRT_BLOB_CODE_START}')]) |
18 # option. However, with the linker for x86, the "-Ttext" option does | |
19 # not affect the executable's base address. | |
20 if blob_env.Bit('bitcode'): | |
21 blob_env.Append(LINKFLAGS='-Wl,-Ttext=${IRT_BLOB_CODE_START}') | |
22 else: | |
23 blob_env.Append(LINKFLAGS='-Wl,-Ttext-segment=${IRT_BLOB_CODE_START}') | |
24 | 18 |
25 irt_entry_obj = blob_env.ComponentObject( | 19 irt_entry_obj = blob_env.ComponentObject( |
26 '${MAIN_DIR}/src/untrusted/irt/irt_entry.c') | 20 '${MAIN_DIR}/src/untrusted/irt/irt_entry.c') |
27 | 21 |
28 # Build custom IRT library which provides old interface versions. | 22 # Build custom IRT library which provides old interface versions. |
29 irt_comp_test_library = blob_env.ComponentProgram( | 23 irt_comp_test_library = blob_env.ComponentProgram( |
30 'irt_comp_test', [irt_entry_obj, 'irt_comp_interfaces.c'], | 24 'irt_comp_test', [irt_entry_obj, 'irt_comp_interfaces.c'], |
31 EXTRA_LIBS=['irt_support_private']) | 25 EXTRA_LIBS=['irt_support_private']) |
32 | 26 |
33 # Don't provide IRT, we provide it ourselves via -B. | 27 # Don't provide IRT, we provide it ourselves via -B. |
34 env.ClearBits('tests_use_irt') | 28 env.ClearBits('tests_use_irt') |
35 | 29 |
36 node = env.CommandSelLdrTestNacl( | 30 node = env.CommandSelLdrTestNacl( |
37 'irt_compatibility_test.out', | 31 'irt_compatibility_test.out', |
38 env.File('${STAGING_DIR}/hello_world.nexe'), | 32 env.File('${STAGING_DIR}/hello_world.nexe'), |
39 sel_ldr_flags=['-B', irt_comp_test_library], | 33 sel_ldr_flags=['-B', irt_comp_test_library], |
40 stdout_golden=env.File('../hello_world/hello_world.stdout')) | 34 stdout_golden=env.File('../hello_world/hello_world.stdout')) |
41 | 35 |
42 env.AddNodeToTestSuite(node, ['small_tests'], 'run_irt_compatibility_test') | 36 env.AddNodeToTestSuite(node, ['small_tests'], 'run_irt_compatibility_test') |
OLD | NEW |