Skip to content
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

build '-target=wasm-unknown' pure wasm fail #4163

Open
ltp456 opened this issue Feb 28, 2024 · 1 comment
Open

build '-target=wasm-unknown' pure wasm fail #4163

ltp456 opened this issue Feb 28, 2024 · 1 comment
Labels
wasm WebAssembly

Comments

@ltp456
Copy link

ltp456 commented Feb 28, 2024

tinygo version: tinygo version 0.31.0 darwin/arm64 (using go version go1.22.0 and LLVM version 17.0.6)
os system: mac os 14.3
build cmd:
tinygo build -o ecdsa.wasm -target=wasm-unknown ./main.go

error log:
/Users/red/lworkspace/dfinity/tinygo/src/syscall/syscall_unix.go:10:7: undefined: RawSockaddrInet4 /Users/red/lworkspace/dfinity/tinygo/src/syscall/syscall_unix.go:17:9: undefined: RawSockaddrInet6 /Users/red/lworkspace/dfinity/tinygo/src/syscall/errno.go:28:14: undefined: EINTR

other log:

clang-17: error: no such file or directory: '/Users/red/lworkspace/dfinity/tinygo/lib/compiler-rt-builtins/addvsi3.c' clang-17: error: no input files clang-17: error: no such file or directory: '/Users/red/lworkspace/dfinity/tinygo/lib/compiler-rt-builtins/absvdi2.c' clang-17: error: no input files

then try download compiler-rt-builtins(https://github.com/ilobilo/compiler-rt-builtins) to tinygo/lib/compiler-rt-builtins dirs

build wasm again the error is:

wasm-ld: error: lto.tmp: undefined symbol: memset

@aykevl
Copy link
Member

aykevl commented Mar 13, 2024

You are mixing a number of different bugs in a single report.

/Users/red/lworkspace/dfinity/tinygo/src/syscall/syscall_unix.go:10:7: undefined: RawSockaddrInet4 /Users/red/lworkspace/dfinity/tinygo/src/syscall/syscall_unix.go:17:9: undefined: RawSockaddrInet6 /Users/red/lworkspace/dfinity/tinygo/src/syscall/errno.go:28:14: undefined: EINTR

Probably fixed in #4168. Please test with tinygo 0.31.2.

clang-17: error: no such file or directory: '/Users/red/lworkspace/dfinity/tinygo/lib/compiler-rt-builtins/addvsi3.c' clang-17: error: no input files clang-17: error: no such file or directory: '/Users/red/lworkspace/dfinity/tinygo/lib/compiler-rt-builtins/absvdi2.c' clang-17: error: no input files

Not a bug, you need to run make llvm-source (see https://tinygo.org/docs/guides/build/additional-requirements/).

then try download compiler-rt-builtins(https://github.com/ilobilo/compiler-rt-builtins) to tinygo/lib/compiler-rt-builtins dirs

Don't do this, in fact I recommend undoing this so they don't mess with your tinygo build. The correct fix is make llvm-source.

wasm-ld: error: lto.tmp: undefined symbol: memset

See #4174

@orsinium orsinium added the wasm WebAssembly label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasm WebAssembly
Projects
None yet
Development

No branches or pull requests

3 participants