julia
julia copied to clipboard
choice to Target ISA in @code_llvm and @code_native
attempts to address issue #52949
I've made some attempts based on v1.11.0-beta1. After specifying the new parameters, it is now possible to generate native code for wasm64 in my local environment. https://github.com/inkydragon/julia/commit/66e09cb3e15d2a3de99e3d973511640aec7f6c5b
- In addition to the codes mentioned in the issue, I also modified the following code to use a specific ISA https://github.com/JuliaLang/julia/blob/0bf392e671b5b0a889043b386e00ca11d6eed4d1/src/aotcompile.cpp#L2022 https://github.com/JuliaLang/julia/blob/0bf392e671b5b0a889043b386e00ca11d6eed4d1/src/disasm.cpp#L1247
- You need to initialize all supported architectures:
InitializeAll*s(); - It seems that by default LLVM only supports the following architectures. (v1.11 + LLVM 16.0.6 + WSL/Win11).
Perhaps we need to specify some compilation options to make LLVM support all platforms supported by julia
/ llvm/Config/Targets.def LVM_TARGET(AMDGPU) LVM_TARGET(NVPTX) LVM_TARGET(WebAssembly) LVM_TARGET(BPF) LVM_TARGET(AVR) LVM_TARGET(X86)
Reminder to myself for eventual review. We need to make sure that the results are not leaked into the compilation cache. https://discourse.julialang.org/t/any-existing-efforts-on-cross-compiling-julia-programs-across-different-platforms/118253/3?u=vchuravy