diff --git a/.gitignore b/.gitignore index 305c25b..0f45ff4 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ /compiler-rt-12.0.0.src.tar.xz.sig /compiler-rt-14.0.0.src.tar.xz.sig /tinygo-0.25.0.tar.gz +/tinygo-0.26.0.tar.gz diff --git a/0001-Skip-WASI-tests.patch b/0001-Skip-WASI-tests.patch index 5db9255..6ddce34 100644 --- a/0001-Skip-WASI-tests.patch +++ b/0001-Skip-WASI-tests.patch @@ -1,7 +1,7 @@ -From f62e55a3c636caf2a609a0290701ca7108ab4c46 Mon Sep 17 00:00:00 2001 +From 6b50974a6d4972b755a35d40d87e5bdf9c97d925 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 15 Dec 2020 05:06:04 -0500 -Subject: [PATCH 01/11] Skip WASI tests. +Subject: [PATCH 1/6] Skip WASI tests. We do not have wasmtime available. @@ -11,10 +11,10 @@ Signed-off-by: Elliott Sales de Andrade 1 file changed, 5 deletions(-) diff --git a/main_test.go b/main_test.go -index f620c77d..3e97f481 100644 +index 9ddbe52f..79ae2cf2 100644 --- a/main_test.go +++ b/main_test.go -@@ -165,10 +165,6 @@ func TestBuild(t *testing.T) { +@@ -154,10 +154,6 @@ func TestBuild(t *testing.T) { t.Parallel() runPlatTests(optionsFromTarget("wasm", sema), tests, t) }) @@ -25,7 +25,7 @@ index f620c77d..3e97f481 100644 } } -@@ -408,7 +404,6 @@ func TestTest(t *testing.T) { +@@ -413,7 +409,6 @@ func TestTest(t *testing.T) { // Node/Wasmtime targ{"WASM", optionsFromTarget("wasm", sema)}, diff --git a/0002-Use-system-mingw64-headers-and-crt.patch b/0002-Use-system-mingw64-headers-and-crt.patch index e8dd0c8..187daab 100644 --- a/0002-Use-system-mingw64-headers-and-crt.patch +++ b/0002-Use-system-mingw64-headers-and-crt.patch @@ -1,7 +1,7 @@ -From 7c10e6e5debde713b52008e1f7476ffa036e2d48 Mon Sep 17 00:00:00 2001 +From 76c575659d42187b0c4c15d4f5978c4368800da7 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 2 Jan 2022 05:47:18 -0500 -Subject: [PATCH 02/11] Use system mingw64 headers and crt +Subject: [PATCH 2/6] Use system mingw64 headers and crt Signed-off-by: Elliott Sales de Andrade --- @@ -10,7 +10,7 @@ Signed-off-by: Elliott Sales de Andrade 2 files changed, 7 insertions(+), 68 deletions(-) diff --git a/builder/mingw-w64.go b/builder/mingw-w64.go -index 135cae94..d233068d 100644 +index 27fefee0..d233068d 100644 --- a/builder/mingw-w64.go +++ b/builder/mingw-w64.go @@ -1,31 +1,11 @@ @@ -84,7 +84,7 @@ index 135cae94..d233068d 100644 - // .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/") +- err := runCCompiler("-E", "-x", "c", "-Wp,-w", "-P", "-DDEF_X64", "-DDATA", "-o", defpath, inpath, "-I"+goenv.Get("TINYGOROOT")+"/lib/mingw-w64/mingw-w64-crt/def-include/") - if err != nil { - return err - } @@ -99,10 +99,10 @@ index 135cae94..d233068d 100644 } return jobs diff --git a/compileopts/config.go b/compileopts/config.go -index a006b673..c81a547c 100644 +index ebfc5082..cd49283d 100644 --- a/compileopts/config.go +++ b/compileopts/config.go -@@ -297,12 +297,9 @@ func (c *Config) CFlags() []string { +@@ -304,12 +304,9 @@ func (c *Config) CFlags() []string { root := goenv.Get("TINYGOROOT") cflags = append(cflags, "--sysroot="+root+"/lib/wasi-libc/sysroot") case "mingw-w64": diff --git a/0003-Skip-some-cross-Linux-tests-where-qemu-is-broken.patch b/0003-Skip-some-cross-Linux-tests-where-qemu-is-broken.patch index 789228d..b383fce 100644 --- a/0003-Skip-some-cross-Linux-tests-where-qemu-is-broken.patch +++ b/0003-Skip-some-cross-Linux-tests-where-qemu-is-broken.patch @@ -1,7 +1,7 @@ -From 09c7cf0930704cc07844e6a926c5f8e667350730 Mon Sep 17 00:00:00 2001 +From 2a2e35e4565e8ea7f7ac2d34cb9da24000bb6474 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 3 Jan 2022 22:39:31 -0500 -Subject: [PATCH 03/11] Skip some cross Linux tests where qemu is broken +Subject: [PATCH 3/6] Skip some cross Linux tests where qemu is broken The upstream issues will hopefully be fixed soon: @@ -14,10 +14,10 @@ Signed-off-by: Elliott Sales de Andrade 1 file changed, 28 insertions(+) diff --git a/main_test.go b/main_test.go -index 3e97f481..44d85249 100644 +index 79ae2cf2..9359ef0c 100644 --- a/main_test.go +++ b/main_test.go -@@ -250,6 +250,20 @@ func runPlatTests(options compileopts.Options, tests []string, t *testing.T) { +@@ -252,6 +252,20 @@ func runPlatTests(options compileopts.Options, tests []string, t *testing.T) { } func emuCheck(t *testing.T, options compileopts.Options) { @@ -38,7 +38,7 @@ index 3e97f481..44d85249 100644 // Check if the emulator is installed. spec, err := compileopts.LoadTarget(&options) if err != nil { -@@ -336,6 +350,20 @@ func runTestWithConfig(name string, t *testing.T, options compileopts.Options, c +@@ -341,6 +355,20 @@ func runTestWithConfig(name string, t *testing.T, options compileopts.Options, c return } diff --git a/0004-Suggest-optional-packages-to-install-if-missing.patch b/0004-Suggest-optional-packages-to-install-if-missing.patch index 14ff89c..6f333e2 100644 --- a/0004-Suggest-optional-packages-to-install-if-missing.patch +++ b/0004-Suggest-optional-packages-to-install-if-missing.patch @@ -1,7 +1,7 @@ -From c995ba5cf2fb21c419dc82afe9968a020aadf182 Mon Sep 17 00:00:00 2001 +From 3f935d679870de924aa65d78c23ecdcb483ab4a3 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 6 Feb 2022 03:49:16 -0500 -Subject: [PATCH 04/11] Suggest optional packages to install if missing +Subject: [PATCH 4/6] Suggest optional packages to install if missing Signed-off-by: Elliott Sales de Andrade --- diff --git a/0005-Skip-TestDirFS-on-32-bit-systems.patch b/0005-Skip-TestDirFS-on-32-bit-systems.patch index 877ec55..cdfca0d 100644 --- a/0005-Skip-TestDirFS-on-32-bit-systems.patch +++ b/0005-Skip-TestDirFS-on-32-bit-systems.patch @@ -1,7 +1,7 @@ -From 85a4d526d5109bbd4ca2f56fa00fd1d9fccfe065 Mon Sep 17 00:00:00 2001 +From 41cbdf1cfe50f24b49beb615f0924ea3255c7e7d Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 8 May 2022 04:18:05 -0400 -Subject: [PATCH 05/11] Skip TestDirFS on 32-bit systems +Subject: [PATCH 5/6] Skip TestDirFS on 32-bit systems Because Seek is not fully implemented there. @@ -11,7 +11,7 @@ Signed-off-by: Elliott Sales de Andrade 1 file changed, 4 insertions(+) diff --git a/src/os/os_anyos_test.go b/src/os/os_anyos_test.go -index d8ac01c2..f84a4083 100644 +index dd255fb4..5dc0d860 100644 --- a/src/os/os_anyos_test.go +++ b/src/os/os_anyos_test.go @@ -277,6 +277,10 @@ func TestDirFS(t *testing.T) { diff --git a/0006-Skip-broken-tests-on-i686.patch b/0006-Skip-broken-tests-on-i686.patch index ea1071d..ac4d59f 100644 --- a/0006-Skip-broken-tests-on-i686.patch +++ b/0006-Skip-broken-tests-on-i686.patch @@ -1,7 +1,7 @@ -From c645a887a6989e0210c782bb84d4f31200e0d333 Mon Sep 17 00:00:00 2001 +From a44f31de099aaf6768af2102919f1a8c221ce6f4 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 8 May 2022 18:39:26 -0400 -Subject: [PATCH 06/11] Skip broken tests on i686 +Subject: [PATCH 6/6] Skip broken tests on i686 * compress/flate runs out of memory * testing/fstest uses Seek, which is not implemented there @@ -12,10 +12,10 @@ Signed-off-by: Elliott Sales de Andrade 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile -index 60a5a574..cd3cb2f2 100644 +index 99f67c29..1ef11d29 100644 --- a/Makefile +++ b/Makefile -@@ -328,7 +328,6 @@ TEST_PACKAGES_FAST = \ +@@ -338,15 +338,21 @@ endif # Additional standard library packages that pass tests on individual platforms TEST_PACKAGES_LINUX := \ archive/zip \ @@ -23,8 +23,7 @@ index 60a5a574..cd3cb2f2 100644 compress/lzw \ crypto/hmac \ debug/dwarf \ -@@ -336,8 +335,15 @@ TEST_PACKAGES_LINUX := \ - io/fs \ + debug/plan9obj \ io/ioutil \ strconv \ - testing/fstest \ diff --git a/0008-Temporarily-skip-io-fs-tests.patch b/0008-Temporarily-skip-io-fs-tests.patch deleted file mode 100644 index 6f1c08a..0000000 --- a/0008-Temporarily-skip-io-fs-tests.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 7715588992ca3bd6495fff544a584b2708b1a3f4 Mon Sep 17 00:00:00 2001 -From: Elliott Sales de Andrade -Date: Thu, 21 Jul 2022 02:06:53 -0400 -Subject: [PATCH 08/11] Temporarily skip io/fs tests - -Signed-off-by: Elliott Sales de Andrade ---- - Makefile | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/Makefile b/Makefile -index cd3cb2f2..ff59e5e6 100644 ---- a/Makefile -+++ b/Makefile -@@ -332,7 +332,6 @@ TEST_PACKAGES_LINUX := \ - crypto/hmac \ - debug/dwarf \ - debug/plan9obj \ -- io/fs \ - io/ioutil \ - strconv \ - text/template/parse --- -2.36.1 - diff --git a/0009-Add-ErrProcessDone-error.patch b/0009-Add-ErrProcessDone-error.patch deleted file mode 100644 index 691f13f..0000000 --- a/0009-Add-ErrProcessDone-error.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 08a9276d4c9140545c5238cc3b9c7e20eadb5f97 Mon Sep 17 00:00:00 2001 -From: Elliott Sales de Andrade -Date: Sat, 6 Aug 2022 16:53:48 -0400 -Subject: [PATCH 09/11] Add ErrProcessDone error - -This is used in upstream Go's `os` package now. - -Signed-off-by: Elliott Sales de Andrade ---- - src/os/exec.go | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/src/os/exec.go b/src/os/exec.go -index 030979b2..a80c4316 100644 ---- a/src/os/exec.go -+++ b/src/os/exec.go -@@ -1,6 +1,9 @@ - package os - --import "syscall" -+import ( -+ "errors" -+ "syscall" -+) - - type Signal interface { - String() string -@@ -24,6 +27,9 @@ type ProcAttr struct { - Sys *syscall.SysProcAttr - } - -+// ErrProcessDone indicates a Process has finished. -+var ErrProcessDone = errors.New("os: process already finished") -+ - type ProcessState struct { - } - --- -2.36.1 - diff --git a/0010-Fix-tinygo-test-with-Go-1.19.patch b/0010-Fix-tinygo-test-with-Go-1.19.patch deleted file mode 100644 index 97cb453..0000000 --- a/0010-Fix-tinygo-test-with-Go-1.19.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 246a99fa9991743651f3e518b873e2ab9b20e575 Mon Sep 17 00:00:00 2001 -From: Elliott Sales de Andrade -Date: Sat, 6 Aug 2022 17:25:56 -0400 -Subject: [PATCH 10/11] Fix tinygo-test with Go 1.19 - -One of the internal packages used for tests was moved in that version. - -Signed-off-by: Elliott Sales de Andrade ---- - Makefile | 9 ++++++++- - 1 file changed, 8 insertions(+), 1 deletion(-) - -diff --git a/Makefile b/Makefile -index ff59e5e6..6876dbb5 100644 ---- a/Makefile -+++ b/Makefile -@@ -280,7 +280,6 @@ TEST_PACKAGES_FAST = \ - container/list \ - container/ring \ - crypto/des \ -- crypto/elliptic/internal/fiat \ - crypto/internal/subtle \ - crypto/md5 \ - crypto/rc4 \ -@@ -317,6 +316,14 @@ TEST_PACKAGES_FAST = \ - unicode \ - unicode/utf16 \ - unicode/utf8 \ -+ $(nil) -+ -+# Assume this will go away before Go2, so only check minor version. -+ifeq ($(filter $(shell $(GO) env GOVERSION | cut -f 2 -d.), 16 17 18), ) -+TEST_PACKAGES_FAST += crypto/internal/nistec/fiat -+else -+TEST_PACKAGES_FAST += crypto/elliptic/internal/fiat -+endif - - # archive/zip requires os.ReadAt, which is not yet supported on windows - # debug/plan9obj requires os.ReadAt, which is not yet supported on windows --- -2.36.1 - diff --git a/0011-Fix-tinygo-test-with-Go-1.16.patch b/0011-Fix-tinygo-test-with-Go-1.16.patch deleted file mode 100644 index e9791ef..0000000 --- a/0011-Fix-tinygo-test-with-Go-1.16.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 55856a4dc32934077fb50c9536c33f0eaa0e74cb Mon Sep 17 00:00:00 2001 -From: Elliott Sales de Andrade -Date: Sun, 7 Aug 2022 01:06:32 -0400 -Subject: [PATCH 11/11] Fix tinygo-test with Go 1.16 - -Some of these packages were only added in 1.17 - -Signed-off-by: Elliott Sales de Andrade ---- - Makefile | 9 +++++++-- - 1 file changed, 7 insertions(+), 2 deletions(-) - -diff --git a/Makefile b/Makefile -index 6876dbb5..3bf6e614 100644 ---- a/Makefile -+++ b/Makefile -@@ -304,7 +304,6 @@ TEST_PACKAGES_FAST = \ - math \ - math/cmplx \ - net \ -- net/http/internal/ascii \ - net/mail \ - os \ - path \ -@@ -319,11 +318,17 @@ TEST_PACKAGES_FAST = \ - $(nil) - - # Assume this will go away before Go2, so only check minor version. --ifeq ($(filter $(shell $(GO) env GOVERSION | cut -f 2 -d.), 16 17 18), ) -+GO_MINOR_VERSION := $(shell $(GO) env GOVERSION | cut -f 2 -d.) -+# Added in Go 1.17. -+ifeq ($(filter $(GO_MINOR_VERSION), 16), ) -+TEST_PACKAGES_FAST += net/http/internal/ascii -+ifeq ($(filter $(GO_MINOR_VERSION), 16 17 18), ) -+# Renamed fiat in Go 1.19. - TEST_PACKAGES_FAST += crypto/internal/nistec/fiat - else - TEST_PACKAGES_FAST += crypto/elliptic/internal/fiat - endif -+endif - - # archive/zip requires os.ReadAt, which is not yet supported on windows - # debug/plan9obj requires os.ReadAt, which is not yet supported on windows --- -2.36.1 - diff --git a/sources b/sources index c2fdadb..4597e0f 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ -SHA512 (tinygo-0.25.0.tar.gz) = ec3d7e930f1b1aba79d506f236dc2da4ea0b693167eadb9fe36036da62135a468d6c0be3fe8cd4d888a051219107b86e4a2e79ebddcd0af823bb94281832c1b6 +SHA512 (tinygo-0.26.0.tar.gz) = 7b95f6b4356545b806207092fa315863446227e3f90d05abad1f231b381d402b00654e11ab79472c32d5572ea7183bdd4e5ee34190a13e3aefa668ebcd1042b4 SHA512 (avr-6624554c02b237b23dc17d53e992bf54033fc228.tar.gz) = 1aa157bd761db38f8680614fa1cf47d7009508f65291b7eaaa5aba1ae76d35103f68a42947b7269a170d2f1cf8fb09941a5d74070fe6d204b68dd15a9ad2ed29 SHA512 (cmsis-9fe411cef1cef5de58e5957b89760759de44e393-clean.tar.xz) = f131fc241f61982c49f334eb502c2f13da61eb7bdaa641ee84a8de30c4d576b735b8aadeafd7d75351473a2df6a42de6a236ecc5dcc616ee6cfcc07af29446f9 SHA512 (cmsis_svd-df75ff974c76a911fc2815e29807f5ecaae06fc2-clean.tar.xz) = 8abbc6f366aed9571a74a4b6e7065ed2d6a59e0495c3745681d9a654d61edd136319788741f7afc781211adb64ed1faeafe9d6acc6be5a16d9ee48e98c5ddeb1 diff --git a/tinygo.spec b/tinygo.spec index 6ee3a96..df67c75 100644 --- a/tinygo.spec +++ b/tinygo.spec @@ -6,15 +6,11 @@ # https://github.com/tinygo-org/tinygo %global goipath github.com/tinygo-org/tinygo -Version: 0.25.0 +Version: 0.26.0 %global CMSIS_commit 9fe411cef1cef5de58e5957b89760759de44e393 %global avr_commit 6624554c02b237b23dc17d53e992bf54033fc228 -%if %{fedora} > 35 %global clang_llvm_version 14 -%else -%global clang_llvm_version 13 -%endif %global cmsis_svd_commit df75ff974c76a911fc2815e29807f5ecaae06fc2 %global compiler_rt_version %{clang_llvm_version}.0.0 %global macos_minsdk_commit ebb736fda2bec7cea38dcda807518b835a539525 @@ -83,15 +79,6 @@ Patch0004: 0004-Suggest-optional-packages-to-install-if-missing.patch Patch0005: 0005-Skip-TestDirFS-on-32-bit-systems.patch Patch0006: 0006-Skip-broken-tests-on-i686.patch -# https://github.com/tinygo-org/tinygo/issues/3008 -# Broken due to TestCVE202230630 -Patch0008: 0008-Temporarily-skip-io-fs-tests.patch - -# https://github.com/tinygo-org/tinygo/pull/3060 -Patch0009: 0009-Add-ErrProcessDone-error.patch -Patch0010: 0010-Fix-tinygo-test-with-Go-1.19.patch -Patch0011: 0011-Fix-tinygo-test-with-Go-1.16.patch - # Not supported upstream yet. ExcludeArch: armv7hl ppc64le s390x # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval @@ -100,18 +87,18 @@ ExcludeArch: %{ix86} 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.8 -BuildRequires: golang(go.bug.st/serial) >= 1.1.2 +BuildRequires: golang(github.com/mattn/go-tty) >= 0.0.4 +BuildRequires: golang(go.bug.st/serial) >= 1.3.5 BuildRequires: golang(golang.org/x/tools/go/ast/astutil) BuildRequires: golang(golang.org/x/tools/go/ssa) >= 0.1.11 BuildRequires: golang(gopkg.in/yaml.v2) >= 2.4.0 @@ -263,8 +250,10 @@ 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/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/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/signal %{buildroot}%{tinygoroot}/lib/musl/src cp -rp lib/musl/src/stdio %{buildroot}%{tinygoroot}/lib/musl/src cp -rp lib/musl/src/string %{buildroot}%{tinygoroot}/lib/musl/src @@ -285,6 +274,7 @@ 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 @@ -308,17 +298,15 @@ 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 ) -%if %{fedora} > 35 %ifnarch %{ix86} aarch64 make wasmtest %endif -%endif # Ignoring errors due to CGo issue: # https://github.com/tinygo-org/tinygo/issues/3057 %ifarch %{ix86} -make tinygo-test-fast || true +make tinygo-test-fast %else -make tinygo-test || true +make tinygo-test %endif %endif