Compare commits

..

3 commits

Author SHA1 Message Date
Maxwell G
d8239b5743
Rebuild for CVE-2022-{24675,28327,29526} in golang 2022-07-08 19:25:19 -05:00
Elliott Sales de Andrade
8489c16be4 Merge branch 'f34' into f35 2022-05-08 23:58:06 -04:00
Elliott Sales de Andrade
515f392329 Drop new features from LLVM < 14
They are not available there and warn about being unused.
2022-05-08 23:56:23 -04:00
20 changed files with 678 additions and 767 deletions

38
.gitignore vendored
View file

@ -1,19 +1,37 @@
/tinygo-*.tar.gz
/avr-*.tar.gz
/cmsis-*.tar.gz
/cmsis-*-clean.tar.xz
/cmsis_svd-*.tar.gz
/cmsis_svd-*-clean.tar.xz
/cmsis_svd_data-*.tar.gz
/cmsis_svd_data-*-clean.tar.xz
/compiler-rt-*.src.tar.xz
/compiler-rt-*.src.tar.xz.sig
/macos-minimal-sdk-*.tar.gz
/mingw64-*.tar.gz
/musl-*.tar.gz
/musl-*.tar.gz.asc
/net-*.tar.gz
/nrfx-*.tar.gz
/picolibc-*.tar.gz
/wasi-libc-*.tar.gz
/bdwgc-1166f11f7dee08d7ad369296b24cf8c9582f8789.tar.gz
/tinygo-0.6.0.tar.gz
/tinygo-0.7.0.tar.gz
/tinygo-0.7.1.tar.gz
/tinygo-0.8.0.tar.gz
/tinygo-0.9.0.tar.gz
/tinygo-0.10.0.tar.gz
/tinygo-0.11.0.tar.gz
/tinygo-0.12.0.tar.gz
/tinygo-0.13.0.tar.gz
/tinygo-0.13.1.tar.gz
/tinygo-0.14.0.tar.gz
/tinygo-0.14.1.tar.gz
/tinygo-0.15.0.tar.gz
/tinygo-0.16.0.tar.gz
/tinygo-0.17.0.tar.gz
/tinygo-0.18.0.tar.gz
/tinygo-0.19.0.tar.gz
/tinygo-0.20.0.tar.gz
/tinygo-0.21.0.tar.gz
/musl-1.2.2.tar.gz
/musl-1.2.2.tar.gz.asc
/tinygo-0.22.0.tar.gz
/musl-1.2.0.tar.gz
/musl-1.2.0.tar.gz.asc
/tinygo-0.23.0.tar.gz
/compiler-rt-13.0.0.src.tar.xz.sig
/macos-minimal-sdk-ebb736fda2bec7cea38dcda807518b835a539525.tar.gz
/compiler-rt-12.0.0.src.tar.xz.sig

View file

@ -1,50 +1,38 @@
From fdd5322026e4b7b2e7fe6a80628b7239b4c4eb99 Mon Sep 17 00:00:00 2001
From 8116847a5ef1b2127f8a0f178ae432dc41472454 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Tue, 15 Dec 2020 05:06:04 -0500
Subject: [PATCH 1/5] Skip WASI tests.
Subject: [PATCH 1/8] Skip WASI tests.
We do not have wasmtime available.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
main_test.go | 17 -----------------
1 file changed, 17 deletions(-)
main_test.go | 5 -----
1 file changed, 5 deletions(-)
diff --git a/main_test.go b/main_test.go
index b07d6aaa..ae0a4482 100644
index 3b088ada..dbbf7bfb 100644
--- a/main_test.go
+++ b/main_test.go
@@ -188,22 +188,6 @@ func TestBuild(t *testing.T) {
runTest("gc.go", optionsBoehm, t, nil, nil)
})
@@ -201,10 +201,6 @@ func TestBuild(t *testing.T) {
t.Parallel()
runPlatTests(optionsFromTarget("wasm", sema), tests, t)
})
- t.Run("WASIp1", func(t *testing.T) {
- t.Run("WASI", func(t *testing.T) {
- t.Parallel()
- runPlatTests(optionsFromTarget("wasip1", sema), tests, t)
-
- // Test with -gc=boehm.
- t.Run("gc.go-boehm", func(t *testing.T) {
- t.Parallel()
- optionsBoehm := optionsFromTarget("wasip1", sema)
- optionsBoehm.GC = "boehm"
- runTest("gc.go", optionsBoehm, t, nil, nil)
- })
- })
- t.Run("WASIp2", func(t *testing.T) {
- t.Parallel()
- runPlatTests(optionsFromTarget("wasip2", sema), tests, t)
- runPlatTests(optionsFromTarget("wasi", sema), tests, t)
- })
}
}
if runtime.GOOS == "linux" {
@@ -925,7 +909,6 @@ func TestTest(t *testing.T) {
@@ -405,7 +401,6 @@ func TestTest(t *testing.T) {
// Node/Wasmtime
targ{"WASM", optionsFromTarget("wasm", sema)},
- targ{"WASI", optionsFromTarget("wasip1", sema)},
- targ{"WASI", optionsFromTarget("wasi", sema)},
)
}
for _, targ := range targs {
--
2.50.0
2.35.1

View file

@ -1,58 +0,0 @@
From f650ab16b5a3badf48922f77683ceaf791c82d64 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Wed, 28 Feb 2024 04:26:40 -0500
Subject: [PATCH 2/5] Skip tests that require Go module mode
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
errors_test.go | 2 +-
main_test.go | 2 +-
testdata/errors/loader-invaliddep.go | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/errors_test.go b/errors_test.go
index 871dc4c0..3d0bb162 100644
--- a/errors_test.go
+++ b/errors_test.go
@@ -37,7 +37,7 @@ func TestErrors(t *testing.T) {
{name: "loader-importcycle"},
{name: "loader-invaliddep"},
{name: "loader-invalidpackage"},
- {name: "loader-nopackage"},
+ // {name: "loader-nopackage"},
{name: "optimizer"},
{name: "syntax"},
{name: "types"},
diff --git a/main_test.go b/main_test.go
index ae0a4482..ca052821 100644
--- a/main_test.go
+++ b/main_test.go
@@ -78,7 +78,6 @@ func TestBuild(t *testing.T) {
"json.go",
"map.go",
"math.go",
- "oldgo/",
"print.go",
"reflect.go",
"signal.go",
@@ -1031,6 +1030,7 @@ func ioLogger(t *testing.T, wg *sync.WaitGroup) io.WriteCloser {
}
func TestGetListOfPackages(t *testing.T) {
+ t.Skip("Not available in non-module mode")
opts := optionsFromTarget("", sema)
tests := []struct {
pkgs []string
diff --git a/testdata/errors/loader-invaliddep.go b/testdata/errors/loader-invaliddep.go
index 05c2f2d5..719a617b 100644
--- a/testdata/errors/loader-invaliddep.go
+++ b/testdata/errors/loader-invaliddep.go
@@ -5,4 +5,4 @@ import _ "github.com/tinygo-org/tinygo/testdata/errors/invaliddep"
func main() {
}
-// ERROR: invaliddep{{[\\/]}}invaliddep.go:1:1: expected 'package', found ppackage
+// ERROR: {{.*}}invaliddep{{[\\/]}}invaliddep.go:1:1: expected 'package', found ppackage
--
2.50.0

View file

@ -0,0 +1,122 @@
From 67f561400614dfde114b31f4b08a340fa352939e Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Sun, 2 Jan 2022 05:47:18 -0500
Subject: [PATCH 2/8] Use system mingw64 headers and crt
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
builder/mingw-w64.go | 68 ++++---------------------------------------
compileopts/config.go | 7 ++---
2 files changed, 7 insertions(+), 68 deletions(-)
diff --git a/builder/mingw-w64.go b/builder/mingw-w64.go
index 135cae94..d233068d 100644
--- a/builder/mingw-w64.go
+++ b/builder/mingw-w64.go
@@ -1,31 +1,11 @@
package builder
import (
- "io"
- "os"
- "path/filepath"
- "strings"
-
- "github.com/tinygo-org/tinygo/goenv"
+ "fmt"
)
var MinGW = Library{
- name: "mingw-w64",
- makeHeaders: func(target, includeDir string) error {
- // copy _mingw.h
- srcDir := filepath.Join(goenv.Get("TINYGOROOT"), "lib", "mingw-w64")
- outf, err := os.Create(includeDir + "/_mingw.h")
- if err != nil {
- return err
- }
- defer outf.Close()
- inf, err := os.Open(srcDir + "/mingw-w64-headers/crt/_mingw.h.in")
- if err != nil {
- return err
- }
- _, err = io.Copy(outf, inf)
- return err
- },
+ name: "mingw-w64",
sourceDir: func() string { return "" }, // unused
cflags: func(target, headerPath string) []string {
// No flags necessary because there are no files to compile.
@@ -45,47 +25,9 @@ var MinGW = Library{
// compile these files.
func makeMinGWExtraLibs(tmpdir string) []*compileJob {
var jobs []*compileJob
- root := goenv.Get("TINYGOROOT")
- // Normally all the api-ms-win-crt-*.def files are all compiled to a single
- // .lib file. But to simplify things, we're going to leave them as separate
- // files.
- for _, name := range []string{
- "kernel32.def.in",
- "api-ms-win-crt-conio-l1-1-0.def",
- "api-ms-win-crt-convert-l1-1-0.def",
- "api-ms-win-crt-environment-l1-1-0.def",
- "api-ms-win-crt-filesystem-l1-1-0.def",
- "api-ms-win-crt-heap-l1-1-0.def",
- "api-ms-win-crt-locale-l1-1-0.def",
- "api-ms-win-crt-math-l1-1-0.def.in",
- "api-ms-win-crt-multibyte-l1-1-0.def",
- "api-ms-win-crt-private-l1-1-0.def.in",
- "api-ms-win-crt-process-l1-1-0.def",
- "api-ms-win-crt-runtime-l1-1-0.def.in",
- "api-ms-win-crt-stdio-l1-1-0.def",
- "api-ms-win-crt-string-l1-1-0.def",
- "api-ms-win-crt-time-l1-1-0.def",
- "api-ms-win-crt-utility-l1-1-0.def",
- } {
- outpath := filepath.Join(tmpdir, filepath.Base(name)+".lib")
- inpath := filepath.Join(root, "lib/mingw-w64/mingw-w64-crt/lib-common/"+name)
- job := &compileJob{
- description: "create lib file " + inpath,
- result: outpath,
- run: func(job *compileJob) error {
- defpath := inpath
- if strings.HasSuffix(inpath, ".in") {
- // .in files need to be preprocessed by a preprocessor (-E)
- // first.
- defpath = outpath + ".def"
- err := runCCompiler("-E", "-x", "c", "-Wp,-w", "-P", "-DDEF_X64", "-o", defpath, inpath, "-I"+goenv.Get("TINYGOROOT")+"/lib/mingw-w64/mingw-w64-crt/def-include/")
- if err != nil {
- return err
- }
- }
- return link("ld.lld", "-m", "i386pep", "-o", outpath, defpath)
- },
- }
+ for _, name := range []string{"kernel32", "ucrt"} {
+ outpath := fmt.Sprintf("/usr/x86_64-w64-mingw32/sys-root/mingw/lib/lib%s.a", name)
+ job := dummyCompileJob(outpath)
jobs = append(jobs, job)
}
return jobs
diff --git a/compileopts/config.go b/compileopts/config.go
index b30e653e..d5bfaa25 100644
--- a/compileopts/config.go
+++ b/compileopts/config.go
@@ -306,12 +306,9 @@ func (c *Config) CFlags() []string {
root := goenv.Get("TINYGOROOT")
cflags = append(cflags, "--sysroot="+root+"/lib/wasi-libc/sysroot")
case "mingw-w64":
- root := goenv.Get("TINYGOROOT")
- path, _ := c.LibcPath("mingw-w64")
cflags = append(cflags,
- "--sysroot="+path,
- "-isystem", filepath.Join(root, "lib", "mingw-w64", "mingw-w64-headers", "crt"),
- "-isystem", filepath.Join(root, "lib", "mingw-w64", "mingw-w64-headers", "defaults", "include"),
+ "--sysroot=/usr/x86_64-w64-mingw32/sys-root",
+ "-isystem", "/usr/x86_64-w64-mingw32/sys-root/mingw/include",
"-D_UCRT",
)
case "":
--
2.35.1

View file

@ -1,126 +0,0 @@
From d516beb86673a9b80ca75c41e8fb7cba7e3f126f Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Sun, 27 Oct 2024 23:33:18 -0400
Subject: [PATCH 3/5] Set LLVM search paths for Fedora
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
cgo/libclang_config_llvm15.go | 4 ++--
cgo/libclang_config_llvm16.go | 4 ++--
cgo/libclang_config_llvm17.go | 4 ++--
cgo/libclang_config_llvm18.go | 4 ++--
cgo/libclang_config_llvm19.go | 4 ++--
cgo/libclang_config_llvm20.go | 4 ++--
6 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/cgo/libclang_config_llvm15.go b/cgo/libclang_config_llvm15.go
index edb1128d..0dc87193 100644
--- a/cgo/libclang_config_llvm15.go
+++ b/cgo/libclang_config_llvm15.go
@@ -3,11 +3,11 @@
package cgo
/*
-#cgo linux CFLAGS: -I/usr/lib/llvm-15/include
+#cgo linux CFLAGS: -I/usr/lib64/llvm15/include
#cgo darwin,amd64 CFLAGS: -I/usr/local/opt/llvm@15/include
#cgo darwin,arm64 CFLAGS: -I/opt/homebrew/opt/llvm@15/include
#cgo freebsd CFLAGS: -I/usr/local/llvm15/include
-#cgo linux LDFLAGS: -L/usr/lib/llvm-15/lib -lclang
+#cgo linux LDFLAGS: -L/usr/lib64/llvm15/lib -lclang
#cgo darwin,amd64 LDFLAGS: -L/usr/local/opt/llvm@15/lib -lclang
#cgo darwin,arm64 LDFLAGS: -L/opt/homebrew/opt/llvm@15/lib -lclang
#cgo freebsd LDFLAGS: -L/usr/local/llvm15/lib -lclang
diff --git a/cgo/libclang_config_llvm16.go b/cgo/libclang_config_llvm16.go
index ee354e21..4c338678 100644
--- a/cgo/libclang_config_llvm16.go
+++ b/cgo/libclang_config_llvm16.go
@@ -9,11 +9,11 @@ package cgo
// ln -sf ../../x86_64-linux-gnu/libclang-16.so.1 /usr/lib/llvm-16/lib/libclang.so
/*
-#cgo linux CFLAGS: -I/usr/lib/llvm-16/include
+#cgo linux CFLAGS: -I/usr/lib64/llvm16/include
#cgo darwin,amd64 CFLAGS: -I/usr/local/opt/llvm@16/include
#cgo darwin,arm64 CFLAGS: -I/opt/homebrew/opt/llvm@16/include
#cgo freebsd CFLAGS: -I/usr/local/llvm16/include
-#cgo linux LDFLAGS: -L/usr/lib/llvm-16/lib -lclang
+#cgo linux LDFLAGS: -L/usr/lib64/llvm16/lib -lclang
#cgo darwin,amd64 LDFLAGS: -L/usr/local/opt/llvm@16/lib -lclang
#cgo darwin,arm64 LDFLAGS: -L/opt/homebrew/opt/llvm@16/lib -lclang
#cgo freebsd LDFLAGS: -L/usr/local/llvm16/lib -lclang
diff --git a/cgo/libclang_config_llvm17.go b/cgo/libclang_config_llvm17.go
index 6395d8a3..609b0758 100644
--- a/cgo/libclang_config_llvm17.go
+++ b/cgo/libclang_config_llvm17.go
@@ -3,11 +3,11 @@
package cgo
/*
-#cgo linux CFLAGS: -I/usr/include/llvm-17 -I/usr/include/llvm-c-17 -I/usr/lib/llvm-17/include
+#cgo linux CFLAGS: -I/usr/lib64/llvm17/include
#cgo darwin,amd64 CFLAGS: -I/usr/local/opt/llvm@17/include
#cgo darwin,arm64 CFLAGS: -I/opt/homebrew/opt/llvm@17/include
#cgo freebsd CFLAGS: -I/usr/local/llvm17/include
-#cgo linux LDFLAGS: -L/usr/lib/llvm-17/lib -lclang
+#cgo linux LDFLAGS: -L/usr/lib64/llvm17/lib -lclang
#cgo darwin,amd64 LDFLAGS: -L/usr/local/opt/llvm@17/lib -lclang
#cgo darwin,arm64 LDFLAGS: -L/opt/homebrew/opt/llvm@17/lib -lclang
#cgo freebsd LDFLAGS: -L/usr/local/llvm17/lib -lclang
diff --git a/cgo/libclang_config_llvm18.go b/cgo/libclang_config_llvm18.go
index da181291..76f23129 100644
--- a/cgo/libclang_config_llvm18.go
+++ b/cgo/libclang_config_llvm18.go
@@ -3,11 +3,11 @@
package cgo
/*
-#cgo linux CFLAGS: -I/usr/include/llvm-18 -I/usr/include/llvm-c-18 -I/usr/lib/llvm-18/include
+#cgo linux CFLAGS: -I/usr/lib64/llvm18/include
#cgo darwin,amd64 CFLAGS: -I/usr/local/opt/llvm@18/include
#cgo darwin,arm64 CFLAGS: -I/opt/homebrew/opt/llvm@18/include
#cgo freebsd CFLAGS: -I/usr/local/llvm18/include
-#cgo linux LDFLAGS: -L/usr/lib/llvm-18/lib -lclang
+#cgo linux LDFLAGS: -L/usr/lib64/llvm18/lib -lclang
#cgo darwin,amd64 LDFLAGS: -L/usr/local/opt/llvm@18/lib -lclang
#cgo darwin,arm64 LDFLAGS: -L/opt/homebrew/opt/llvm@18/lib -lclang
#cgo freebsd LDFLAGS: -L/usr/local/llvm18/lib -lclang
diff --git a/cgo/libclang_config_llvm19.go b/cgo/libclang_config_llvm19.go
index 11a64e72..94c95bcb 100644
--- a/cgo/libclang_config_llvm19.go
+++ b/cgo/libclang_config_llvm19.go
@@ -3,11 +3,11 @@
package cgo
/*
-#cgo linux CFLAGS: -I/usr/include/llvm-19 -I/usr/include/llvm-c-19 -I/usr/lib/llvm-19/include
+#cgo linux CFLAGS: -I/usr/lib64/llvm19/include
#cgo darwin,amd64 CFLAGS: -I/usr/local/opt/llvm@19/include
#cgo darwin,arm64 CFLAGS: -I/opt/homebrew/opt/llvm@19/include
#cgo freebsd CFLAGS: -I/usr/local/llvm19/include
-#cgo linux LDFLAGS: -L/usr/lib/llvm-19/lib -lclang
+#cgo linux LDFLAGS: -L/usr/lib64/llvm19/lib -lclang
#cgo darwin,amd64 LDFLAGS: -L/usr/local/opt/llvm@19/lib -lclang
#cgo darwin,arm64 LDFLAGS: -L/opt/homebrew/opt/llvm@19/lib -lclang
#cgo freebsd LDFLAGS: -L/usr/local/llvm19/lib -lclang
diff --git a/cgo/libclang_config_llvm20.go b/cgo/libclang_config_llvm20.go
index faa2e54d..947558d6 100644
--- a/cgo/libclang_config_llvm20.go
+++ b/cgo/libclang_config_llvm20.go
@@ -3,11 +3,11 @@
package cgo
/*
-#cgo linux CFLAGS: -I/usr/include/llvm-20 -I/usr/include/llvm-c-20 -I/usr/lib/llvm-20/include
+#cgo linux CFLAGS: -I/usr/lib64/llvm20/include
#cgo darwin,amd64 CFLAGS: -I/usr/local/opt/llvm@20/include
#cgo darwin,arm64 CFLAGS: -I/opt/homebrew/opt/llvm@20/include
#cgo freebsd CFLAGS: -I/usr/local/llvm20/include
-#cgo linux LDFLAGS: -L/usr/lib/llvm-20/lib -lclang
+#cgo linux LDFLAGS: -L/usr/lib64/llvm20/lib -lclang
#cgo darwin,amd64 LDFLAGS: -L/usr/local/opt/llvm@20/lib -lclang
#cgo darwin,arm64 LDFLAGS: -L/opt/homebrew/opt/llvm@20/lib -lclang
#cgo freebsd LDFLAGS: -L/usr/local/llvm20/lib -lclang
--
2.50.0

View file

@ -0,0 +1,64 @@
From b9ac4d7d45fe7710f7f5264ab182d7a2a10ddace Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Mon, 3 Jan 2022 22:39:31 -0500
Subject: [PATCH 3/8] Skip some cross Linux tests where qemu is broken
The upstream issues will hopefully be fixed soon:
- https://gitlab.com/qemu-project/qemu/-/issues/447
- https://gitlab.com/qemu-project/qemu/-/issues/690
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
main_test.go | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/main_test.go b/main_test.go
index dbbf7bfb..4183c6b1 100644
--- a/main_test.go
+++ b/main_test.go
@@ -248,6 +248,20 @@ func runPlatTests(options compileopts.Options, tests []string, t *testing.T) {
}
func emuCheck(t *testing.T, options compileopts.Options) {
+ // Skip running the test executable due to bugs in qemu.
+ // https://gitlab.com/qemu-project/qemu/-/issues/447
+ // https://gitlab.com/qemu-project/qemu/-/issues/690
+ switch runtime.GOARCH {
+ case "arm64":
+ if options.GOARCH == "386" || options.GOARCH == "arm" {
+ t.Skipf("qemu is broken for this host/target architecture combination")
+ }
+ case "386":
+ if options.GOARCH == "arm" {
+ t.Skipf("qemu is broken for this host/target architecture combination")
+ }
+ }
+
// Check if the emulator is installed.
spec, err := compileopts.LoadTarget(&options)
if err != nil {
@@ -334,6 +348,20 @@ func runTestWithConfig(name string, t *testing.T, options compileopts.Options, c
return
}
+ // Skip running the test executable due to bugs in qemu.
+ // https://gitlab.com/qemu-project/qemu/-/issues/447
+ // https://gitlab.com/qemu-project/qemu/-/issues/690
+ switch runtime.GOARCH {
+ case "arm64":
+ if options.GOARCH == "386" || options.GOARCH == "arm" {
+ return
+ }
+ case "386":
+ if options.GOARCH == "arm" {
+ return
+ }
+ }
+
// putchar() prints CRLF, convert it to LF.
actual := bytes.Replace(stdout.Bytes(), []byte{'\r', '\n'}, []byte{'\n'}, -1)
expected = bytes.Replace(expected, []byte{'\r', '\n'}, []byte{'\n'}, -1) // for Windows
--
2.35.1

View file

@ -1,33 +0,0 @@
From d83874e6ab92ee4142cc7672da226a9091f7211a Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Tue, 31 Dec 2024 02:00:17 -0500
Subject: [PATCH 4/5] Normalize expected path for chdir tests
The expected path comes from a simple string concatenation in shell, but
`os.Getwd` appears to have the normalized working directory, so this can
fail if any parent directory is a symlink.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
tests/testing/chdir/chdir.go | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/testing/chdir/chdir.go b/tests/testing/chdir/chdir.go
index 75281c21..660b25ac 100644
--- a/tests/testing/chdir/chdir.go
+++ b/tests/testing/chdir/chdir.go
@@ -20,6 +20,11 @@ func main() {
}
if runtime.GOOS == "windows" {
cwd = filepath.ToSlash(cwd)
+ } else {
+ expectDir, err = filepath.EvalSymlinks(expectDir)
+ if err != nil {
+ log.Fatal(err)
+ }
}
if cwd != expectDir {
log.Fatalf("expected:\"%v\" != os.Getwd():\"%v\"", expectDir, cwd)
--
2.50.0

View file

@ -0,0 +1,78 @@
From 12016fd98fe0f0eb818f059a9b88465230817954 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Sun, 6 Feb 2022 03:49:16 -0500
Subject: [PATCH 4/8] Suggest optional packages to install if missing
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
builder/jobs.go | 17 +++++++++++++++++
builder/mingw-w64.go | 2 +-
builder/tools.go | 6 +++++-
3 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/builder/jobs.go b/builder/jobs.go
index 3d510974..d24a4165 100644
--- a/builder/jobs.go
+++ b/builder/jobs.go
@@ -7,6 +7,7 @@ import (
"container/heap"
"errors"
"fmt"
+ "os"
"runtime"
"sort"
"strings"
@@ -37,6 +38,22 @@ type compileJob struct {
duration time.Duration // how long it took to run this job (only set after finishing)
}
+// checkIfPackagedFileExistsJob returns a new *compileJob that checks if a file
+// exists. If the file does not exist, the job will fail with an error
+// suggesting to install the named system packageToInstall.
+func checkIfPackagedFileExistsJob(fileName, packageToInstall string) *compileJob {
+ return &compileJob{
+ description: fmt.Sprintf("check if %v exists", fileName),
+ result: fileName,
+ run: func(*compileJob) (err error) {
+ if _, err := os.Stat(fileName); errors.Is(err, os.ErrNotExist) {
+ return fmt.Errorf("%v does not exist; please install %v via dnf", fileName, packageToInstall)
+ }
+ return nil
+ },
+ }
+}
+
// dummyCompileJob returns a new *compileJob that produces an output without
// doing anything. This can be useful where a *compileJob producing an output is
// expected but nothing needs to be done, for example for a load from a cache.
diff --git a/builder/mingw-w64.go b/builder/mingw-w64.go
index d233068d..d2539f6e 100644
--- a/builder/mingw-w64.go
+++ b/builder/mingw-w64.go
@@ -27,7 +27,7 @@ func makeMinGWExtraLibs(tmpdir string) []*compileJob {
var jobs []*compileJob
for _, name := range []string{"kernel32", "ucrt"} {
outpath := fmt.Sprintf("/usr/x86_64-w64-mingw32/sys-root/mingw/lib/lib%s.a", name)
- job := dummyCompileJob(outpath)
+ job := checkIfPackagedFileExistsJob(outpath, "mingw64-crt and mingw64-headers")
jobs = append(jobs, job)
}
return jobs
diff --git a/builder/tools.go b/builder/tools.go
index 53d89bf0..e55719b2 100644
--- a/builder/tools.go
+++ b/builder/tools.go
@@ -46,5 +46,9 @@ func link(linker string, flags ...string) error {
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Dir = goenv.Get("TINYGOROOT")
- return cmd.Run()
+ err := cmd.Run()
+ if linker == "avr-gcc" && errors.Is(err, exec.ErrNotFound) {
+ return errors.New("avr-gcc not found; please install avr-gcc and avr-libc via dnf")
+ }
+ return err
}
--
2.35.1

View file

@ -0,0 +1,50 @@
From e9592baa218826ca59faf7086838a923236baccb Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Sat, 7 May 2022 19:47:59 -0400
Subject: [PATCH 5/8] Skip slice-copy test for LLVM < 14
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
interp/interp_test.go | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/interp/interp_test.go b/interp/interp_test.go
index ae2635af..a1bea65e 100644
--- a/interp/interp_test.go
+++ b/interp/interp_test.go
@@ -3,6 +3,7 @@ package interp
import (
"io/ioutil"
"os"
+ "strconv"
"strings"
"testing"
@@ -10,6 +11,12 @@ import (
)
func TestInterp(t *testing.T) {
+ llvmVersion, err := strconv.Atoi(strings.Split(llvm.Version, ".")[0])
+ if err != nil {
+ // Note: this should never happen and if it does, it will always happen
+ // for a particular build because llvm.Version is a constant.
+ panic(err)
+ }
for _, name := range []string{
"basic",
"phi",
@@ -19,7 +26,10 @@ func TestInterp(t *testing.T) {
"revert",
"alloc",
} {
- name := name // make tc local to this closure
+ name := name // make local to this closure
+ if name == "slice-copy" && llvmVersion < 14 {
+ continue
+ }
t.Run(name, func(t *testing.T) {
t.Parallel()
runTest(t, "testdata/"+name)
--
2.35.1

View file

@ -1,44 +0,0 @@
From 9c8cef8d589dfbd2d913010a1211d8a49279c986 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Sat, 2 Aug 2025 18:30:43 -0400
Subject: [PATCH 5/5] Skip x86 tests on ARM
They are currently broken:
https://github.com/tinygo-org/tinygo/issues/4969
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
main_test.go | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/main_test.go b/main_test.go
index ca052821..13a40997 100644
--- a/main_test.go
+++ b/main_test.go
@@ -192,7 +192,10 @@ func TestBuild(t *testing.T) {
if runtime.GOOS == "linux" {
for name, osArch := range supportedLinuxArches {
options := optionsFromOSARCH(osArch, sema)
- if options.GOARCH != runtime.GOARCH { // Native architecture already run above.
+ if options.GOARCH == "386" && runtime.GOARCH == "arm64" {
+ // This is currently broken running in qemu.
+ // https://github.com/tinygo-org/tinygo/issues/4969
+ } else if options.GOARCH != runtime.GOARCH { // Native architecture already run above.
t.Run(name, func(t *testing.T) {
runPlatTests(options, tests, t)
})
@@ -895,7 +898,10 @@ func TestTest(t *testing.T) {
if runtime.GOOS == "linux" {
for name, osArch := range supportedLinuxArches {
options := optionsFromOSARCH(osArch, sema)
- if options.GOARCH != runtime.GOARCH { // Native architecture already run above.
+ if options.GOARCH == "386" && runtime.GOARCH == "arm64" {
+ // This is currently broken running in qemu.
+ // https://github.com/tinygo-org/tinygo/issues/4969
+ } else if options.GOARCH != runtime.GOARCH { // Native architecture already run above.
targs = append(targs, targ{name, options})
}
}
--
2.50.0

View file

@ -0,0 +1,30 @@
From a1095b1808280148cbb0f0457bf49899ba007833 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Sun, 8 May 2022 04:18:05 -0400
Subject: [PATCH 6/8] Skip TestDirFS on 32-bit systems
Because Seek is not fully implemented there.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
src/os/file_go_116_test.go | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/os/file_go_116_test.go b/src/os/file_go_116_test.go
index c218a02d..a7e13003 100644
--- a/src/os/file_go_116_test.go
+++ b/src/os/file_go_116_test.go
@@ -24,6 +24,10 @@ func TestDirFS(t *testing.T) {
t.Log("TODO: implement Readdir for Windows")
return
}
+ if runtime.GOARCH == "386" || runtime.GOARCH == "arm" {
+ t.Log("TODO: implement seek for 386 and arm")
+ return
+ }
if err := fstest.TestFS(DirFS("./testdata/dirfs"), "a", "b", "dir/x"); err != nil {
t.Fatal(err)
}
--
2.35.1

View file

@ -0,0 +1,38 @@
From 3a2a96984d51beb348a9003ae8221a935a626918 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Sun, 8 May 2022 18:39:26 -0400
Subject: [PATCH 7/8] Skip broken tests on i686
* compress/flate runs out of memory
* testing/fstest uses Seek, which is not implemented there
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
Makefile | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile
index dc388c21..359ec8f5 100644
--- a/Makefile
+++ b/Makefile
@@ -295,12 +295,15 @@ TEST_PACKAGES_FAST = \
# Additional standard library packages that pass tests on individual platforms
TEST_PACKAGES_LINUX := \
archive/zip \
- compress/flate \
compress/lzw \
debug/dwarf \
debug/plan9obj \
- io/fs \
+ io/fs
+ifneq ($(shell uname -p),i686)
+TEST_PACKAGES_LINUX += \
+ compress/flate \
testing/fstest
+endif
TEST_PACKAGES_DARWIN := $(TEST_PACKAGES_LINUX)
--
2.35.1

View file

@ -0,0 +1,103 @@
From 724fbb844dbdd2df5ffaecd72c1d015c7954edd7 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Sun, 8 May 2022 20:53:27 -0400
Subject: [PATCH 8/8] Drop new feature flags on LLVM<14
As they were added in LLVM 14, they cause warnings on the older
versions.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
targets/cortex-m0.json | 2 +-
targets/cortex-m0plus.json | 2 +-
targets/cortex-m3.json | 2 +-
targets/cortex-m4.json | 2 +-
targets/cortex-m7.json | 2 +-
targets/gameboy-advance.json | 2 +-
targets/nintendoswitch.json | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/targets/cortex-m0.json b/targets/cortex-m0.json
index 3df075b1..fe356805 100644
--- a/targets/cortex-m0.json
+++ b/targets/cortex-m0.json
@@ -2,5 +2,5 @@
"inherits": ["cortex-m"],
"llvm-target": "thumbv6m-unknown-unknown-eabi",
"cpu": "cortex-m0",
- "features": "+armv6-m,+soft-float,+strict-align,+thumb-mode,-aes,-bf16,-cdecp0,-cdecp1,-cdecp2,-cdecp3,-cdecp4,-cdecp5,-cdecp6,-cdecp7,-crc,-crypto,-d32,-dotprod,-dsp,-fp-armv8,-fp-armv8d16,-fp-armv8d16sp,-fp-armv8sp,-fp16,-fp16fml,-fp64,-fpregs,-fullfp16,-hwdiv,-hwdiv-arm,-i8mm,-lob,-mve,-mve.fp,-neon,-pacbti,-ras,-sb,-sha2,-vfp2,-vfp2sp,-vfp3,-vfp3d16,-vfp3d16sp,-vfp3sp,-vfp4,-vfp4d16,-vfp4d16sp,-vfp4sp"
+ "features": "+armv6-m,+soft-float,+strict-align,+thumb-mode,-aes,-bf16,-cdecp0,-cdecp1,-cdecp2,-cdecp3,-cdecp4,-cdecp5,-cdecp6,-cdecp7,-crc,-crypto,-d32,-dotprod,-dsp,-fp-armv8,-fp-armv8d16,-fp-armv8d16sp,-fp-armv8sp,-fp16,-fp16fml,-fp64,-fpregs,-fullfp16,-hwdiv,-hwdiv-arm,-i8mm,-lob,-mve,-mve.fp,-neon,-ras,-sb,-sha2,-vfp2,-vfp2sp,-vfp3,-vfp3d16,-vfp3d16sp,-vfp3sp,-vfp4,-vfp4d16,-vfp4d16sp,-vfp4sp"
}
diff --git a/targets/cortex-m0plus.json b/targets/cortex-m0plus.json
index f1d35ea1..a21d06ca 100644
--- a/targets/cortex-m0plus.json
+++ b/targets/cortex-m0plus.json
@@ -2,5 +2,5 @@
"inherits": ["cortex-m"],
"llvm-target": "thumbv6m-unknown-unknown-eabi",
"cpu": "cortex-m0plus",
- "features": "+armv6-m,+soft-float,+strict-align,+thumb-mode,-aes,-bf16,-cdecp0,-cdecp1,-cdecp2,-cdecp3,-cdecp4,-cdecp5,-cdecp6,-cdecp7,-crc,-crypto,-d32,-dotprod,-dsp,-fp-armv8,-fp-armv8d16,-fp-armv8d16sp,-fp-armv8sp,-fp16,-fp16fml,-fp64,-fpregs,-fullfp16,-hwdiv,-hwdiv-arm,-i8mm,-lob,-mve,-mve.fp,-neon,-pacbti,-ras,-sb,-sha2,-vfp2,-vfp2sp,-vfp3,-vfp3d16,-vfp3d16sp,-vfp3sp,-vfp4,-vfp4d16,-vfp4d16sp,-vfp4sp"
+ "features": "+armv6-m,+soft-float,+strict-align,+thumb-mode,-aes,-bf16,-cdecp0,-cdecp1,-cdecp2,-cdecp3,-cdecp4,-cdecp5,-cdecp6,-cdecp7,-crc,-crypto,-d32,-dotprod,-dsp,-fp-armv8,-fp-armv8d16,-fp-armv8d16sp,-fp-armv8sp,-fp16,-fp16fml,-fp64,-fpregs,-fullfp16,-hwdiv,-hwdiv-arm,-i8mm,-lob,-mve,-mve.fp,-neon,-ras,-sb,-sha2,-vfp2,-vfp2sp,-vfp3,-vfp3d16,-vfp3d16sp,-vfp3sp,-vfp4,-vfp4d16,-vfp4d16sp,-vfp4sp"
}
diff --git a/targets/cortex-m3.json b/targets/cortex-m3.json
index bb11efea..7b878d52 100644
--- a/targets/cortex-m3.json
+++ b/targets/cortex-m3.json
@@ -2,5 +2,5 @@
"inherits": ["cortex-m"],
"llvm-target": "thumbv7m-unknown-unknown-eabi",
"cpu": "cortex-m3",
- "features": "+armv7-m,+hwdiv,+soft-float,+strict-align,+thumb-mode,-aes,-bf16,-cdecp0,-cdecp1,-cdecp2,-cdecp3,-cdecp4,-cdecp5,-cdecp6,-cdecp7,-crc,-crypto,-d32,-dotprod,-dsp,-fp-armv8,-fp-armv8d16,-fp-armv8d16sp,-fp-armv8sp,-fp16,-fp16fml,-fp64,-fpregs,-fullfp16,-hwdiv-arm,-i8mm,-lob,-mve,-mve.fp,-neon,-pacbti,-ras,-sb,-sha2,-vfp2,-vfp2sp,-vfp3,-vfp3d16,-vfp3d16sp,-vfp3sp,-vfp4,-vfp4d16,-vfp4d16sp,-vfp4sp"
+ "features": "+armv7-m,+hwdiv,+soft-float,+strict-align,+thumb-mode,-aes,-bf16,-cdecp0,-cdecp1,-cdecp2,-cdecp3,-cdecp4,-cdecp5,-cdecp6,-cdecp7,-crc,-crypto,-d32,-dotprod,-dsp,-fp-armv8,-fp-armv8d16,-fp-armv8d16sp,-fp-armv8sp,-fp16,-fp16fml,-fp64,-fpregs,-fullfp16,-hwdiv-arm,-i8mm,-lob,-mve,-mve.fp,-neon,-ras,-sb,-sha2,-vfp2,-vfp2sp,-vfp3,-vfp3d16,-vfp3d16sp,-vfp3sp,-vfp4,-vfp4d16,-vfp4d16sp,-vfp4sp"
}
diff --git a/targets/cortex-m4.json b/targets/cortex-m4.json
index 58b16736..8bcbf767 100644
--- a/targets/cortex-m4.json
+++ b/targets/cortex-m4.json
@@ -2,5 +2,5 @@
"inherits": ["cortex-m"],
"llvm-target": "thumbv7em-unknown-unknown-eabi",
"cpu": "cortex-m4",
- "features": "+armv7e-m,+dsp,+hwdiv,+soft-float,+strict-align,+thumb-mode,-aes,-bf16,-cdecp0,-cdecp1,-cdecp2,-cdecp3,-cdecp4,-cdecp5,-cdecp6,-cdecp7,-crc,-crypto,-d32,-dotprod,-fp-armv8,-fp-armv8d16,-fp-armv8d16sp,-fp-armv8sp,-fp16,-fp16fml,-fp64,-fpregs,-fullfp16,-hwdiv-arm,-i8mm,-lob,-mve,-mve.fp,-neon,-pacbti,-ras,-sb,-sha2,-vfp2,-vfp2sp,-vfp3,-vfp3d16,-vfp3d16sp,-vfp3sp,-vfp4,-vfp4d16,-vfp4d16sp,-vfp4sp"
+ "features": "+armv7e-m,+dsp,+hwdiv,+soft-float,+strict-align,+thumb-mode,-aes,-bf16,-cdecp0,-cdecp1,-cdecp2,-cdecp3,-cdecp4,-cdecp5,-cdecp6,-cdecp7,-crc,-crypto,-d32,-dotprod,-fp-armv8,-fp-armv8d16,-fp-armv8d16sp,-fp-armv8sp,-fp16,-fp16fml,-fp64,-fpregs,-fullfp16,-hwdiv-arm,-i8mm,-lob,-mve,-mve.fp,-neon,-ras,-sb,-sha2,-vfp2,-vfp2sp,-vfp3,-vfp3d16,-vfp3d16sp,-vfp3sp,-vfp4,-vfp4d16,-vfp4d16sp,-vfp4sp"
}
diff --git a/targets/cortex-m7.json b/targets/cortex-m7.json
index e9abf1de..3ec505f6 100644
--- a/targets/cortex-m7.json
+++ b/targets/cortex-m7.json
@@ -2,5 +2,5 @@
"inherits": ["cortex-m"],
"llvm-target": "thumbv7em-unknown-unknown-eabi",
"cpu": "cortex-m7",
- "features": "+armv7e-m,+dsp,+hwdiv,+soft-float,+strict-align,+thumb-mode,-aes,-bf16,-cdecp0,-cdecp1,-cdecp2,-cdecp3,-cdecp4,-cdecp5,-cdecp6,-cdecp7,-crc,-crypto,-d32,-dotprod,-fp-armv8,-fp-armv8d16,-fp-armv8d16sp,-fp-armv8sp,-fp16,-fp16fml,-fp64,-fpregs,-fullfp16,-hwdiv-arm,-i8mm,-lob,-mve,-mve.fp,-neon,-pacbti,-ras,-sb,-sha2,-vfp2,-vfp2sp,-vfp3,-vfp3d16,-vfp3d16sp,-vfp3sp,-vfp4,-vfp4d16,-vfp4d16sp,-vfp4sp"
+ "features": "+armv7e-m,+dsp,+hwdiv,+soft-float,+strict-align,+thumb-mode,-aes,-bf16,-cdecp0,-cdecp1,-cdecp2,-cdecp3,-cdecp4,-cdecp5,-cdecp6,-cdecp7,-crc,-crypto,-d32,-dotprod,-fp-armv8,-fp-armv8d16,-fp-armv8d16sp,-fp-armv8sp,-fp16,-fp16fml,-fp64,-fpregs,-fullfp16,-hwdiv-arm,-i8mm,-lob,-mve,-mve.fp,-neon,-ras,-sb,-sha2,-vfp2,-vfp2sp,-vfp3,-vfp3d16,-vfp3d16sp,-vfp3sp,-vfp4,-vfp4d16,-vfp4d16sp,-vfp4sp"
}
diff --git a/targets/gameboy-advance.json b/targets/gameboy-advance.json
index 0ead0831..971c7181 100644
--- a/targets/gameboy-advance.json
+++ b/targets/gameboy-advance.json
@@ -1,7 +1,7 @@
{
"llvm-target": "armv4t-unknown-unknown-eabi",
"cpu": "arm7tdmi",
- "features": "+armv4t,+strict-align,-aes,-bf16,-cdecp0,-cdecp1,-cdecp2,-cdecp3,-cdecp4,-cdecp5,-cdecp6,-cdecp7,-crc,-crypto,-d32,-dotprod,-dsp,-fp-armv8,-fp-armv8d16,-fp-armv8d16sp,-fp-armv8sp,-fp16,-fp16fml,-fp64,-fpregs,-fullfp16,-hwdiv,-hwdiv-arm,-i8mm,-lob,-mve,-mve.fp,-neon,-pacbti,-ras,-sb,-sha2,-thumb-mode,-vfp2,-vfp2sp,-vfp3,-vfp3d16,-vfp3d16sp,-vfp3sp,-vfp4,-vfp4d16,-vfp4d16sp,-vfp4sp",
+ "features": "+armv4t,+strict-align,-aes,-bf16,-cdecp0,-cdecp1,-cdecp2,-cdecp3,-cdecp4,-cdecp5,-cdecp6,-cdecp7,-crc,-crypto,-d32,-dotprod,-dsp,-fp-armv8,-fp-armv8d16,-fp-armv8d16sp,-fp-armv8sp,-fp16,-fp16fml,-fp64,-fpregs,-fullfp16,-hwdiv,-hwdiv-arm,-i8mm,-lob,-mve,-mve.fp,-neon,-ras,-sb,-sha2,-thumb-mode,-vfp2,-vfp2sp,-vfp3,-vfp3d16,-vfp3d16sp,-vfp3sp,-vfp4,-vfp4d16,-vfp4d16sp,-vfp4sp",
"build-tags": ["gameboyadvance", "arm7tdmi", "baremetal", "linux", "arm"],
"goos": "linux",
"goarch": "arm",
diff --git a/targets/nintendoswitch.json b/targets/nintendoswitch.json
index 24e35464..0768fc9a 100644
--- a/targets/nintendoswitch.json
+++ b/targets/nintendoswitch.json
@@ -1,7 +1,7 @@
{
"llvm-target": "aarch64",
"cpu": "cortex-a57",
- "features": "+aes,+crc,+crypto,+fp-armv8,+neon,+sha2,+v8a",
+ "features": "+aes,+crc,+crypto,+fp-armv8,+neon,+sha2",
"build-tags": ["nintendoswitch", "arm64"],
"scheduler": "tasks",
"goos": "linux",
--
2.35.1

View file

@ -1,13 +1,13 @@
#!/bin/bash -e
CMSIS_VERSION=9fe411cef1cef5de58e5957b89760759de44e393
CMSIS_SVD_DATA_VERSION=05a9562ec59b87945a8d7177a4b08b7aa2f2fd58
CMSIS_SVD_VERSION=df75ff974c76a911fc2815e29807f5ecaae06fc2
if [ -e "cmsis-${CMSIS_VERSION}-clean.tar.xz" ]; then
echo "Not downloading cmsis-${CMSIS_VERSION}-clean.tar.xz again!"
else
# The license for this tarball is complicated, but the headers are under the
# BSD-3-Clause license, so we only package them.
# The license for this tarball is complicated, but the headers are under a
# simple BSD license, so we only package them.
wget -nc https://github.com/ARM-software/CMSIS/archive/${CMSIS_VERSION}/cmsis-${CMSIS_VERSION}.tar.gz
tar xf cmsis-${CMSIS_VERSION}.tar.gz
tar cJf cmsis-${CMSIS_VERSION}-clean.tar.xz \
@ -16,52 +16,24 @@ tar cJf cmsis-${CMSIS_VERSION}-clean.tar.xz \
rm -r CMSIS-${CMSIS_VERSION}/
fi
if [ -e "cmsis_svd_data-${CMSIS_SVD_DATA_VERSION}-clean.tar.xz" ]; then
echo "Not downloading cmsis_svd_data-${CMSIS_SVD_DATA_VERSION}-clean.tar.xz again!"
if [ -e "cmsis_svd-${CMSIS_SVD_VERSION}-clean.tar.xz" ]; then
echo "Not downloading cmsis_svd-${CMSIS_SVD_VERSION}-clean.tar.xz again!"
else
# This is basically a "collection of random stuff" from various vendors, under
# various licenses. Some licenses are non-free and some are actively hostile,
# but we only need a rather small portion under a good license:
# - Atmel: Apache-2.0 AND BSD-Source-Code
# - Espressif: Apache-2.0
# - Espressif-Community: Apache-2.0 OR MIT
# - Kendryte-Community: ISC
# - Nordic: BSD-3-Clause
# - NXP/L*: Proprietary, so not included.
# - NXP/Q*: Unknown, so not included.
# - NXP/M*: BSD-3-Clause
# - RaspberryPi: BSD-3-Clause
# - Renesas: Proprietary
# - SiFive-Community: ISC AND (Apache-2.0 OR MIT)
# - STMicro: Apache-2.0 AND Proprietary, so only a subset included.
# These directories are not used by TinyGo, so are not kept:
# - ARM_SAMPLE: BSD-3-Clause
# - Allwinner-Community: Apache-2.0 OR MIT
# - ArteryTek: BSD-3-Clause
# - Cypress: Apache-2.0
# - Freescale: Proprietary
# - Fujitsu: Proprietary
# - GigaDevice: Apache-2.0
# - Holtek: Proprietary
# - Infineon: Proprietary
# - Nuvoton: Unknown
# - SiliconLabs: Zlib
# - Spansion: Proprietary
# - TexasInstruments: Proprietary
# - Toshiba: Unknown
wget -nc https://github.com/cmsis-svd/cmsis-svd-data/archive/${CMSIS_SVD_DATA_VERSION}/cmsis_svd_data-${CMSIS_SVD_DATA_VERSION}.tar.gz
tar xf cmsis_svd_data-${CMSIS_SVD_DATA_VERSION}.tar.gz
mapfile -t clean_stmicro < <(grep -Rl '^ *SPDX-License-Identifier: Apache-2.0$' \
cmsis-svd-data-${CMSIS_SVD_DATA_VERSION}/data/STMicro/*.svd)
tar cJf cmsis_svd_data-${CMSIS_SVD_DATA_VERSION}-clean.tar.xz \
cmsis-svd-data-${CMSIS_SVD_DATA_VERSION}/data/Atmel/ \
cmsis-svd-data-${CMSIS_SVD_DATA_VERSION}/data/Espressif/ \
cmsis-svd-data-${CMSIS_SVD_DATA_VERSION}/data/Espressif-Community/ \
cmsis-svd-data-${CMSIS_SVD_DATA_VERSION}/data/Kendryte-Community/ \
cmsis-svd-data-${CMSIS_SVD_DATA_VERSION}/data/Nordic/ \
cmsis-svd-data-${CMSIS_SVD_DATA_VERSION}/data/NXP/M* \
cmsis-svd-data-${CMSIS_SVD_DATA_VERSION}/data/RaspberryPi/ \
cmsis-svd-data-${CMSIS_SVD_DATA_VERSION}/data/SiFive-Community/ \
"${clean_stmicro[@]}"
rm -r cmsis-svd-data-${CMSIS_SVD_DATA_VERSION}/
# but we only need a rather small portion under a good license.
#wget https://github.com/posborne/cmsis-svd/archive/${CMSIS_SVD_VERSION}/cmsis_svd-${CMSIS_SVD_VERSION}.tar.gz
wget -nc https://github.com/tinygo-org/cmsis-svd/archive/${CMSIS_SVD_VERSION}/cmsis_svd-${CMSIS_SVD_VERSION}.tar.gz
tar xf cmsis_svd-${CMSIS_SVD_VERSION}.tar.gz
tar cJf cmsis_svd-${CMSIS_SVD_VERSION}-clean.tar.xz \
cmsis-svd-${CMSIS_SVD_VERSION}/data/Atmel/ \
cmsis-svd-${CMSIS_SVD_VERSION}/data/Espressif/ \
cmsis-svd-${CMSIS_SVD_VERSION}/data/Espressif-Community/ \
cmsis-svd-${CMSIS_SVD_VERSION}/data/Kendryte-Community/ \
cmsis-svd-${CMSIS_SVD_VERSION}/data/SiFive-Community/ \
cmsis-svd-${CMSIS_SVD_VERSION}/data/NXP/M* \
cmsis-svd-${CMSIS_SVD_VERSION}/data/RaspberryPi/ \
# This has a weird license, so we cannot include it.
# cmsis-svd-${CMSIS_SVD_VERSION}/data/STMicro/
rm -r cmsis-svd-${CMSIS_SVD_VERSION}/
fi

View file

@ -1,104 +0,0 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQGNBGLtemUBDADClvDIromq0Y4TX+wyRyYCq5Wus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af0okCdrKAdap8+KbREer9uXhamtvxc49RCoWwuKoKfBz0RdVvMv
R/Py2xV8A7PaIQARAQABiQIlBBgBAgAPBQJa6oE9AhsMBQkB4TOAAAoJEKLHlKmG
QZ2KAaMQALHif2E0PBLVt09vlr4i8jAsQvDrzRajmVPd2B9RpfNU6HJe/y93SZd2
udr9vzgmfd2o5u12vbegKNiMRgp1VyHQDmYlce27jrH5aPuKmos78+o5/p5yPWCv
Rj8zxGKh7le7UPO+7UveKu+bgb3zwTj6bEuHX7fVI+WjGmEH3bbjDGamWxXrpfGc
7+Jr8TN4ZO2OwYBcFOS9U2ZQ6TxrPaCSIm6+j8f+a9HPOuuDc62mMuV/EWQZy0i7
DhDqU2PNpVjQDWQNpHA8oLDrjNFAoJS8gbHABVsFM1VnwBNT2MKcZQmm05dlQ+ll
S6meHNCvTniKIKC+Giz1Yd5JVGDACZWWPxEz6VhpQW/twkxRqwlUdpFt7UgDquTL
M1beQUCZRt81yJTNdrggbhQ2POxOdIO0CPiQv7U1IzndZp6baedeBw4a7FCbj6GY
cQeHxQCrWpQrwigiseG5uhhS9aiaVFEHja9baSLfXlZu/vsR4MdDG5/iEpier/Xw
h1qnpTSY+r31Uw3lTUlPHzlg47PMgPslaIhCzfVggxh9bTqxcDbuYJ7NuoMho3tN
yWfeofTJ7PhKzoXM2Y/rRFoM5gNh1RVA19ngLT5Jwiof8fPZvHJ/9ZkHn+O7eMNm
m5++gYza3pnn2/PoGpGGAKok+sfJiq5Tb7RUefyJTeZiyTZ/XJrA
=tMzl
-----END PGP PUBLIC KEY BLOCK-----

View file

@ -1,38 +0,0 @@
>From e5adcd97b5196e29991b524237381a0202a60659 Mon Sep 17 00:00:00 2001
From: Rich Felker <dalias@aerifal.cx>
Date: Sun, 9 Feb 2025 10:07:19 -0500
Subject: [PATCH] iconv: fix erroneous input validation in EUC-KR decoder
as a result of incorrect bounds checking on the lead byte being
decoded, certain invalid inputs which should produce an encoding
error, such as "\xc8\x41", instead produced out-of-bounds loads from
the ksc table.
in a worst case, the loaded value may not be a valid unicode scalar
value, in which case, if the output encoding was UTF-8, wctomb would
return (size_t)-1, causing an overflow in the output pointer and
remaining buffer size which could clobber memory outside of the output
buffer.
bug report was submitted in private by Nick Wellnhofer on account of
potential security implications.
---
src/locale/iconv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/locale/iconv.c b/src/locale/iconv.c
index 9605c8e9..008c93f0 100644
--- a/src/locale/iconv.c
+++ b/src/locale/iconv.c
@@ -502,7 +502,7 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri
if (c >= 93 || d >= 94) {
c += (0xa1-0x81);
d += 0xa1;
- if (c >= 93 || c>=0xc6-0x81 && d>0x52)
+ if (c > 0xc6-0x81 || c==0xc6-0x81 && d>0x52)
goto ilseq;
if (d-'A'<26) d = d-'A';
else if (d-'a'<26) d = d-'a'+26;
--
2.21.0

View file

@ -1,38 +0,0 @@
>From c47ad25ea3b484e10326f933e927c0bc8cded3da Mon Sep 17 00:00:00 2001
From: Rich Felker <dalias@aerifal.cx>
Date: Wed, 12 Feb 2025 17:06:30 -0500
Subject: [PATCH] iconv: harden UTF-8 output code path against input decoder
bugs
the UTF-8 output code was written assuming an invariant that iconv's
decoders only emit valid Unicode Scalar Values which wctomb can encode
successfully, thereby always returning a value between 1 and 4.
if this invariant is not satisfied, wctomb returns (size_t)-1, and the
subsequent adjustments to the output buffer pointer and remaining
output byte count overflow, moving the output position backwards,
potentially past the beginning of the buffer, without storing any
bytes.
---
src/locale/iconv.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/locale/iconv.c b/src/locale/iconv.c
index 008c93f0..52178950 100644
--- a/src/locale/iconv.c
+++ b/src/locale/iconv.c
@@ -545,6 +545,10 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri
if (*outb < k) goto toobig;
memcpy(*out, tmp, k);
} else k = wctomb_utf8(*out, c);
+ /* This failure condition should be unreachable, but
+ * is included to prevent decoder bugs from translating
+ * into advancement outside the output buffer range. */
+ if (k>4) goto ilseq;
*out += k;
*outb -= k;
break;
--
2.21.0

21
sources
View file

@ -1,15 +1,12 @@
SHA512 (tinygo-0.39.0.tar.gz) = ab9dbe6bfac56470d3703617bd0da152b044e84ced1bfcfb7e7bf6ba8880d07dfac267dca7356ace18bd3ed392ed7031b6cb4a2535ad5f956ab5912ecefe3807
SHA512 (tinygo-0.23.0.tar.gz) = 88eee87eb206c02adbf077f25f0ac1fb068827137d308cdf2b345fc669f0a1305fa0e95409cbd6d58a2515ab752cdd56b7fde81f124341148754782bfbe05714
SHA512 (avr-6624554c02b237b23dc17d53e992bf54033fc228.tar.gz) = 1aa157bd761db38f8680614fa1cf47d7009508f65291b7eaaa5aba1ae76d35103f68a42947b7269a170d2f1cf8fb09941a5d74070fe6d204b68dd15a9ad2ed29
SHA512 (bdwgc-1166f11f7dee08d7ad369296b24cf8c9582f8789.tar.gz) = 030d5a9a0931915a76b1ec270e7208199cf40973ac6c8141c02e34f118f965bedcadff3bb36481b0e45703df8eb2750d20809f3fde367fd5efed5f8a44ccab32
SHA512 (cmsis-9fe411cef1cef5de58e5957b89760759de44e393-clean.tar.xz) = f131fc241f61982c49f334eb502c2f13da61eb7bdaa641ee84a8de30c4d576b735b8aadeafd7d75351473a2df6a42de6a236ecc5dcc616ee6cfcc07af29446f9
SHA512 (cmsis_svd_data-05a9562ec59b87945a8d7177a4b08b7aa2f2fd58-clean.tar.xz) = e8ba9d74fb148dfa8b3ba140d307b243fb38378f69544529455eea5df57d4276b7177d3549228f8acadc4e72c94506456e78025d9b16d606b322fda8ab38327d
SHA512 (compiler-rt-19.1.7.src.tar.xz) = e2e8e6a094525b84184e9e4a4c1a727de518d4ef1a91370515f0c955719dc946fd60e7fabd10f52ab1905ef6d4a86084b8ddfb9b45de838aa1c5ddf3c042748b
SHA512 (compiler-rt-19.1.7.src.tar.xz.sig) = 48550377345331bfa0015d2c5bb6e063507a76e950f8f349a8e6877d35428a11d86bd617ea7a048f1584a42c58da924ef523d622b54ce4ca94eaa12ce290b49c
SHA512 (macos-minimal-sdk-e7c72156eac3ebf29c34cc2faa71efcb1296663f.tar.gz) = 44638fa9786e88327eb5a2f5cf06c8f09149f21b2592802bdd2db04cbdf4dfbee1bc9296af1b7745c4e30ac97f26a714e19168b742526a8a1b4f8ce23d8fa789
SHA512 (mingw64-8526cb618269440a94810b94b77f8bd48c5c3396.tar.gz) = 723d1ac22d8026f31b59d39328f711f36976798445a82daddcdc9fa6ab4346a5030e9c2efc84ef009439b8f021c5c7c120cfa083a7912a5b0212ac6852c005a7
SHA512 (musl-1.2.3.tar.gz) = 9332f713d3eb7de4369bc0327d99252275ee52abf523ee34b894b24a387f67579787f7c72a46cf652e090cffdb0bc3719a4e7b84dca66890b6a37f12e8ad089c
SHA512 (musl-1.2.3.tar.gz.asc) = 01a857dbc3981c90244d4d1d883efe51986652ca5734a741c9d1a4d06c5a22831e85520ac67212268b70c22049317a8f39b3219be182e7e67741add428ac5bc6
SHA512 (net-c134160ae47d38b468b1c5ade43e78ad5a1e616d.tar.gz) = 449149af6bca15fa0fe1a9a8b37b3cab3bf83b177dd78d760fcca561bbacb415d6c7f0a355edf8d0de1b934d13fbce9d307c2a4410f1ff1c3bfe71b28e76b228
SHA512 (cmsis_svd-df75ff974c76a911fc2815e29807f5ecaae06fc2-clean.tar.xz) = 8abbc6f366aed9571a74a4b6e7065ed2d6a59e0495c3745681d9a654d61edd136319788741f7afc781211adb64ed1faeafe9d6acc6be5a16d9ee48e98c5ddeb1
SHA512 (compiler-rt-13.0.0.src.tar.xz) = b35643553d0d3d4deb2f31e2dad8bbac4b772ee3e0c86aa532ce7161da276620fe820193004ee08c62eb8dfd015e04d3853e6a7cc939ac3fb57345702386d583
SHA512 (compiler-rt-13.0.0.src.tar.xz.sig) = c2626f6b0d813e00fdd9abc2ffcdc30d3a906e192da470ea24c010421ff4cc812b171704899ab15e53edb49ff5dd4ebd447425a2469ff80f9503a77e7ee8cdcd
SHA512 (macos-minimal-sdk-ebb736fda2bec7cea38dcda807518b835a539525.tar.gz) = 2f97d5826c79116c851e1efde74faf806de56ac8acc5509d1ab7690d0edf88f6e227b273d2c5ef7d894a8ada2e316e285ef4e58d74ca0c6f91584653154eae10
SHA512 (musl-1.2.0.tar.gz) = 58bd88189a6002356728cea1c6f6605a893fe54f7687595879add4eab283c8692c3b031eb9457ad00d1edd082cfe62fcc0eb5eb1d3bf4f1d749c0efa2a95fec1
SHA512 (musl-1.2.0.tar.gz.asc) = 1639d1f39f3c587011cc6e1ae44774d20d306f4d18fb394bfa86c40f52af53a882ebd5326553b589a1c5316494b77658dc3310c0187836dfd1fd023ccfedaaf0
SHA512 (nrfx-d779b49fc59c7a165e7da1d7cd7d57b28a059f16.tar.gz) = 31c7fc6fd88d4a74e5739b29659cb717a4629480d17d84e491d61c36c435aba16d38ef63d1036e508666a17eeaac5f11a5ff83211f88410f30cc2e152146ee83
SHA512 (picolibc-b92edfda8ac6853772d87cadaeeeaa21b78609b6.tar.gz) = 9fb60d81bd98c96264c81e95cab6622ccacb34da285f7f3c137bd3cd8bc6e87cbc065a2e9d9fdfc7b93eec52f33bbfa70b6d0abc1a30551ebec1af351344cc39
SHA512 (wasi-libc-wasi-sdk-20.tar.gz) = e264240dc7dbcf6398c8ca09bc108298f4a8aa955af22de5a3015fbcde81cb09dd83cd48349090082d5de0e8a3dbcf746c7b14657c67657b3f2f1ab28bb9cf05
SHA512 (picolibc-f68b8204f797d6b3bfbc7c4da4d257961fbc8770.tar.gz) = fa58a7ddcb1a40239a220ca701a83895804b9ddc837652fa18e9aed2603bba2825df2074e2fa4fbf8649bb9a21308e877850273ec9d421795e2ae549f331ab13
SHA512 (wasi-libc-ad5133410f66b93a2381db5b542aad5e0964db96.tar.gz) = 04cb3a25fef7949bf77f262bd939102f5b36e2ae85f28cdbfcd8a8984425fba54fae68049b777974bdbad96882fab383b44203e8f19a776d8a56a55475c4aab6

View file

@ -1,30 +1,27 @@
%bcond check 1
# I'm not sure what this is for, as no tests seem to use it, and it introduces
# some weird license that needs review.
%bcond wasi_cli 0
# Generated by go2rpm 1
%bcond_without check
%global __brp_strip_lto %{nil}
%global __brp_strip_static_archive %{nil}
# https://github.com/tinygo-org/tinygo
%global goipath github.com/tinygo-org/tinygo
Version: 0.39.0
Version: 0.23.0
%global CMSIS_commit 9fe411cef1cef5de58e5957b89760759de44e393
%global avr_commit 6624554c02b237b23dc17d53e992bf54033fc228
%global bdwgc_commit 1166f11f7dee08d7ad369296b24cf8c9582f8789
%global clang_llvm_version 19
%global cmsis_svd_data_commit 05a9562ec59b87945a8d7177a4b08b7aa2f2fd58
%global compiler_rt_version %{clang_llvm_version}.1.7
%global macos_minsdk_commit e7c72156eac3ebf29c34cc2faa71efcb1296663f
%global mingw64_commit 8526cb618269440a94810b94b77f8bd48c5c3396
%global musl_version 1.2.3
%global net_commit c134160ae47d38b468b1c5ade43e78ad5a1e616d
%global nrfx_commit d779b49fc59c7a165e7da1d7cd7d57b28a059f16
%global picolibc_commit b92edfda8ac6853772d87cadaeeeaa21b78609b6
%global wasi_libc_version 20
%global wasi_libc_tag wasi-sdk-%{wasi_libc_version}
%global wasi_cli_version 0.2.0
%global CMSIS_commit 9fe411cef1cef5de58e5957b89760759de44e393
%global avr_commit 6624554c02b237b23dc17d53e992bf54033fc228
%if %{fedora} > 34
%global clang_llvm_version 13
%else
%global clang_llvm_version 12
%endif
%global cmsis_svd_commit df75ff974c76a911fc2815e29807f5ecaae06fc2
%global compiler_rt_version %{clang_llvm_version}.0.0
%global macos_minsdk_commit ebb736fda2bec7cea38dcda807518b835a539525
%global musl_version 1.2.0
%global nrfx_commit d779b49fc59c7a165e7da1d7cd7d57b28a059f16
%global picolibc_commit f68b8204f797d6b3bfbc7c4da4d257961fbc8770
%global wasi_libc_commit ad5133410f66b93a2381db5b542aad5e0964db96
# No longer matching regular Go's /usr/share/gocode because it also provides
# pre-compiled binaries, and symlinks to arch-specific clang headers.
@ -36,109 +33,96 @@ Version: 0.39.0
Go compiler for small places. Microcontrollers, WebAssembly, and command-line
tools. Based on LLVM.}
#global godocs CHANGELOG.md BUILDING.md CONTRIBUTING.md README.md
#global golicenses LICENSE LICENSE.TXT
#global gosupfiles lib/CMSIS/CMSIS/Include/*.h lib/compiler-rt/lib/builtins/*/*.S lib/nrfx/mdk/*.{ld,S} src/examples/wasm/*/*.js targets/*.{js,json,ld,S}
Name: tinygo
Release: %autorelease
Summary: Go compiler for small places
# Main files: BSD-3-Clause
# builder/cc1as.*: Apache-2.0 WITH LLVM-exception
# corpus_test.go: MIT
# CMSIS: BSD-3-Clause (subsetted)
# avr-mcu: Apache-2.0 (packs) AND MIT (Rust code, unused by this package)
# cmsis-svd: Apache-2.0 AND (Apache-2.0 OR MIT) AND BSD-3-Clause AND BSD-Source-Code AND ISC AND MIT (subsetted)
# compiler-rt: Apache-2.0 WITH LLVM-exception OR NCSA OR MIT
# macos-minimal-sdk: APSL-2.0 AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause AND BSD-4-Clause-UC AND ISC AND LicenseRef-Fedora-Public-Domain
# Main files: BSD
# CMSIS: BSD (subsetted)
# avr-mcu: ASL 2.0 (packs) and MIT (Rust code, unused by this package)
# cmsis-svd: ASL 2.0 and BSD and ISC and MIT (subsetted)
# compiler-rt: NCSA or MIT
# macos-minimal-sdk: APSL 2.0 and BSD and ISC and Public Domain
# musl: MIT
# net: BSD-2-Clause
# nrfx: BSD-3-Clause AND Apache-2.0
# picolibc: BSD-2-Clause AND BSD-2-Clause-FreeBSD AND BSD-3-Clause AND ISC AND SMLNJ AND Spencer-94 AND GPLv2 (testing code only, unused by this package)
# wasi-libc: Apache-2.0 WITH LLVM-exception AND Apache-2.0 AND MIT AND BSD-2-Clause AND CC0-1.0 (dlmalloc implementation, unused by this package)
License: %{shrink: BSD-3-Clause AND Apache-2.0 WITH LLVM-exception AND BSD-2-Clause AND MIT AND
Apache-2.0 AND
(Apache-2.0 OR MIT) AND BSD-Source-Code AND ISC AND
(Apache-2.0 WITH LLVM-exception OR NCSA OR MIT) AND
APSL-2.0 AND BSD-2-Clause AND BSD-4-Clause AND BSD-4-Clause-UC AND LicenseRef-Fedora-Public-Domain AND
BSD-2-Clause-FreeBSD AND SMLNJ AND Spencer-94}
# nrfx: BSD and ASL 2.0
# picolibc: BSD and ISC and MIT and GPLv2 (testing code only, unused by this package)
# wasi-libc: BSD and CC0 and ISC and MIT and Public Domain
License: BSD and APSL 2.0 and ASL 2.0 and CC0 and ISC and MIT and (NCSA or MIT) and Public Domain
URL: %{gourl}
Source0: %{gosource}
Source1: clean_tarballs.sh
Source2: cmsis-%{CMSIS_commit}-clean.tar.xz
Source3: https://github.com/avr-rust/avr-mcu/archive/%{avr_commit}/avr-%{avr_commit}.tar.gz
Source4: cmsis_svd_data-%{cmsis_svd_data_commit}-clean.tar.xz
Source4: cmsis_svd-%{cmsis_svd_commit}-clean.tar.xz
Source50: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compiler_rt_version}/compiler-rt-%{compiler_rt_version}.src.tar.xz
Source51: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compiler_rt_version}/compiler-rt-%{compiler_rt_version}.src.tar.xz.sig
Source52: https://src.fedoraproject.org/rpms/compiler-rt/raw/f8e98d51f0c3fdbaa9ce5d99816930e4fcbe504b/f/release-keys.asc#/compiler-rt-release-keys.asc
Source52: tstellar-gpg-key.asc
Source60: https://musl.libc.org/releases/musl-%{musl_version}.tar.gz
Source61: https://musl.libc.org/releases/musl-%{musl_version}.tar.gz.asc
Source62: https://musl.libc.org/musl.pub
Source7: https://github.com/aykevl/macos-minimal-sdk/archive/%{macos_minsdk_commit}/macos-minimal-sdk-%{macos_minsdk_commit}.tar.gz
Source8: https://github.com/NordicSemiconductor/nrfx/archive/%{nrfx_commit}/nrfx-%{nrfx_commit}.tar.gz
Source9: https://github.com/keith-packard/picolibc/archive/%{picolibc_commit}/picolibc-%{picolibc_commit}.tar.gz
Source10: https://github.com/WebAssembly/wasi-libc/archive/%{wasi_libc_tag}/wasi-libc-%{wasi_libc_tag}.tar.gz
Source11: https://github.com/mingw-w64/mingw-w64/archive/%{mingw64_commit}/mingw64-%{mingw64_commit}.tar.gz
Source12: https://github.com/tinygo-org/net/archive/%{net_commit}/net-%{net_commit}.tar.gz
%if %{with wasi_cli}
Source13: https://github.com/WebAssembly/wasi-cli/archive/v%{wasi_cli_version}/wasi-cli-%{wasi_cli_version}.tar.gz
%endif
Source14: https://github.com/ivmai/bdwgc/archive/%{bdwgc_commit}/bdwgc-%{bdwgc_commit}.tar.gz
#
# Unnumbered patches are applied to the main source tree.
# Patches that are 1X00-1X99 are applied to the subdirectory for source X.
#
Source10: https://github.com/WebAssembly/wasi-libc/archive/%{wasi_libc_commit}/wasi-libc-%{wasi_libc_commit}.tar.gz
# We don't have wasmtime to run these.
Patch: 0001-Skip-WASI-tests.patch
# We set GO111MODULE=off during tests, so can't run a few of them.
Patch: 0002-Skip-tests-that-require-Go-module-mode.patch
# Better search paths for non-default LLVM.
Patch: 0003-Set-LLVM-search-paths-for-Fedora.patch
#https://github.com/tinygo-org/tinygo/pull/4677
Patch: 0004-Normalize-expected-path-for-chdir-tests.patch
# https://github.com/tinygo-org/tinygo/issues/4969
Patch: 0005-Skip-x86-tests-on-ARM.patch
Patch0001: 0001-Skip-WASI-tests.patch
# Unbundling things
Patch0002: 0002-Use-system-mingw64-headers-and-crt.patch
# Skip testing some things where qemu is broken:
# https://gitlab.com/qemu-project/qemu/-/issues/447
# https://gitlab.com/qemu-project/qemu/-/issues/690
Patch0003: 0003-Skip-some-cross-Linux-tests-where-qemu-is-broken.patch
# Add Fedora specific dnf instructions
Patch0004: 0004-Suggest-optional-packages-to-install-if-missing.patch
# Fix CVE-2025-26519 in musl.
Patch1600: https://www.openwall.com/lists/musl/2025/02/13/1/1#/musl-cve-2025-26519-1.patch
Patch1601: https://www.openwall.com/lists/musl/2025/02/13/1/2#/musl-cve-2025-26519-2.patch
# https://github.com/tinygo-org/tinygo/pull/2837
Patch0005: 0005-Skip-slice-copy-test-for-LLVM-14.patch
# https://github.com/tinygo-org/tinygo/pull/2840
Patch0006: 0006-Skip-TestDirFS-on-32-bit-systems.patch
Patch0007: 0007-Skip-broken-tests-on-i686.patch
# This feature flag is not available on LLVM < 14.
Patch0008: 0008-Drop-new-feature-flags-on-LLVM-14.patch
# Not supported upstream yet.
ExcludeArch: ppc64le s390x
# https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval
ExcludeArch: %{ix86}
ExcludeArch: armv7hl ppc64le s390x
BuildRequires: clang-devel(major) = %{clang_llvm_version}
BuildRequires: (clang-devel >= %{clang_llvm_version} with clang-devel < %{lua: print(tonumber(rpm.expand('%{clang_llvm_version}')) + 1)})
BuildRequires: golang(github.com/aykevl/go-wasm)
BuildRequires: golang(github.com/blakesmith/ar)
%if %{fedora} > 35
%ifnarch %{ix86}
BuildRequires: chromium
BuildRequires: golang(github.com/chromedp/chromedp) >= 0.7.6
BuildRequires: golang(github.com/chromedp/cdproto/cdp)
%endif
%endif
BuildRequires: golang(github.com/gofrs/flock) >= 0.8.1
BuildRequires: golang(github.com/google/shlex)
BuildRequires: golang(github.com/inhies/go-bytesize)
BuildRequires: golang(github.com/marcinbor85/gohex)
BuildRequires: golang(github.com/mattn/go-colorable) >= 0.1.13
BuildRequires: golang(github.com/mattn/go-tty) >= 0.0.4
BuildRequires: golang(github.com/tetratelabs/wazero) >= 1.6
BuildRequires: golang(golang.org/x/net/http/httpguts) >= 0.35
BuildRequires: golang(github.com/sigurn/crc16)
BuildRequires: golang(go.bug.st/serial) >= 1.6.0
BuildRequires: golang(github.com/mattn/go-colorable) >= 0.1.8
BuildRequires: golang(go.bug.st/serial) >= 1.1.2
BuildRequires: golang(golang.org/x/tools/go/ast/astutil)
BuildRequires: golang(golang.org/x/tools/go/ssa) >= 0.30
BuildRequires: golang(golang.org/x/tools/go/ssa) >= 0.1.7
BuildRequires: golang(gopkg.in/yaml.v2) >= 2.4.0
BuildRequires: golang(tinygo.org/x/go-llvm)
BuildRequires: golang-tests
BuildRequires: llvm-devel(major) = %{clang_llvm_version}
BuildRequires: make
BuildRequires: binaryen >= 116
BuildRequires: avr-gcc
BuildRequires: avr-libc
BuildRequires: binaryen >= 102
# We don't have glibc for arm, so skip these.
#BuildRequires: gcc-arm-linux-gnu
#BuildRequires: gcc-aarch64-linux-gnu
BuildRequires: lld(major) = %{clang_llvm_version}
# BuildRequires: mingw64-crt
# BuildRequires: mingw64-headers
BuildRequires: nodejs >= 18
BuildRequires: lld
BuildRequires: mingw64-crt
BuildRequires: mingw64-headers
BuildRequires: nodejs
BuildRequires: qemu-system-arm-core
BuildRequires: qemu-system-riscv-core
BuildRequires: qemu-user
@ -146,53 +130,46 @@ BuildRequires: qemu-user
# For GPG signature verification
BuildRequires: gnupg2
Requires: clang(major) = %{clang_llvm_version}
Requires: clang
Requires: golang
Requires: lld(major) = %{clang_llvm_version}
Requires: lld
Recommends: avr-gcc
Recommends: avr-libc
# Add this when LLVM supports ESP natively.
# Recommends: esptool
# Recommends: mingw64-crt
# Recommends: mingw64-headers
Recommends: mingw64-crt
Recommends: mingw64-headers
Recommends: qemu-system-arm-core
Recommends: qemu-system-riscv-core
Recommends: qemu-user
# Make note of bundled libc's
Provides: bundled(bdwgc) = %{bdwgc_commit}
Provides: bundled(gc) = %{bdwgc_commit}
Provides: bundled(compiler-rt) = %{compiler_rt_version}
Provides: bundled(musl) = %{musl_version}
Provides: bundled(picolibc) = %{picolibc_commit}
Provides: bundled(wasi-libc) = %{wasi_libc_version}
Provides: bundled(wasi-libc) = %{wasi_libc_commit}
%description
%{common_description}
#gopkg
%prep
%goprep
%autopatch -q -p1 -M 999
%autopatch -p1
tar -C lib -xf %{SOURCE2}
rmdir lib/CMSIS
mv lib/CMSIS-%{CMSIS_commit} lib/CMSIS
pushd lib/CMSIS
%autopatch -q -p1 -m 1200 -M 1299
popd
tar -C lib -xf %{SOURCE3}
rmdir lib/avr
mv lib/avr-mcu-%{avr_commit} lib/avr
pushd lib/avr
%autopatch -q -p1 -m 1300 -M 1399
popd
tar -C lib -xf %{SOURCE4}
rmdir lib/cmsis-svd
mv lib/cmsis-svd-data-%{cmsis_svd_data_commit} lib/cmsis-svd
pushd lib/cmsis-svd
%autopatch -q -p1 -m 1400 -M 1499
popd
mv lib/cmsis-svd-%{cmsis_svd_commit} lib/cmsis-svd
# Verify *before* actually unpacking!
%{gpgverify} --keyring='%{SOURCE52}' --signature='%{SOURCE51}' --data='%{SOURCE50}'
@ -200,93 +177,68 @@ tar -C lib -xf %{SOURCE50}
mv lib/compiler-rt-%{compiler_rt_version}.src/lib/builtins lib/compiler-rt-builtins
mv lib/compiler-rt-%{compiler_rt_version}.src/README.txt lib/compiler-rt-builtins/
mv lib/compiler-rt-%{compiler_rt_version}.src/LICENSE.TXT lib/compiler-rt-builtins/
pushd lib/compiler-rt-builtins
%autopatch -q -p1 -m 1500 -M 1599
popd
# Verify *before* actually unpacking!
%{gpgverify} --keyring='%{SOURCE62}' --signature='%{SOURCE61}' --data='%{SOURCE60}'
tar -C lib -xf %{SOURCE60}
rmdir lib/musl
mv lib/musl-%{musl_version} lib/musl
pushd lib/musl
%autopatch -q -p1 -m 1600 -M 1699
popd
tar -C lib -xf %{SOURCE7}
rmdir lib/macos-minimal-sdk
mv lib/macos-minimal-sdk-%{macos_minsdk_commit} lib/macos-minimal-sdk
pushd lib/macos-minimal-sdk
%autopatch -q -p1 -m 1700 -M 1799
popd
tar -C lib -xf %{SOURCE8}
rmdir lib/nrfx
mv lib/nrfx-%{nrfx_commit} lib/nrfx
rm lib/nrfx/.gitignore
chmod -x lib/nrfx/doc/generate_html_doc.sh
pushd lib/nrfx
%autopatch -q -p1 -m 1800 -M 1899
popd
tar -C lib -xf %{SOURCE9}
rmdir lib/picolibc
mv lib/picolibc-%{picolibc_commit} lib/picolibc
pushd lib/picolibc
%autopatch -q -p1 -m 1900 -M 1999
popd
tar -C lib -xf %{SOURCE10}
rmdir lib/wasi-libc
mv lib/wasi-libc-%{wasi_libc_tag} lib/wasi-libc
pushd lib/wasi-libc
%autopatch -q -p1 -m 11000 -M 11099
popd
mv lib/wasi-libc-%{wasi_libc_commit} lib/wasi-libc
tar -C lib -xf %{SOURCE11}
rmdir lib/mingw-w64
mv lib/mingw-w64-%{mingw64_commit} lib/mingw-w64
pushd lib/mingw-w64
%autopatch -q -p1 -m 11100 -M 11199
popd
tar -C src -xf %{SOURCE12}
rmdir src/net
mv src/net-%{net_commit} src/net
pushd src/net
%autopatch -q -p1 -m 11200 -M 11299
popd
%if %{with wasi_cli}
tar -C lib -xf %{SOURCE13}
rmdir lib/wasi-cli
mv lib/wasi-cli-%{wasi_cli_version} lib/wasi-cli
pushd lib/wasi-cli
%autopatch -q -p1 -m 11300 -M 11399
popd
# These packages were added in Go 1.17, so we can't test them in older Fedora.
%if %{fedora} && %{fedora} < 36
sed -i \
-e 's!crypto/elliptic/internal/fiat !!g' \
-e 's!net/http/internal/ascii !!g' \
Makefile
%endif
# This test is too slow and pretty much freezes.
%ifarch %{ix86}
sed -i -e 's!archive/zip!$(nil)!' Makefile
%endif
tar -C lib -xf %{SOURCE14}
rmdir lib/bdwgc
mv lib/bdwgc-%{bdwgc_commit} lib/bdwgc
pushd lib/bdwgc
%autopatch -q -p1 -m 11400 -M 11499
popd
%build
export GO_BUILDTAGS="llvm%{clang_llvm_version}" GO_LDFLAGS="-X github.com/tinygo-org/tinygo/goenv.TINYGOROOT=%{tinygoroot} "
# Use only GOBUILDTAGS when https://pagure.io/go-rpm-macros/pull-request/34 is
# merged and released.
export BUILDTAGS="llvm%{clang_llvm_version}" LDFLAGS="-X github.com/tinygo-org/tinygo/goenv.TINYGOROOT=%{tinygoroot} "
%gobuild -o %{gobuilddir}/bin/tinygo %{goipath}
GO111MODULE=off %make_build gen-device RENESAS=0 STM32=0
GO111MODULE=off %make_build gen-device STM32=0
for target in thumbv6m-unknown-unknown-eabi-cortex-m0 thumbv6m-unknown-unknown-eabi-cortex-m0plus thumbv7em-unknown-unknown-eabi-cortex-m4; do
mkdir -p ${target}
for libc in compiler-rt picolibc; do
TINYGOROOT=$PWD \
%{gobuilddir}/bin/tinygo \
build-library -target=${target#*eabi-} -o ${target}/${libc} ${libc}
chmod -R a+rX ${target}/${libc}
done
done
%make_build wasi-libc CLANG=clang-%{clang_llvm_version} LLVM_AR=llvm-ar LLVM_NM=llvm-nm
%install
#gopkginstall
install -vdm 0755 %{buildroot}%{_bindir}
install -vpm 0755 %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
install -vdm 0755 %{buildroot}%{tinygoroot}
install -vdm 0755 %{buildroot}%{tinygoroot}/lib
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/bdwgc
cp -rp lib/bdwgc/* %{buildroot}%{tinygoroot}/lib/bdwgc
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/CMSIS
install -vpm 0644 lib/CMSIS/README.md %{buildroot}%{tinygoroot}/lib/CMSIS/
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/CMSIS/CMSIS/Include
@ -294,25 +246,6 @@ install -vpm 0644 lib/CMSIS/CMSIS/Include/* %{buildroot}%{tinygoroot}/lib/CMSIS/
cp -rp lib/compiler-rt-builtins %{buildroot}%{tinygoroot}/lib
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/macos-minimal-sdk
cp -rp lib/macos-minimal-sdk/* %{buildroot}%{tinygoroot}/lib/macos-minimal-sdk
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt
cp -rp lib/mingw-w64/mingw-w64-crt/def-include %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt
cp -rp lib/mingw-w64/mingw-w64-crt/gdtoa %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt
cp -rp lib/mingw-w64/mingw-w64-crt/include %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt
cp -rp lib/mingw-w64/mingw-w64-crt/misc %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt
cp -rp lib/mingw-w64/mingw-w64-crt/stdio %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt/crt
cp -rp lib/mingw-w64/mingw-w64-crt/crt/pseudo-reloc.c %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt/crt
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt/math
cp -rp lib/mingw-w64/mingw-w64-crt/math/x86 %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt/math
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt/lib-common
cp -rp lib/mingw-w64/mingw-w64-crt/lib-common/api-ms-win-crt-* %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt/lib-common
cp -rp lib/mingw-w64/mingw-w64-crt/lib-common/advapi32.def.in %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt/lib-common
cp -rp lib/mingw-w64/mingw-w64-crt/lib-common/kernel32.def.in %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt/lib-common
cp -rp lib/mingw-w64/mingw-w64-crt/lib-common/msvcrt.def.in %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt/lib-common
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-headers/defaults
cp -rp lib/mingw-w64/mingw-w64-headers/crt/ %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-headers
cp -rp lib/mingw-w64/mingw-w64-headers/include %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-headers
cp -rp lib/mingw-w64/mingw-w64-headers/defaults/include %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-headers/defaults
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/musl
cp -rp lib/musl/COPYRIGHT %{buildroot}%{tinygoroot}/lib/musl
cp -rp lib/musl/include %{buildroot}%{tinygoroot}/lib/musl
@ -321,79 +254,26 @@ cp -rp lib/musl/arch/aarch64 %{buildroot}%{tinygoroot}/lib/musl/arch
cp -rp lib/musl/arch/arm %{buildroot}%{tinygoroot}/lib/musl/arch
cp -rp lib/musl/arch/generic %{buildroot}%{tinygoroot}/lib/musl/arch
cp -rp lib/musl/arch/i386 %{buildroot}%{tinygoroot}/lib/musl/arch
cp -rp lib/musl/arch/mips %{buildroot}%{tinygoroot}/lib/musl/arch
cp -rp lib/musl/arch/x86_64 %{buildroot}%{tinygoroot}/lib/musl/arch
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/musl/crt
cp -rp lib/musl/crt/crt1.c %{buildroot}%{tinygoroot}/lib/musl/crt
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/conf %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/ctype %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/env %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/errno %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/exit %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/fcntl %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/include %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/internal %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/legacy %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/linux %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/locale %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/malloc %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/mman %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/math %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/misc %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/multibyte %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/sched %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/signal %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/stdio %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/stdlib %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/string %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/thread %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/time %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/unistd %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/musl/src/process %{buildroot}%{tinygoroot}/lib/musl/src
cp -rp lib/nrfx %{buildroot}%{tinygoroot}/lib/
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/wasi-libc
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/wasi-libc/dlmalloc
cp -rp lib/wasi-libc/dlmalloc/src %{buildroot}%{tinygoroot}/lib/wasi-libc/dlmalloc
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-bottom-half
cp -rp lib/wasi-libc/libc-bottom-half/cloudlibc %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-bottom-half
cp -rp lib/wasi-libc/libc-bottom-half/headers %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-bottom-half
cp -rp lib/wasi-libc/libc-bottom-half/sources %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-bottom-half
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half
cp -rp lib/wasi-libc/libc-top-half/headers %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half
cp -rp lib/wasi-libc/libc-top-half/sources %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl
cp -rp lib/wasi-libc/libc-top-half/musl/include %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/arch
cp -rp lib/wasi-libc/libc-top-half/musl/arch/generic %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/arch
cp -rp lib/wasi-libc/libc-top-half/musl/arch/wasm32 %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/arch
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/conf %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/dirent %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/env %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/errno %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/exit %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/fcntl %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/fenv %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/include %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/internal %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/legacy %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/locale %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/math %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/misc %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/multibyte %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/network %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/stat %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/stdio %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/stdlib %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/string %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/thread %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/time %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
cp -rp lib/wasi-libc/libc-top-half/musl/src/unistd %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-top-half/musl/src
%if %{with wasi_cli}
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/wasi-cli
cp -rp lib/wasi-cli/wit %{buildroot}%{tinygoroot}/lib/wasi-cli/wit
%endif
cp -rp lib/wasi-libc/sysroot %{buildroot}%{tinygoroot}/lib/wasi-libc/
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/picolibc/newlib/libc
cp -rp lib/picolibc/newlib/libc/ctype %{buildroot}%{tinygoroot}/lib/picolibc/newlib/libc
chmod -x %{buildroot}%{tinygoroot}/lib/picolibc/newlib/libc/ctype/{mkcaseconv,mkcategories,mkunidata}
@ -405,15 +285,21 @@ cp -rp lib/picolibc/newlib/libc/tinystdio %{buildroot}%{tinygoroot}/lib/picolibc
chmod -x %{buildroot}%{tinygoroot}/lib/picolibc/newlib/libc/tinystdio/make-dtoa-data
install -vdm 0755 %{buildroot}%{tinygoroot}/lib/picolibc/newlib/libm
cp -rp lib/picolibc/newlib/libm/common %{buildroot}%{tinygoroot}/lib/picolibc/newlib/libm
cp -rp lib/picolibc/newlib/libm/math %{buildroot}%{tinygoroot}/lib/picolibc/newlib/libm
cp -rp lib/picolibc-stdio.c %{buildroot}%{tinygoroot}/lib
install -vdm 0755 %{buildroot}%{tinygoroot}/pkg
for target in thumbv6m-unknown-unknown-eabi-cortex-m0 thumbv6m-unknown-unknown-eabi-cortex-m0plus thumbv7em-unknown-unknown-eabi-cortex-m4; do
install -vdm 0755 %{buildroot}%{tinygoroot}/pkg/${target}
for libc in compiler-rt picolibc; do
cp -rp ${target}/${libc} %{buildroot}%{tinygoroot}/pkg/${target}/
done
done
cp -rp src %{buildroot}%{tinygoroot}/
rm %{buildroot}%{tinygoroot}/src/examples/wasm/.gitignore
cp -rp targets %{buildroot}%{tinygoroot}/
%if %{with check}
%global gotestflags %gocompilerflags -v -tags="llvm%{clang_llvm_version}" -timeout 30m
%global gotestflags %gocompilerflags -v -tags="llvm%{clang_llvm_version}"
%check
export TINYGOROOT=%{buildroot}%{tinygoroot}
export GOPATH=%{buildroot}%{tinygoroot}:%{gopath}
@ -421,12 +307,18 @@ export PATH=%{buildroot}%{_bindir}:$PATH
export GO111MODULE=off
export XDG_CACHE_HOME="${PWD}/$(mktemp -d tinygo.XXXXXX)"
%gocheck -v -t src -t tests
( cd _build/src/%{goipath} && GOPATH=%{currentgosourcedir}/_build:$GOPATH make smoketest STM32=0 XTENSA=0 )
%ifnarch aarch64
make smoketest STM32=0 XTENSA=0
%if %{fedora} > 35
%ifnarch %{ix86} aarch64
make wasmtest
%endif
%endif
%ifarch %{ix86}
make tinygo-test-fast
%else
make tinygo-test
%endif
%endif
%files
@ -434,8 +326,6 @@ make tinygo-test
%license LICENSE
%{_bindir}/tinygo
%{tinygoroot}
%doc %{tinygoroot}/lib/bdwgc/README.md
%license %{tinygoroot}/lib/bdwgc/LICENSE
%doc %{tinygoroot}/lib/CMSIS/README.md
%license %{tinygoroot}/lib/compiler-rt-builtins/LICENSE.TXT
%doc %{tinygoroot}/lib/compiler-rt-builtins/README.txt
@ -443,6 +333,8 @@ make tinygo-test
%doc %{tinygoroot}/lib/nrfx/README.md
%license %{tinygoroot}/lib/musl/COPYRIGHT
#gopkgfiles
%changelog
%autochangelog

BIN
tstellar-gpg-key.asc Normal file

Binary file not shown.