utls icon indicating copy to clipboard operation
utls copied to clipboard

Unable to compile to wasm

Open Titanium-ctrl opened this issue 4 years ago • 1 comments

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.

Titanium-ctrl avatar Jan 12 '21 12:01 Titanium-ctrl

Looks like we'll need to copy a config file for this architecture from standard's go lib to cpu folder of this repo

sergeyfrolov avatar Jul 13 '21 17:07 sergeyfrolov

Fixed in #120.

gaukas avatar Nov 09 '22 16:11 gaukas