Support tinygo building
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
DataHoarder 2024-05-01 07:25:47 +02:00
parent 55d6161f6e
commit a52b45bf2c
Signed by: DataHoarder
SSH key fingerprint: SHA256:OLTRf6Fl87G52SiR7sWLGNzlJt4WOX+tfI2yxo0z7xk
3 changed files with 27 additions and 20 deletions

View file

@ -212,4 +212,31 @@ steps:
- apk add --no-cache git bash
- apk add --no-cache wasmtime --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing
- PATH=$PATH:$(go env GOROOT)/misc/wasm go test -tags purego -p 1 -failfast -timeout 20m -cover -gcflags=-d=checkptr -v .
---
kind: pipeline
type: docker
name: go-wasm-tinygo
platform:
os: linux
arch: arm64
environment:
GOPROXY: direct
GOARCH: wasm
GOOS: wasip1
GOTRACEBACK: 2
GOEXPERIMENT: "cgocheck2,newinliner"
CGO_ENABLED: "0"
workspace:
path: /drone/src
steps:
- name: test
image: tinygo/tinygo:0.31.2
commands:
- apk update
- apk add --no-cache git bash
- apk add --no-cache wasmtime --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing
- PATH=$PATH:$(go env GOROOT)/misc/wasm tinygo test -tags purego -p 1 -gcflags=-d=checkptr -v .
...

View file

@ -3,5 +3,3 @@
package asm
func Cpuid(op uint32) (eax, ebx, ecx, edx uint32)
func Cpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32)
func Xgetbv(index uint32) (eax, edx uint32)

View file

@ -14,21 +14,3 @@ TEXT ·Cpuid(SB), 7, $0
RET
// func Cpuidex(op, op2 uint32) (eax, ebx, ecx, edx uint32)
TEXT ·Cpuidex(SB), 7, $0
MOVL op+0(FP), AX
MOVL op2+4(FP), CX
CPUID
MOVL AX, eax+8(FP)
MOVL BX, ebx+12(FP)
MOVL CX, ecx+16(FP)
MOVL DX, edx+20(FP)
RET
// func xgetbv(index uint32) (eax, edx uint32)
TEXT ·Xgetbv(SB), 7, $0
MOVL index+0(FP), CX
BYTE $0x0f; BYTE $0x01; BYTE $0xd0 // XGETBV
MOVL AX, eax+8(FP)
MOVL DX, edx+12(FP)
RET