diff --git a/.gitignore b/.gitignore index afc1724..18595d5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,45 +1,19 @@ +/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 -/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 -/macos-minimal-sdk-ebb736fda2bec7cea38dcda807518b835a539525.tar.gz -/tinygo-0.25.0.tar.gz -/tinygo-0.26.0.tar.gz -/tinygo-0.27.0.tar.gz -/musl-1.2.3.tar.gz -/musl-1.2.3.tar.gz.asc -/mingw64-8526cb618269440a94810b94b77f8bd48c5c3396.tar.gz -/tinygo-0.28.1.tar.gz -/tinygo-0.29.0.tar.gz -/tinygo-0.30.0.tar.gz +/bdwgc-1166f11f7dee08d7ad369296b24cf8c9582f8789.tar.gz diff --git a/0001-Skip-WASI-tests.patch b/0001-Skip-WASI-tests.patch index 70040f2..32e8ce8 100644 --- a/0001-Skip-WASI-tests.patch +++ b/0001-Skip-WASI-tests.patch @@ -1,38 +1,50 @@ -From ee856392109e39cf60e83022441c94adee205447 Mon Sep 17 00:00:00 2001 +From fdd5322026e4b7b2e7fe6a80628b7239b4c4eb99 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 15 Dec 2020 05:06:04 -0500 -Subject: [PATCH 1/3] Skip WASI tests. +Subject: [PATCH 1/5] Skip WASI tests. We do not have wasmtime available. Signed-off-by: Elliott Sales de Andrade --- - main_test.go | 5 ----- - 1 file changed, 5 deletions(-) + main_test.go | 17 ----------------- + 1 file changed, 17 deletions(-) diff --git a/main_test.go b/main_test.go -index ae7aed56..ac204f0c 100644 +index b07d6aaa..ae0a4482 100644 --- a/main_test.go +++ b/main_test.go -@@ -171,10 +171,6 @@ func TestBuild(t *testing.T) { - t.Parallel() - runPlatTests(optionsFromTarget("wasm", sema), tests, t) +@@ -188,22 +188,6 @@ func TestBuild(t *testing.T) { + runTest("gc.go", optionsBoehm, t, nil, nil) + }) }) -- t.Run("WASI", func(t *testing.T) { +- t.Run("WASIp1", func(t *testing.T) { - t.Parallel() -- runPlatTests(optionsFromTarget("wasi", sema), tests, t) +- 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) - }) } - } -@@ -425,7 +421,6 @@ func TestTest(t *testing.T) { + if runtime.GOOS == "linux" { +@@ -925,7 +909,6 @@ func TestTest(t *testing.T) { // Node/Wasmtime targ{"WASM", optionsFromTarget("wasm", sema)}, -- targ{"WASI", optionsFromTarget("wasi", sema)}, +- targ{"WASI", optionsFromTarget("wasip1", sema)}, ) } for _, targ := range targs { -- -2.41.0 +2.50.0 diff --git a/0002-Skip-some-cross-Linux-tests-where-qemu-is-broken.patch b/0002-Skip-some-cross-Linux-tests-where-qemu-is-broken.patch deleted file mode 100644 index 5c12aca..0000000 --- a/0002-Skip-some-cross-Linux-tests-where-qemu-is-broken.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 1f60829a1fffdcbe268c1998a560fdeb6029407e Mon Sep 17 00:00:00 2001 -From: Elliott Sales de Andrade -Date: Mon, 3 Jan 2022 22:39:31 -0500 -Subject: [PATCH 2/3] 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 ---- - main_test.go | 19 +++++++++++++++++++ - 1 file changed, 19 insertions(+) - -diff --git a/main_test.go b/main_test.go -index ac204f0c..27344c27 100644 ---- a/main_test.go -+++ b/main_test.go -@@ -264,6 +264,13 @@ 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 -+ if runtime.GOARCH == "arm64" && (options.GOARCH == "386" || options.GOARCH == "arm") { -+ t.Skip("qemu is broken for this host/target architecture combination") -+ } -+ - // Check if the emulator is installed. - spec, err := compileopts.LoadTarget(&options) - if err != nil { -@@ -342,6 +349,11 @@ func runTestWithConfig(name string, t *testing.T, options compileopts.Options, c - t.Fatal(err) - } - -+ if runtime.GOARCH == "arm64" && options.GOARCH == "amd64" && name == "reflect.go" { -+ // https://github.com/tinygo-org/tinygo/issues/3888 -+ t.Skip("qemu is broken for this host/target architecture combination") -+ } -+ - // Build the test binary. - stdout := &bytes.Buffer{} - _, err = buildAndRun("./"+path, config, stdout, cmdArgs, environmentVars, time.Minute, func(cmd *exec.Cmd, result builder.BuildResult) error { -@@ -353,6 +365,13 @@ 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 -+ if runtime.GOARCH == "arm64" && (options.GOARCH == "386" || 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.41.0 - diff --git a/0002-Skip-tests-that-require-Go-module-mode.patch b/0002-Skip-tests-that-require-Go-module-mode.patch new file mode 100644 index 0000000..01dc83c --- /dev/null +++ b/0002-Skip-tests-that-require-Go-module-mode.patch @@ -0,0 +1,58 @@ +From f650ab16b5a3badf48922f77683ceaf791c82d64 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +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 +--- + 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 + diff --git a/0003-Set-LLVM-search-paths-for-Fedora.patch b/0003-Set-LLVM-search-paths-for-Fedora.patch new file mode 100644 index 0000000..d375623 --- /dev/null +++ b/0003-Set-LLVM-search-paths-for-Fedora.patch @@ -0,0 +1,126 @@ +From d516beb86673a9b80ca75c41e8fb7cba7e3f126f Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +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 +--- + 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 + diff --git a/0003-Suggest-optional-packages-to-install-if-missing.patch b/0003-Suggest-optional-packages-to-install-if-missing.patch deleted file mode 100644 index 95e0413..0000000 --- a/0003-Suggest-optional-packages-to-install-if-missing.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 3f6a6f241ab37976f07e792986b5c47fdde20c8a Mon Sep 17 00:00:00 2001 -From: Elliott Sales de Andrade -Date: Sun, 6 Feb 2022 03:49:16 -0500 -Subject: [PATCH 3/3] Suggest optional packages to install if missing - -Signed-off-by: Elliott Sales de Andrade ---- - builder/jobs.go | 17 +++++++++++++++++ - 1 file changed, 17 insertions(+) - -diff --git a/builder/jobs.go b/builder/jobs.go -index a23d0753..2380f683 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. --- -2.41.0 - diff --git a/0004-Normalize-expected-path-for-chdir-tests.patch b/0004-Normalize-expected-path-for-chdir-tests.patch new file mode 100644 index 0000000..0285c03 --- /dev/null +++ b/0004-Normalize-expected-path-for-chdir-tests.patch @@ -0,0 +1,33 @@ +From d83874e6ab92ee4142cc7672da226a9091f7211a Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +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 +--- + 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 + diff --git a/0005-Skip-x86-tests-on-ARM.patch b/0005-Skip-x86-tests-on-ARM.patch new file mode 100644 index 0000000..aab0e48 --- /dev/null +++ b/0005-Skip-x86-tests-on-ARM.patch @@ -0,0 +1,44 @@ +From 9c8cef8d589dfbd2d913010a1211d8a49279c986 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +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 +--- + 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 + diff --git a/clean_tarballs.sh b/clean_tarballs.sh index 84b74a5..c3d5ac3 100755 --- a/clean_tarballs.sh +++ b/clean_tarballs.sh @@ -1,13 +1,13 @@ #!/bin/bash -e CMSIS_VERSION=9fe411cef1cef5de58e5957b89760759de44e393 -CMSIS_SVD_VERSION=df75ff974c76a911fc2815e29807f5ecaae06fc2 +CMSIS_SVD_DATA_VERSION=05a9562ec59b87945a8d7177a4b08b7aa2f2fd58 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 a -# simple BSD license, so we only package them. +# The license for this tarball is complicated, but the headers are under the +# BSD-3-Clause 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,24 +16,52 @@ tar cJf cmsis-${CMSIS_VERSION}-clean.tar.xz \ rm -r CMSIS-${CMSIS_VERSION}/ fi -if [ -e "cmsis_svd-${CMSIS_SVD_VERSION}-clean.tar.xz" ]; then -echo "Not downloading cmsis_svd-${CMSIS_SVD_VERSION}-clean.tar.xz again!" +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!" 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. -#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}/ +# 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}/ fi diff --git a/musl-cve-2025-26519-1.patch b/musl-cve-2025-26519-1.patch new file mode 100644 index 0000000..e62d28d --- /dev/null +++ b/musl-cve-2025-26519-1.patch @@ -0,0 +1,38 @@ +>From e5adcd97b5196e29991b524237381a0202a60659 Mon Sep 17 00:00:00 2001 +From: Rich Felker +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 + diff --git a/musl-cve-2025-26519-2.patch b/musl-cve-2025-26519-2.patch new file mode 100644 index 0000000..9b64508 --- /dev/null +++ b/musl-cve-2025-26519-2.patch @@ -0,0 +1,38 @@ +>From c47ad25ea3b484e10326f933e927c0bc8cded3da Mon Sep 17 00:00:00 2001 +From: Rich Felker +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 + + diff --git a/sources b/sources index 80e2c95..e96310c 100644 --- a/sources +++ b/sources @@ -1,13 +1,15 @@ -SHA512 (tinygo-0.30.0.tar.gz) = 91c4b6a578d5730e6915d48c69f567b814d5d1201150df053f116b78be5c29553f2fa8bf05f4565ffb7d1acabc58819a1f0ef2beea9830c4cb99d69116ac4fee +SHA512 (tinygo-0.39.0.tar.gz) = ab9dbe6bfac56470d3703617bd0da152b044e84ced1bfcfb7e7bf6ba8880d07dfac267dca7356ace18bd3ed392ed7031b6cb4a2535ad5f956ab5912ecefe3807 SHA512 (avr-6624554c02b237b23dc17d53e992bf54033fc228.tar.gz) = 1aa157bd761db38f8680614fa1cf47d7009508f65291b7eaaa5aba1ae76d35103f68a42947b7269a170d2f1cf8fb09941a5d74070fe6d204b68dd15a9ad2ed29 +SHA512 (bdwgc-1166f11f7dee08d7ad369296b24cf8c9582f8789.tar.gz) = 030d5a9a0931915a76b1ec270e7208199cf40973ac6c8141c02e34f118f965bedcadff3bb36481b0e45703df8eb2750d20809f3fde367fd5efed5f8a44ccab32 SHA512 (cmsis-9fe411cef1cef5de58e5957b89760759de44e393-clean.tar.xz) = f131fc241f61982c49f334eb502c2f13da61eb7bdaa641ee84a8de30c4d576b735b8aadeafd7d75351473a2df6a42de6a236ecc5dcc616ee6cfcc07af29446f9 -SHA512 (cmsis_svd-df75ff974c76a911fc2815e29807f5ecaae06fc2-clean.tar.xz) = 8abbc6f366aed9571a74a4b6e7065ed2d6a59e0495c3745681d9a654d61edd136319788741f7afc781211adb64ed1faeafe9d6acc6be5a16d9ee48e98c5ddeb1 -SHA512 (compiler-rt-16.0.0.src.tar.xz) = 6906964f0aa12bb18b137bee68a562412abf6d0200f8cfece83dc860ad06de41de847d04809fba08d9e2bb61f27e036eadb51fce153e05181f0bd4fecf29727d -SHA512 (compiler-rt-16.0.0.src.tar.xz.sig) = 8c6de41ed7bed40930fa60f2549ba1267d0b6ef6ed05f3febd879066b9bf8a812a7faccbd3bb791c5780a91f13decc3be0cb5e4cbe7d6281e5e96a4e21593119 -SHA512 (macos-minimal-sdk-ebb736fda2bec7cea38dcda807518b835a539525.tar.gz) = 2f97d5826c79116c851e1efde74faf806de56ac8acc5509d1ab7690d0edf88f6e227b273d2c5ef7d894a8ada2e316e285ef4e58d74ca0c6f91584653154eae10 +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 (nrfx-d779b49fc59c7a165e7da1d7cd7d57b28a059f16.tar.gz) = 31c7fc6fd88d4a74e5739b29659cb717a4629480d17d84e491d61c36c435aba16d38ef63d1036e508666a17eeaac5f11a5ff83211f88410f30cc2e152146ee83 SHA512 (picolibc-b92edfda8ac6853772d87cadaeeeaa21b78609b6.tar.gz) = 9fb60d81bd98c96264c81e95cab6622ccacb34da285f7f3c137bd3cd8bc6e87cbc065a2e9d9fdfc7b93eec52f33bbfa70b6d0abc1a30551ebec1af351344cc39 -SHA512 (wasi-libc-30094b6ed05f19cee102115215863d185f2db4f0.tar.gz) = 17492263fd5dca422f19e0ff8533e1f440e3b7516dc24ef0d16fdc44832cc63ec288c9e930f63b47fb71497144fed55cc313acc74339d067b8d4f5c7c683df0f -SHA512 (mingw64-8526cb618269440a94810b94b77f8bd48c5c3396.tar.gz) = 723d1ac22d8026f31b59d39328f711f36976798445a82daddcdc9fa6ab4346a5030e9c2efc84ef009439b8f021c5c7c120cfa083a7912a5b0212ac6852c005a7 +SHA512 (wasi-libc-wasi-sdk-20.tar.gz) = e264240dc7dbcf6398c8ca09bc108298f4a8aa955af22de5a3015fbcde81cb09dd83cd48349090082d5de0e8a3dbcf746c7b14657c67657b3f2f1ab28bb9cf05 diff --git a/tinygo.spec b/tinygo.spec index d13baeb..0242570 100644 --- a/tinygo.spec +++ b/tinygo.spec @@ -1,24 +1,30 @@ -# Generated by go2rpm 1 -%bcond_without check +%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 %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.30.0 +Version: 0.39.0 -%global CMSIS_commit 9fe411cef1cef5de58e5957b89760759de44e393 -%global avr_commit 6624554c02b237b23dc17d53e992bf54033fc228 -%global clang_llvm_version 16 -%global cmsis_svd_commit df75ff974c76a911fc2815e29807f5ecaae06fc2 -%global compiler_rt_version %{clang_llvm_version}.0.0 -%global macos_minsdk_commit ebb736fda2bec7cea38dcda807518b835a539525 -%global musl_version 1.2.3 -%global nrfx_commit d779b49fc59c7a165e7da1d7cd7d57b28a059f16 -%global picolibc_commit b92edfda8ac6853772d87cadaeeeaa21b78609b6 -%global wasi_libc_commit 30094b6ed05f19cee102115215863d185f2db4f0 -%global mingw64_commit 8526cb618269440a94810b94b77f8bd48c5c3396 +%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 # No longer matching regular Go's /usr/share/gocode because it also provides # pre-compiled binaries, and symlinks to arch-specific clang headers. @@ -30,31 +36,35 @@ Version: 0.30.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 -# 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 +# 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 # musl: MIT -# 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 +# 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} 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-%{cmsis_svd_commit}-clean.tar.xz +Source4: cmsis_svd_data-%{cmsis_svd_data_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 @@ -64,25 +74,40 @@ 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_commit}/wasi-libc-%{wasi_libc_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. +# + # We don't have wasmtime to run these. -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 -Patch0002: 0002-Skip-some-cross-Linux-tests-where-qemu-is-broken.patch -# Add Fedora specific dnf instructions -Patch0003: 0003-Suggest-optional-packages-to-install-if-missing.patch +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 + +# 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 # Not supported upstream yet. ExcludeArch: ppc64le s390x # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86} -BuildRequires: (clang-devel >= %{clang_llvm_version} with clang-devel < %{lua: print(tonumber(rpm.expand('%{clang_llvm_version}')) + 1)}) +BuildRequires: clang-devel(major) = %{clang_llvm_version} BuildRequires: golang(github.com/aykevl/go-wasm) BuildRequires: golang(github.com/blakesmith/ar) BuildRequires: chromium @@ -92,26 +117,28 @@ 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.8 +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(golang.org/x/tools/go/ast/astutil) -BuildRequires: golang(golang.org/x/tools/go/ssa) >= 0.12 +BuildRequires: golang(golang.org/x/tools/go/ssa) >= 0.30 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 >= 102 +BuildRequires: binaryen >= 116 # We don't have glibc for arm, so skip these. #BuildRequires: gcc-arm-linux-gnu #BuildRequires: gcc-aarch64-linux-gnu -BuildRequires: lld +BuildRequires: lld(major) = %{clang_llvm_version} # BuildRequires: mingw64-crt # BuildRequires: mingw64-headers -BuildRequires: nodejs +BuildRequires: nodejs >= 18 BuildRequires: qemu-system-arm-core BuildRequires: qemu-system-riscv-core BuildRequires: qemu-user @@ -119,9 +146,9 @@ BuildRequires: qemu-user # For GPG signature verification BuildRequires: gnupg2 -Requires: clang +Requires: clang(major) = %{clang_llvm_version} Requires: golang -Requires: lld +Requires: lld(major) = %{clang_llvm_version} # Add this when LLVM supports ESP natively. # Recommends: esptool # Recommends: mingw64-crt @@ -131,32 +158,41 @@ 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_commit} +Provides: bundled(wasi-libc) = %{wasi_libc_version} %description %{common_description} -#gopkg - %prep %goprep -%autopatch -p1 +%autopatch -q -p1 -M 999 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-%{cmsis_svd_commit} 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 # Verify *before* actually unpacking! %{gpgverify} --keyring='%{SOURCE52}' --signature='%{SOURCE51}' --data='%{SOURCE50}' @@ -164,60 +200,93 @@ 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_commit} 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 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 +%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 -# 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} " +export GO_BUILDTAGS="llvm%{clang_llvm_version}" GO_LDFLAGS="-X github.com/tinygo-org/tinygo/goenv.TINYGOROOT=%{tinygoroot} " %gobuild -o %{gobuilddir}/bin/tinygo %{goipath} -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 +GO111MODULE=off %make_build gen-device RENESAS=0 STM32=0 %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 @@ -225,12 +294,24 @@ 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/lib-common +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 @@ -240,28 +321,79 @@ 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 -cp -rp lib/wasi-libc/sysroot %{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 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} @@ -275,20 +407,13 @@ 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}" +%global gotestflags %gocompilerflags -v -tags="llvm%{clang_llvm_version}" -timeout 30m %check export TINYGOROOT=%{buildroot}%{tinygoroot} export GOPATH=%{buildroot}%{tinygoroot}:%{gopath} @@ -309,6 +434,8 @@ 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 @@ -316,8 +443,6 @@ make tinygo-test %doc %{tinygoroot}/lib/nrfx/README.md %license %{tinygoroot}/lib/musl/COPYRIGHT -#gopkgfiles - %changelog %autochangelog