Bladeren bron

build-scripts/build_llvm.py: bump to llvm 18 (#4259)

* build-scripts/build_llvm.py: bump to llvm 18

cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/4210

why not 20?
because, as of writing this, 19 is the latest released version for
the xtensa fork of llvm: https://github.com/espressif/llvm-project

why not 19?
because of a bug in the xtensa fork of llvm:
https://github.com/espressif/llvm-project/issues/112

while we can use different versions for different targets,
it's nicer to use the same version everywhere when possible.

* 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

* wamr-compiler: size_level=0 for sgx mode

cf. https://github.com/bytecodealliance/wasm-micro-runtime/issues/3035
YAMAMOTO Takashi 8 maanden geleden
bovenliggende
commit
908838a5b5
3 gewijzigde bestanden met toevoegingen van 6 en 5 verwijderingen
  1. 3 3
      build-scripts/build_llvm.py
  2. 2 1
      tests/wamr-test-suites/spec-test-script/runtest.py
  3. 1 1
      wamr-compiler/main.c

+ 3 - 3
build-scripts/build_llvm.py

@@ -294,17 +294,17 @@ def main():
         "arc": {
             "repo": "https://github.com/llvm/llvm-project.git",
             "repo_ssh": "git@github.com:llvm/llvm-project.git",
-            "branch": "release/15.x",
+            "branch": "release/18.x",
         },
         "xtensa": {
             "repo": "https://github.com/espressif/llvm-project.git",
             "repo_ssh": "git@github.com:espressif/llvm-project.git",
-            "branch": "xtensa_release_17.0.1",
+            "branch": "xtensa_release_18.1.2",
         },
         "default": {
             "repo": "https://github.com/llvm/llvm-project.git",
             "repo_ssh": "git@github.com:llvm/llvm-project.git",
-            "branch": "release/15.x",
+            "branch": "release/18.x",
         },
     }
 

+ 2 - 1
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"],

+ 1 - 1
wamr-compiler/main.c

@@ -712,7 +712,7 @@ main(int argc, char *argv[])
     }
 
     if (sgx_mode) {
-        option.size_level = 1;
+        option.size_level = 0;
         option.is_sgx_platform = true;
     }