From 766145a16627e7b24f50391348cb785a8bceab03 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 25 Apr 2025 11:15:42 +0900 Subject: [PATCH] spec-test-script/runtest.py: --size-level=0 for x86-64 with the recent version of LLVM, wamrc --size-level=1 often generates R_X86_64_32S relocations which fail on load with the infamous error: "relocation truncated to fit R_X86_64_32S failed" it seems that these relocations are often for jump tables. this commit workarounds it with --size-level=0. an alternative is to disable jump tables. (although it seems that jump tables are not the only source of these relocations.) cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/3035 it might be better to do this in wamrc itself. however, currently target info is not available there in case of native compilation. related: https://github.com/bytecodealliance/wasm-micro-runtime/issues/3356 --- tests/wamr-test-suites/spec-test-script/runtest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/wamr-test-suites/spec-test-script/runtest.py b/tests/wamr-test-suites/spec-test-script/runtest.py index 8de001af6..158d759ed 100755 --- a/tests/wamr-test-suites/spec-test-script/runtest.py +++ b/tests/wamr-test-suites/spec-test-script/runtest.py @@ -46,7 +46,8 @@ temp_module_table = {} aot_target_options_map = { "i386": ["--target=i386"], "x86_32": ["--target=i386"], - "x86_64": ["--target=x86_64", "--cpu=skylake"], + # cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/3035 + "x86_64": ["--target=x86_64", "--cpu=skylake", "--size-level=0"], "aarch64": ["--target=aarch64", "--target-abi=eabi", "--cpu=cortex-a53"], "aarch64_vfp": ["--target=aarch64", "--target-abi=gnueabihf", "--cpu=cortex-a53"], "armv7": ["--target=armv7", "--target-abi=eabi", "--cpu=cortex-a9", "--cpu-features=-neon"],