utls
utls copied to clipboard
Unable to compile to wasm
I have a script in Go that uses uTLS however when I try to compile it to wasm using GOOS=js GOARCH=wasm go build -o main.wasm client.go
I get the error shown below:
#github.com/refraction-networking/utls/cpu
../go/pkg/mod/github.com/refraction-networking/[email protected]/cpu/cpu.go:16:16: undefined: CacheLineSize
../go/pkg/mod/github.com/refraction-networking/[email protected]/cpu/cpu.go:33:16: undefined: CacheLineSize
../go/pkg/mod/github.com/refraction-networking/[email protected]/cpu/cpu.go:46:14: undefined: CacheLineSize
../go/pkg/mod/github.com/refraction-networking/[email protected]/cpu/cpu.go:58:14: undefined: CacheLineSize
../go/pkg/mod/github.com/refraction-networking/[email protected]/cpu/cpu.go:66:14: undefined: CacheLineSize
../go/pkg/mod/github.com/refraction-networking/[email protected]/cpu/cpu.go:76:14: undefined: CacheLineSize
What I expected to happen: build to succeed without error
When building to Linux or Windows binaries it works fine. However I get this issue with building to wasm. Please can someone let me know what I would need to do to make this build work, or if this build isn't possible.
Looks like we'll need to copy a config file for this architecture from standard's go lib to cpu
folder of this repo
Fixed in #120.