-
Notifications
You must be signed in to change notification settings - Fork 694
build-scripts/build_llvm.py: bump to llvm 18 #4259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
cf. bytecodealliance#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: espressif/llvm-project#112 while we can use different versions for different targets, it's nicer to use the same version everywhere when possible.
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. bytecodealliance#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: bytecodealliance#3356
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I made a test run on my forked repository and encountered two failures related to LLVM compilation:
|
i'm not sure how it can happen off hand.
maybe #4269 ? |
https://github.com/lum1n0us/wasm-micro-runtime/actions/runs/14967033117/job/42039634773 Maybe we missed a part that needs to adapt build-scripts/lldb_wasm.patch to LLVM 18? In my personal repository, I have updated LLVM in .github/workflows/build_wamr_lldb.yml to 18.1.8, and the step "apply WAMR patch" failed. - name: download llvm
if: steps.lldb_build_cache.outputs.cache-hit != 'true'
run: |
wget -O llvm-project.tar.xz --progress=dot:giga https://github.com/llvm/llvm-project/releases/download/llvmorg-18.1.8/llvm-project-18.1.8.src.tar.xz
tar -xzf llvm-project.tar.xz
mv llvm-project-18.1.8.src llvm-project
working-directory: core/deps/ |
oops, i have completely forgotten that patch. :-) @xujuntwt95329 do you remember what's the status of llvm/llvm-project#77949 |
Those files are not able to be generated. set(generated_mach_interfaces
${CMAKE_CURRENT_BINARY_DIR}/mach_exc.h
${CMAKE_CURRENT_BINARY_DIR}/mach_excServer.c
${CMAKE_CURRENT_BINARY_DIR}/mach_excUser.c
)
#...
add_custom_command(OUTPUT ${generated_mach_interfaces}
VERBATIM COMMAND mig ${MIG_ARCH_FLAGS_SEPARTED} -isysroot ${CMAKE_OSX_SYSROOT} ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/MacOSX/dbgnub-mig.defs
) Based on the running command. from https://github.com/lum1n0us/wasm-micro-runtime/actions/runs/14988324213/job/42106372313#step:12:10024.
|
It is a known issue with CMake 4.0. llvm/llvm-project#138020 |
* build-scripts/build_llvm.py: bump to llvm 18 cf. bytecodealliance#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: espressif/llvm-project#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. bytecodealliance#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: bytecodealliance#3356 * wamr-compiler: size_level=0 for sgx mode cf. bytecodealliance#3035
@yamt @xujuntwt95329 Is there any chance that we can skip lldb in the v2.3.0 release? I've learned that upgrading lldb_wasm.patch to LLVM 18 will not be a quick and smooth process. Maybe we shouldn't let v2.3.0 wait for it? |
maybe just leave it as it is? (ie llvm 13) |
cf. #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:
espressif/llvm-project#112
while we can use different versions for different targets,
it's nicer to use the same version everywhere when possible.