|
62 | 62 | "xtensa": ["--target=xtensa"], |
63 | 63 | } |
64 | 64 |
|
| 65 | +# AOT compilation options mapping for XIP mode |
| 66 | +aot_target_options_map_xip = { |
| 67 | + # avoid l32r relocations for xtensa |
| 68 | + "xtensa": ["--mllvm=-mtext-section-literals"] |
| 69 | +} |
| 70 | + |
65 | 71 | def debug(data): |
66 | 72 | if debug_file: |
67 | 73 | debug_file.write(data) |
@@ -1122,10 +1128,8 @@ def compile_wasm_to_aot(wasm_tempfile, aot_tempfile, runner, opts, r, output = ' |
1122 | 1128 |
|
1123 | 1129 | if opts.xip: |
1124 | 1130 | cmd.append("--xip") |
1125 | | - |
1126 | | - # avoid l32r relocations for xtensa |
1127 | | - if opts.target == "xtensa": |
1128 | | - cmd.append("--mllvm=-mtext-section-literals") |
| 1131 | + if test_target in aot_target_options_map_xip: |
| 1132 | + cmd += aot_target_options_map_xip[test_target] |
1129 | 1133 |
|
1130 | 1134 | if opts.multi_thread: |
1131 | 1135 | cmd.append("--enable-multi-thread") |
@@ -1308,8 +1312,8 @@ def test_assert_with_exception(form, wast_tempfile, wasm_tempfile, aot_tempfile, |
1308 | 1312 | if test_aot: |
1309 | 1313 | aot_tempfile = create_tmp_file(".aot") |
1310 | 1314 | # could be potientially compiled to aot |
1311 | | - # with the future following call test_assert_xxx, |
1312 | | - # add them to temp_file_repo now even if no actual following file, |
| 1315 | + # with the future following call test_assert_xxx, |
| 1316 | + # add them to temp_file_repo now even if no actual following file, |
1313 | 1317 | # it will be simple ignore during final deletion if not exist |
1314 | 1318 | prefix = wasm_tempfile.split(".wasm")[0] |
1315 | 1319 | temp_file_repo.append(prefix + ".aot") |
@@ -1436,8 +1440,8 @@ def test_assert_with_exception(form, wast_tempfile, wasm_tempfile, aot_tempfile, |
1436 | 1440 | if test_aot: |
1437 | 1441 | r = compile_wasm_to_aot(temp_files[1], temp_files[2], True, opts, r) |
1438 | 1442 | # could be potientially compiled to aot |
1439 | | - # with the future following call test_assert_xxx, |
1440 | | - # add them to temp_file_repo now even if no actual following file, |
| 1443 | + # with the future following call test_assert_xxx, |
| 1444 | + # add them to temp_file_repo now even if no actual following file, |
1441 | 1445 | # it will be simple ignore during final deletion if not exist |
1442 | 1446 | prefix = temp_files[1].split(".wasm")[0] |
1443 | 1447 | temp_file_repo.append(prefix + ".aot") |
|
0 commit comments