bytecodealliance / lucet

Lucet, the Sandboxing WebAssembly Compiler.
Apache License 2.0
4.07k stars 164 forks source link

Compilation failed on arm64 platform #565

Closed hydai closed 4 years ago

hydai commented 4 years ago

Hi. I would like to build and run lucet on ARM64 platform. Has lucet supported arm64 now?

When I run make build, the compilation process failed at this step cargo build --workspace --release --bins --lib. Attached is the error log what I got.

My platform:

Distributor ID: Ubuntu
Description:    Ubuntu 20.04 LTS
Release:    20.04
Codename:   focal
Linux ip-172-31-14-194 5.4.0-1017-aws #17-Ubuntu SMP Fri Jun 19 17:37:26 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux
AWS Instance type: AWS EC2 M6g.xlarge

Error log:

error: failed to run custom build command for `lucet-runtime-internals v0.7.0-dev (/home/ubuntu/wasm32-wasi-benchmark/thirdparty/lucet/lucet-runtime/lucet-runtime-internals)`

Caused by:
  process didn't exit successfully: `/home/ubuntu/wasm32-wasi-benchmark/thirdparty/lucet/target/release/build/lucet-runtime-internals-52ab1d16d37fc67e/build-script-build` (exit code: 1)
--- stdout
TARGET = Some("aarch64-unknown-linux-gnu")
OPT_LEVEL = Some("3")
HOST = Some("aarch64-unknown-linux-gnu")
CC_aarch64-unknown-linux-gnu = None
CC_aarch64_unknown_linux_gnu = None
HOST_CC = None
CC = None
CFLAGS_aarch64-unknown-linux-gnu = None
CFLAGS_aarch64_unknown_linux_gnu = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("false")
CARGO_CFG_TARGET_FEATURE = None
running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-Wall" "-Wextra" "-o" "/home/ubuntu/wasm32-wasi-benchmark/thirdparty/lucet/target/release/build/lucet-runtime-internals-8fdde54ee856e082/out/src/context/context_asm.o" "-c" "src/context/context_asm.S"
cargo:warning=src/context/context_asm.S: Assembler messages:
cargo:warning=src/context/context_asm.S:44: Error: unknown mnemonic `pop' -- `pop %r9'
cargo:warning=src/context/context_asm.S:45: Error: unknown mnemonic `pop' -- `pop %r8'
cargo:warning=src/context/context_asm.S:46: Error: unknown mnemonic `pop' -- `pop %rcx'
cargo:warning=src/context/context_asm.S:47: Error: unknown mnemonic `pop' -- `pop %rdx'
cargo:warning=src/context/context_asm.S:48: Error: unknown mnemonic `pop' -- `pop %rsi'
cargo:warning=src/context/context_asm.S:49: Error: unknown mnemonic `pop' -- `pop %rdi'
cargo:warning=src/context/context_asm.S:69: Error: operand 1 must be an integer register -- `mov (10*8+8*16+8*2+16)(%rbp),%rdi'
cargo:warning=src/context/context_asm.S:70: Error: operand 1 must be an integer register -- `mov %rax,(10*8+8*16+8*0)(%rbp)'
cargo:warning=src/context/context_asm.S:71: Error: operand 1 must be an integer register -- `mov %rdx,(10*8+8*16+8*1)(%rbp)'
cargo:warning=src/context/context_asm.S:72: Error: unknown mnemonic `movdqu' -- `movdqu %xmm0,(10*8+8*16+8*2)(%rbp)'
cargo:warning=src/context/context_asm.S:75: Error: operand 1 must be an integer register -- `mov (10*8+8*16+8*2+16+8)(%rbp),%rsi'
cargo:warning=src/context/context_asm.S:76: Error: unknown mnemonic `test' -- `test %rsi,%rsi'
cargo:warning=src/context/context_asm.S:78: Error: unknown mnemonic `jz' -- `jz no_backstop_callback@PLT'
cargo:warning=src/context/context_asm.S:84: Error: operand 1 must be an integer register -- `mov (10*8+8*16+8*2+16+8+8)(%rbp),%rdi'
cargo:warning=src/context/context_asm.S:86: Error: unknown mnemonic `call' -- `call *%rsi'
cargo:warning=src/context/context_asm.S:89: Error: operand 1 must be an integer register -- `mov %rbp,%rdi'
cargo:warning=src/context/context_asm.S:90: Error: operand 1 must be an integer register -- `mov (10*8+8*16+8*2+16)(%rbp),%rsi'
cargo:warning=src/context/context_asm.S:93: Error: unknown mnemonic `jmp' -- `jmp lucet_context_swap@PLT'
cargo:warning=src/context/context_asm.S:112: Error: operand 1 must be an integer register -- `mov %rbx,(0*8)(%rdi)'
cargo:warning=src/context/context_asm.S:113: Error: operand 1 must be an integer register -- `mov %rsp,(1*8)(%rdi)'
cargo:warning=src/context/context_asm.S:114: Error: operand 1 must be an integer register -- `mov %rbp,(2*8)(%rdi)'
cargo:warning=src/context/context_asm.S:115: Error: operand 1 must be an integer register -- `mov %rdi,(3*8)(%rdi)'
cargo:warning=src/context/context_asm.S:116: Error: operand 1 must be an integer register -- `mov %r12,(4*8)(%rdi)'
cargo:warning=src/context/context_asm.S:117: Error: operand 1 must be an integer register -- `mov %r13,(5*8)(%rdi)'
cargo:warning=src/context/context_asm.S:118: Error: operand 1 must be an integer register -- `mov %r14,(6*8)(%rdi)'
cargo:warning=src/context/context_asm.S:119: Error: operand 1 must be an integer register -- `mov %r15,(7*8)(%rdi)'
cargo:warning=src/context/context_asm.S:120: Error: operand 1 must be an integer register -- `mov %rsi,(8*8)(%rdi)'
cargo:warning=src/context/context_asm.S:122: Error: unknown mnemonic `movdqu' -- `movdqu %xmm0,(10*8+0*16)(%rdi)'
cargo:warning=src/context/context_asm.S:123: Error: unknown mnemonic `movdqu' -- `movdqu %xmm1,(10*8+1*16)(%rdi)'
cargo:warning=src/context/context_asm.S:124: Error: unknown mnemonic `movdqu' -- `movdqu %xmm2,(10*8+2*16)(%rdi)'
cargo:warning=src/context/context_asm.S:125: Error: unknown mnemonic `movdqu' -- `movdqu %xmm3,(10*8+3*16)(%rdi)'
cargo:warning=src/context/context_asm.S:126: Error: unknown mnemonic `movdqu' -- `movdqu %xmm4,(10*8+4*16)(%rdi)'
cargo:warning=src/context/context_asm.S:127: Error: unknown mnemonic `movdqu' -- `movdqu %xmm5,(10*8+5*16)(%rdi)'
cargo:warning=src/context/context_asm.S:128: Error: unknown mnemonic `movdqu' -- `movdqu %xmm6,(10*8+6*16)(%rdi)'
cargo:warning=src/context/context_asm.S:129: Error: unknown mnemonic `movdqu' -- `movdqu %xmm7,(10*8+7*16)(%rdi)'
cargo:warning=src/context/context_asm.S:132: Error: operand 1 must be an integer register -- `mov (0*8)(%rsi),%rbx'
cargo:warning=src/context/context_asm.S:133: Error: operand 1 must be an integer register -- `mov (1*8)(%rsi),%rsp'
cargo:warning=src/context/context_asm.S:134: Error: operand 1 must be an integer register -- `mov (2*8)(%rsi),%rbp'
cargo:warning=src/context/context_asm.S:135: Error: operand 1 must be an integer register -- `mov (3*8)(%rsi),%rdi'
cargo:warning=src/context/context_asm.S:136: Error: operand 1 must be an integer register -- `mov (4*8)(%rsi),%r12'
cargo:warning=src/context/context_asm.S:137: Error: operand 1 must be an integer register -- `mov (5*8)(%rsi),%r13'
cargo:warning=src/context/context_asm.S:138: Error: operand 1 must be an integer register -- `mov (6*8)(%rsi),%r14'
cargo:warning=src/context/context_asm.S:139: Error: operand 1 must be an integer register -- `mov (7*8)(%rsi),%r15'
cargo:warning=src/context/context_asm.S:141: Error: unknown mnemonic `movdqu' -- `movdqu (10*8+0*16)(%rsi),%xmm0'
cargo:warning=src/context/context_asm.S:142: Error: unknown mnemonic `movdqu' -- `movdqu (10*8+1*16)(%rsi),%xmm1'
cargo:warning=src/context/context_asm.S:143: Error: unknown mnemonic `movdqu' -- `movdqu (10*8+2*16)(%rsi),%xmm2'
cargo:warning=src/context/context_asm.S:144: Error: unknown mnemonic `movdqu' -- `movdqu (10*8+3*16)(%rsi),%xmm3'
cargo:warning=src/context/context_asm.S:145: Error: unknown mnemonic `movdqu' -- `movdqu (10*8+4*16)(%rsi),%xmm4'
cargo:warning=src/context/context_asm.S:146: Error: unknown mnemonic `movdqu' -- `movdqu (10*8+5*16)(%rsi),%xmm5'
cargo:warning=src/context/context_asm.S:147: Error: unknown mnemonic `movdqu' -- `movdqu (10*8+6*16)(%rsi),%xmm6'
cargo:warning=src/context/context_asm.S:148: Error: unknown mnemonic `movdqu' -- `movdqu (10*8+7*16)(%rsi),%xmm7'
cargo:warning=src/context/context_asm.S:151: Error: operand 1 must be an integer register -- `mov (8*8)(%rsi),%rsi'
cargo:warning=src/context/context_asm.S:169: Error: operand 1 must be an integer register -- `mov (0*8)(%rdi),%rbx'
cargo:warning=src/context/context_asm.S:170: Error: operand 1 must be an integer register -- `mov (1*8)(%rdi),%rsp'
cargo:warning=src/context/context_asm.S:171: Error: operand 1 must be an integer register -- `mov (2*8)(%rdi),%rbp'
cargo:warning=src/context/context_asm.S:172: Error: operand 1 must be an integer register -- `mov (4*8)(%rdi),%r12'
cargo:warning=src/context/context_asm.S:173: Error: operand 1 must be an integer register -- `mov (5*8)(%rdi),%r13'
cargo:warning=src/context/context_asm.S:174: Error: operand 1 must be an integer register -- `mov (6*8)(%rdi),%r14'
cargo:warning=src/context/context_asm.S:175: Error: operand 1 must be an integer register -- `mov (7*8)(%rdi),%r15'
cargo:warning=src/context/context_asm.S:176: Error: operand 1 must be an integer register -- `mov (8*8)(%rdi),%rsi'
cargo:warning=src/context/context_asm.S:178: Error: unknown mnemonic `movdqu' -- `movdqu (10*8+0*16)(%rdi),%xmm0'
cargo:warning=src/context/context_asm.S:179: Error: unknown mnemonic `movdqu' -- `movdqu (10*8+1*16)(%rdi),%xmm1'
cargo:warning=src/context/context_asm.S:180: Error: unknown mnemonic `movdqu' -- `movdqu (10*8+2*16)(%rdi),%xmm2'
cargo:warning=src/context/context_asm.S:181: Error: unknown mnemonic `movdqu' -- `movdqu (10*8+3*16)(%rdi),%xmm3'
cargo:warning=src/context/context_asm.S:182: Error: unknown mnemonic `movdqu' -- `movdqu (10*8+4*16)(%rdi),%xmm4'
cargo:warning=src/context/context_asm.S:183: Error: unknown mnemonic `movdqu' -- `movdqu (10*8+5*16)(%rdi),%xmm5'
cargo:warning=src/context/context_asm.S:184: Error: unknown mnemonic `movdqu' -- `movdqu (10*8+6*16)(%rdi),%xmm6'
cargo:warning=src/context/context_asm.S:185: Error: unknown mnemonic `movdqu' -- `movdqu (10*8+7*16)(%rdi),%xmm7'
cargo:warning=src/context/context_asm.S:188: Error: operand 1 must be an integer register -- `mov (3*8)(%rdi),%rdi'
cargo:warning=src/context/context_asm.S:216: Error: unknown mnemonic `call' -- `call *%rsi'
cargo:warning=src/context/context_asm.S:218: Error: unknown mnemonic `jmp' -- `jmp *%rbx'
exit code: 1

--- stderr

error occurred: Command "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-Wall" "-Wextra" "-o" "/home/ubuntu/wasm32-wasi-benchmark/thirdparty/lucet/target/release/build/lucet-runtime-internals-8fdde54ee856e082/out/src/context/context_asm.o" "-c" "src/context/context_asm.S" with args "cc" did not execute successfully (status code exit code: 1).

warning: build failed, waiting for other jobs to finish...
error: build failed
make: *** [Makefile:13: build] Error 101
pchickey commented 4 years ago

Hi - Lucet only supports x86 platforms. We do not have plans to support arm64. We instead recommend our Bytecode Alliance sister project, Wasmtime, for use on that platform.

hydai commented 4 years ago

Got it. Thanks for your information. I'll try Wasmtime on my platform.