From 6bea1c34db81ce378ad4e26b4de9e5daaf186e3f Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 27 Jan 2024 06:16:52 +0000 Subject: [PATCH 01/18] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 2fb69c2ae85f2339c98f5643f51cfcbc7dcd192f Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Sun, 11 Feb 2024 23:40:19 +0000 Subject: [PATCH 02/18] Rebuild for golang 1.22.0 From 62cfc868a2613c27cc73f1d2eb1445b50a3f4f9a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 20 Jul 2024 07:30:20 +0000 Subject: [PATCH 03/18] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 70df58fba13ee0bf8fe7d97af954aba5019ded11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Such=C3=BD?= Date: Wed, 4 Sep 2024 22:24:17 +0200 Subject: [PATCH 04/18] convert license to SPDX This is part of https://fedoraproject.org/wiki/Changes/SPDX_Licenses_Phase_4 --- tinygo.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tinygo.spec b/tinygo.spec index e0f96d3..8169f06 100644 --- a/tinygo.spec +++ b/tinygo.spec @@ -48,7 +48,8 @@ Summary: Go compiler for small places # 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 +# Automatically converted from old format: BSD and APSL 2.0 and ASL 2.0 and CC0 and ISC and MIT and (NCSA or MIT) and Public Domain - review is highly recommended. +License: LicenseRef-Callaway-BSD AND APSL-2.0 AND Apache-2.0 AND CC0-1.0 AND ISC AND LicenseRef-Callaway-MIT AND (NCSA OR LicenseRef-Callaway-MIT) AND LicenseRef-Callaway-Public-Domain URL: %{gourl} Source0: %{gosource} Source1: clean_tarballs.sh From 16bb42b1164efc011f04ab5098edf7228c909a17 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 28 Feb 2024 01:24:23 -0500 Subject: [PATCH 05/18] Switch to SPDX licenses --- clean_tarballs.sh | 31 +++++++++++++++++++++++++------ tinygo.spec | 29 ++++++++++++++++++----------- 2 files changed, 43 insertions(+), 17 deletions(-) diff --git a/clean_tarballs.sh b/clean_tarballs.sh index 84b74a5..3e8e11d 100755 --- a/clean_tarballs.sh +++ b/clean_tarballs.sh @@ -6,8 +6,8 @@ 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 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 \ @@ -21,7 +21,28 @@ 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. +# 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 +# - NXP/L*: Proprietary, so not included. +# - NXP/M*: BSD-3-Clause +# - RaspberryPi: BSD-3-Clause +# - SiFive-Community: ISC +# - STMicro: Proprietary, so not included. +# These directories are not used by TinyGo, so are not kept: +# - ARM_SAMPLE: BSD-3-Clause +# - Cypress: Apache-2.0 +# - Freescale: Proprietary +# - Fujitsu: Proprietary +# - Holtek: Proprietary +# - Nordic: BSD-3-Clause +# - Nuvoton: Unknown +# - SiliconLabs: Unknown +# - Spansion: Proprietary +# - TexasInstruments: Proprietary +# - Toshiba: Unknown #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 @@ -30,10 +51,8 @@ tar cJf cmsis_svd-${CMSIS_SVD_VERSION}-clean.tar.xz \ 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/ + cmsis-svd-${CMSIS_SVD_VERSION}/data/SiFive-Community/ rm -r cmsis-svd-${CMSIS_SVD_VERSION}/ fi diff --git a/tinygo.spec b/tinygo.spec index 8169f06..fac7c13 100644 --- a/tinygo.spec +++ b/tinygo.spec @@ -38,18 +38,25 @@ 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 +# src/net: BSD-2-Clause +# 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 -# Automatically converted from old format: BSD and APSL 2.0 and ASL 2.0 and CC0 and ISC and MIT and (NCSA or MIT) and Public Domain - review is highly recommended. -License: LicenseRef-Callaway-BSD AND APSL-2.0 AND Apache-2.0 AND CC0-1.0 AND ISC AND LicenseRef-Callaway-MIT AND (NCSA OR LicenseRef-Callaway-MIT) AND LicenseRef-Callaway-Public-Domain +# 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 From cc972cf7e521c673e2de70f137471b0d7cb03864 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 19 Jan 2025 12:52:48 +0000 Subject: [PATCH 06/18] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 716d8be33296feb8edfdb221d7b681108efe96ad Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 19:20:17 +0000 Subject: [PATCH 07/18] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From b460c7c931ebc8d121eb7b6a259ec8c6beb0ed23 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 28 Oct 2024 01:09:01 -0400 Subject: [PATCH 08/18] Improve build with non-default LLVM/Clang --- 0001-Skip-WASI-tests.patch | 6 +- ...oss-Linux-tests-where-qemu-is-broken.patch | 6 +- ...ional-packages-to-install-if-missing.patch | 6 +- ...g-in-StringToBytes-optimization-pass.patch | 6 +- 0005-all-use-the-new-LLVM-pass-manager.patch | 6 +- ...e-large-parts-of-picolibc-math-stdio.patch | 6 +- 0007-all-add-initial-LLVM-17-support.patch | 6 +- 0008-Set-LLVM-search-paths-for-Fedora.patch | 92 +++++++++++++++++++ tinygo.spec | 23 ++++- 9 files changed, 131 insertions(+), 26 deletions(-) create mode 100644 0008-Set-LLVM-search-paths-for-Fedora.patch diff --git a/0001-Skip-WASI-tests.patch b/0001-Skip-WASI-tests.patch index 63bc8d7..b8c5e6a 100644 --- a/0001-Skip-WASI-tests.patch +++ b/0001-Skip-WASI-tests.patch @@ -1,7 +1,7 @@ -From ee856392109e39cf60e83022441c94adee205447 Mon Sep 17 00:00:00 2001 +From 7bbd6e2f039a54e73bb38cb6dd5397e84c8e851d Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 15 Dec 2020 05:06:04 -0500 -Subject: [PATCH 1/7] Skip WASI tests. +Subject: [PATCH 1/8] Skip WASI tests. We do not have wasmtime available. @@ -34,5 +34,5 @@ index ae7aed56..ac204f0c 100644 } for _, targ := range targs { -- -2.41.0 +2.47.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 index 79deaa6..40e3bac 100644 --- a/0002-Skip-some-cross-Linux-tests-where-qemu-is-broken.patch +++ b/0002-Skip-some-cross-Linux-tests-where-qemu-is-broken.patch @@ -1,7 +1,7 @@ -From 1f60829a1fffdcbe268c1998a560fdeb6029407e Mon Sep 17 00:00:00 2001 +From b7e64bf1bbcc720c2081d0f76a722b61d12e5b82 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 3 Jan 2022 22:39:31 -0500 -Subject: [PATCH 2/7] Skip some cross Linux tests where qemu is broken +Subject: [PATCH 2/8] Skip some cross Linux tests where qemu is broken The upstream issues will hopefully be fixed soon: @@ -58,5 +58,5 @@ index ac204f0c..27344c27 100644 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 +2.47.0 diff --git a/0003-Suggest-optional-packages-to-install-if-missing.patch b/0003-Suggest-optional-packages-to-install-if-missing.patch index c09cc88..a17c44d 100644 --- a/0003-Suggest-optional-packages-to-install-if-missing.patch +++ b/0003-Suggest-optional-packages-to-install-if-missing.patch @@ -1,7 +1,7 @@ -From 3f6a6f241ab37976f07e792986b5c47fdde20c8a Mon Sep 17 00:00:00 2001 +From fe776e032278a66e3e291a91bad59a3e411c9b57 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 6 Feb 2022 03:49:16 -0500 -Subject: [PATCH 3/7] Suggest optional packages to install if missing +Subject: [PATCH 3/8] Suggest optional packages to install if missing Signed-off-by: Elliott Sales de Andrade --- @@ -44,5 +44,5 @@ index a23d0753..2380f683 100644 // 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 +2.47.0 diff --git a/0004-transform-fix-bug-in-StringToBytes-optimization-pass.patch b/0004-transform-fix-bug-in-StringToBytes-optimization-pass.patch index b0c42ec..7e0a470 100644 --- a/0004-transform-fix-bug-in-StringToBytes-optimization-pass.patch +++ b/0004-transform-fix-bug-in-StringToBytes-optimization-pass.patch @@ -1,7 +1,7 @@ -From bf51015656ff3b1bbe6b41ea1155610178c2961d Mon Sep 17 00:00:00 2001 +From 930064c95f1cd6c0f7088b4f7785d754fa84cc01 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Thu, 21 Sep 2023 15:39:06 +0200 -Subject: [PATCH 4/7] transform: fix bug in StringToBytes optimization pass +Subject: [PATCH 4/8] transform: fix bug in StringToBytes optimization pass Previously, this pass would convert any read-only use of a runtime.stringToBytes call to use the original string buffer instead. @@ -117,5 +117,5 @@ index 30aa520a..b33a1755 100644 + ret void +} -- -2.41.0 +2.47.0 diff --git a/0005-all-use-the-new-LLVM-pass-manager.patch b/0005-all-use-the-new-LLVM-pass-manager.patch index 84eadf2..5816031 100644 --- a/0005-all-use-the-new-LLVM-pass-manager.patch +++ b/0005-all-use-the-new-LLVM-pass-manager.patch @@ -1,7 +1,7 @@ -From 3dcb55f940011bb9bcb75d98182290da60642e4d Mon Sep 17 00:00:00 2001 +From 35221dacbc382c00d57055a3c327b8462282ddbf Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Tue, 19 Sep 2023 22:37:44 +0200 -Subject: [PATCH 5/7] all: use the new LLVM pass manager +Subject: [PATCH 5/8] all: use the new LLVM pass manager The old LLVM pass manager is deprecated and should not be used anymore. Moreover, the pass manager builder (which we used to set up a pass @@ -420,5 +420,5 @@ index ab08317e..429cbd5f 100644 fn.AddFunctionAttr(ctx.CreateEnumAttribute(llvm.AttributeKindID("optsize"), 0)) } -- -2.41.0 +2.47.0 diff --git a/0006-avr-don-t-compile-large-parts-of-picolibc-math-stdio.patch b/0006-avr-don-t-compile-large-parts-of-picolibc-math-stdio.patch index 36bebd7..9ec250f 100644 --- a/0006-avr-don-t-compile-large-parts-of-picolibc-math-stdio.patch +++ b/0006-avr-don-t-compile-large-parts-of-picolibc-math-stdio.patch @@ -1,7 +1,7 @@ -From 0321eecc6d29d5b571930ed97f392623fe80a2e5 Mon Sep 17 00:00:00 2001 +From 2ad6ed3429443910fcb5baacb6a05a1bfe9351ae Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sat, 23 Sep 2023 14:57:25 +0200 -Subject: [PATCH 6/7] avr: don't compile large parts of picolibc (math, stdio) +Subject: [PATCH 6/8] avr: don't compile large parts of picolibc (math, stdio) These parts aren't critical and lead to crashes on small chips without long jumps (like the attiny85) with LLVM 17. (Older LLVM versions would @@ -218,5 +218,5 @@ index 1b7c748b..91ad27be 100644 "libm/common/sf_finite.c", "libm/common/sf_copysign.c", -- -2.41.0 +2.47.0 diff --git a/0007-all-add-initial-LLVM-17-support.patch b/0007-all-add-initial-LLVM-17-support.patch index 1650c1c..37591ba 100644 --- a/0007-all-add-initial-LLVM-17-support.patch +++ b/0007-all-add-initial-LLVM-17-support.patch @@ -1,7 +1,7 @@ -From 55fd04af5a6a815224b436ee491ed05b0ef4ee7c Mon Sep 17 00:00:00 2001 +From d4bda089b8e33050cf05e0d9fce0a73b0b13e014 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sat, 23 Sep 2023 15:03:24 +0200 -Subject: [PATCH 7/7] all: add initial LLVM 17 support +Subject: [PATCH 7/8] all: add initial LLVM 17 support This allows us to test LLVM 17 already, before it's available in Homebrew etc. @@ -153,5 +153,5 @@ index 587efdf2..1b5ad074 100644 +tinygo.org/x/go-llvm v0.0.0-20230923132128-bba3c7009bfd h1:iSVvs8r3ooxYTsmcf7FKCHq83eOSUkWKtmQhnDadDQU= +tinygo.org/x/go-llvm v0.0.0-20230923132128-bba3c7009bfd/go.mod h1:GFbusT2VTA4I+l4j80b17KFK+6whv69Wtny5U+T8RR0= -- -2.41.0 +2.47.0 diff --git a/0008-Set-LLVM-search-paths-for-Fedora.patch b/0008-Set-LLVM-search-paths-for-Fedora.patch new file mode 100644 index 0000000..cdca4f6 --- /dev/null +++ b/0008-Set-LLVM-search-paths-for-Fedora.patch @@ -0,0 +1,92 @@ +From 0e3fa31505241d5317eb61d78c2d3141b179e482 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Sun, 27 Oct 2024 23:33:18 -0400 +Subject: [PATCH 8/8] 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 | 15 +++++++++++++++ + 4 files changed, 21 insertions(+), 6 deletions(-) + create mode 100644 cgo/libclang_config_llvm18.go + +diff --git a/cgo/libclang_config_llvm15.go b/cgo/libclang_config_llvm15.go +index e105dfe7..7e54fc9e 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 -lffi + #cgo darwin,arm64 LDFLAGS: -L/opt/homebrew/opt/llvm@15/lib -lclang -lffi + #cgo freebsd LDFLAGS: -L/usr/local/llvm15/lib -lclang +diff --git a/cgo/libclang_config_llvm16.go b/cgo/libclang_config_llvm16.go +index 28091701..e78f02ff 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 -lffi + #cgo darwin,arm64 LDFLAGS: -L/opt/homebrew/opt/llvm@16/lib -lclang -lffi + #cgo freebsd LDFLAGS: -L/usr/local/llvm16/lib -lclang +diff --git a/cgo/libclang_config_llvm17.go b/cgo/libclang_config_llvm17.go +index fd6d1480..fdf72400 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 -lffi + #cgo darwin,arm64 LDFLAGS: -L/opt/homebrew/opt/llvm@17/lib -lclang -lffi + #cgo freebsd LDFLAGS: -L/usr/local/llvm17/lib -lclang +diff --git a/cgo/libclang_config_llvm18.go b/cgo/libclang_config_llvm18.go +new file mode 100644 +index 00000000..18db6c08 +--- /dev/null ++++ b/cgo/libclang_config_llvm18.go +@@ -0,0 +1,15 @@ ++//go:build !byollvm && !llvm15 && !llvm16 && !llvm17 ++ ++package cgo ++ ++/* ++#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/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 ++*/ ++import "C" +-- +2.47.0 + diff --git a/tinygo.spec b/tinygo.spec index fac7c13..0b2794a 100644 --- a/tinygo.spec +++ b/tinygo.spec @@ -94,12 +94,15 @@ Patch0005: 0005-all-use-the-new-LLVM-pass-manager.patch Patch0006: 0006-avr-don-t-compile-large-parts-of-picolibc-math-stdio.patch Patch0007: 0007-all-add-initial-LLVM-17-support.patch +# Better search paths for non-default LLVM. +Patch0008: 0008-Set-LLVM-search-paths-for-Fedora.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 @@ -125,7 +128,7 @@ 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 +BuildRequires: lld(major) = %{clang_llvm_version} # BuildRequires: mingw64-crt # BuildRequires: mingw64-headers BuildRequires: nodejs @@ -136,9 +139,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 @@ -225,7 +228,17 @@ for target in thumbv6m-unknown-unknown-eabi-cortex-m0 thumbv6m-unknown-unknown-e 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 +LLVM_AR=llvm-ar-%{clang_llvm_version} +if ! command -v $LLVM_AR 2>&1 >/dev/null +then +LLVM_AR=llvm-ar +fi +LLVM_NM=llvm-nm-%{clang_llvm_version} +if ! command -v $LLVM_NM 2>&1 >/dev/null +then +LLVM_NM=llvm-ar +fi +%make_build wasi-libc CLANG=clang-%{clang_llvm_version} LLVM_AR=$LLVM_AR LLVM_NM=$LLVM_NM %install From 36b6b72c3d887df5a9ba46ea61a769a868be6871 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sat, 4 Jan 2025 05:12:33 -0500 Subject: [PATCH 09/18] Update to 0.33.0 --- .gitignore | 43 +- 0001-Skip-WASI-tests.patch | 22 +- ...oss-Linux-tests-where-qemu-is-broken.patch | 14 +- ...ional-packages-to-install-if-missing.patch | 4 +- ...ip-tests-that-require-Go-module-mode.patch | 58 +++ ...g-in-StringToBytes-optimization-pass.patch | 121 ----- ...005-Set-LLVM-search-paths-for-Fedora.patch | 64 ++- 0005-all-use-the-new-LLVM-pass-manager.patch | 424 ------------------ ...e-large-parts-of-picolibc-math-stdio.patch | 222 --------- ...ing-of-external-ld.lld-error-message.patch | 45 ++ 0007-all-add-initial-LLVM-17-support.patch | 157 ------- clean_tarballs.sh | 37 +- sources | 15 +- tinygo.spec | 131 +++--- 14 files changed, 269 insertions(+), 1088 deletions(-) create mode 100644 0004-Skip-tests-that-require-Go-module-mode.patch delete mode 100644 0004-transform-fix-bug-in-StringToBytes-optimization-pass.patch rename 0008-Set-LLVM-search-paths-for-Fedora.patch => 0005-Set-LLVM-search-paths-for-Fedora.patch (72%) delete mode 100644 0005-all-use-the-new-LLVM-pass-manager.patch delete mode 100644 0006-avr-don-t-compile-large-parts-of-picolibc-math-stdio.patch create mode 100644 0006-builder-Fix-parsing-of-external-ld.lld-error-message.patch delete mode 100644 0007-all-add-initial-LLVM-17-support.patch diff --git a/.gitignore b/.gitignore index afc1724..0e53e41 100644 --- a/.gitignore +++ b/.gitignore @@ -1,45 +1,18 @@ +/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 diff --git a/0001-Skip-WASI-tests.patch b/0001-Skip-WASI-tests.patch index b8c5e6a..9b8492d 100644 --- a/0001-Skip-WASI-tests.patch +++ b/0001-Skip-WASI-tests.patch @@ -1,35 +1,39 @@ -From 7bbd6e2f039a54e73bb38cb6dd5397e84c8e851d Mon Sep 17 00:00:00 2001 +From 0395d806d83b1dffc5cd5e2c08c2d3771e585695 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 15 Dec 2020 05:06:04 -0500 -Subject: [PATCH 1/8] Skip WASI tests. +Subject: [PATCH 1/6] 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 | 9 --------- + 1 file changed, 9 deletions(-) diff --git a/main_test.go b/main_test.go -index ae7aed56..ac204f0c 100644 +index 836a4b17..21618761 100644 --- a/main_test.go +++ b/main_test.go -@@ -171,10 +171,6 @@ func TestBuild(t *testing.T) { +@@ -181,14 +181,6 @@ func TestBuild(t *testing.T) { t.Parallel() runPlatTests(optionsFromTarget("wasm", sema), tests, t) }) - t.Run("WASI", func(t *testing.T) { - t.Parallel() -- runPlatTests(optionsFromTarget("wasi", sema), tests, t) +- runPlatTests(optionsFromTarget("wasip1", sema), tests, t) +- }) +- t.Run("WASIp2", func(t *testing.T) { +- t.Parallel() +- runPlatTests(optionsFromTarget("wasip2", sema), tests, t) - }) } } -@@ -425,7 +421,6 @@ func TestTest(t *testing.T) { +@@ -535,7 +527,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 { 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 index 40e3bac..6fe65c2 100644 --- a/0002-Skip-some-cross-Linux-tests-where-qemu-is-broken.patch +++ b/0002-Skip-some-cross-Linux-tests-where-qemu-is-broken.patch @@ -1,7 +1,7 @@ -From b7e64bf1bbcc720c2081d0f76a722b61d12e5b82 Mon Sep 17 00:00:00 2001 +From e782ed360fb028180e3c0a7f5ce1bac06b7ed035 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 3 Jan 2022 22:39:31 -0500 -Subject: [PATCH 2/8] Skip some cross Linux tests where qemu is broken +Subject: [PATCH 2/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, 19 insertions(+) diff --git a/main_test.go b/main_test.go -index ac204f0c..27344c27 100644 +index 21618761..0eae5141 100644 --- a/main_test.go +++ b/main_test.go -@@ -264,6 +264,13 @@ func runPlatTests(options compileopts.Options, tests []string, t *testing.T) { +@@ -296,6 +296,13 @@ func runPlatTests(options compileopts.Options, tests []string, t *testing.T) { } func emuCheck(t *testing.T, options compileopts.Options) { @@ -31,7 +31,7 @@ index ac204f0c..27344c27 100644 // 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 +@@ -385,6 +392,11 @@ func runTestWithConfig(name string, t *testing.T, options compileopts.Options, c t.Fatal(err) } @@ -42,8 +42,8 @@ index ac204f0c..27344c27 100644 + // 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 + _, err = buildAndRun(pkgName, config, stdout, cmdArgs, environmentVars, time.Minute, func(cmd *exec.Cmd, result builder.BuildResult) error { +@@ -400,6 +412,13 @@ func runTestWithConfig(name string, t *testing.T, options compileopts.Options, c return } diff --git a/0003-Suggest-optional-packages-to-install-if-missing.patch b/0003-Suggest-optional-packages-to-install-if-missing.patch index a17c44d..c7894f2 100644 --- a/0003-Suggest-optional-packages-to-install-if-missing.patch +++ b/0003-Suggest-optional-packages-to-install-if-missing.patch @@ -1,7 +1,7 @@ -From fe776e032278a66e3e291a91bad59a3e411c9b57 Mon Sep 17 00:00:00 2001 +From 85d91373b6a302cc1f468adab6413472f56f295a Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 6 Feb 2022 03:49:16 -0500 -Subject: [PATCH 3/8] Suggest optional packages to install if missing +Subject: [PATCH 3/6] Suggest optional packages to install if missing Signed-off-by: Elliott Sales de Andrade --- diff --git a/0004-Skip-tests-that-require-Go-module-mode.patch b/0004-Skip-tests-that-require-Go-module-mode.patch new file mode 100644 index 0000000..0777a68 --- /dev/null +++ b/0004-Skip-tests-that-require-Go-module-mode.patch @@ -0,0 +1,58 @@ +From 74d6f158651bcd5a923aaae31d93e01dbb35e4f7 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Wed, 28 Feb 2024 04:26:40 -0500 +Subject: [PATCH 4/6] 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 62d5af2c..4a51da59 100644 +--- a/errors_test.go ++++ b/errors_test.go +@@ -34,7 +34,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 0eae5141..c2d0e088 100644 +--- a/main_test.go ++++ b/main_test.go +@@ -72,7 +72,6 @@ func TestBuild(t *testing.T) { + "json.go", + "map.go", + "math.go", +- "oldgo/", + "print.go", + "reflect.go", + "slice.go", +@@ -668,6 +667,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.47.0 + diff --git a/0004-transform-fix-bug-in-StringToBytes-optimization-pass.patch b/0004-transform-fix-bug-in-StringToBytes-optimization-pass.patch deleted file mode 100644 index 7e0a470..0000000 --- a/0004-transform-fix-bug-in-StringToBytes-optimization-pass.patch +++ /dev/null @@ -1,121 +0,0 @@ -From 930064c95f1cd6c0f7088b4f7785d754fa84cc01 Mon Sep 17 00:00:00 2001 -From: Ayke van Laethem -Date: Thu, 21 Sep 2023 15:39:06 +0200 -Subject: [PATCH 4/8] transform: fix bug in StringToBytes optimization pass - -Previously, this pass would convert any read-only use of a -runtime.stringToBytes call to use the original string buffer instead. -This is incorrect: if there are any writes to the resulting buffer, none -of the slice buffer pointers can be converted to use the original -read-only string buffer. - -This commit fixes that bug and adds a test to prove the new (correct) -behavior. - -Signed-off-by: Elliott Sales de Andrade ---- - transform/rtcalls.go | 24 ++++++++++++++++++------ - transform/testdata/stringtobytes.ll | 16 ++++++++++++++++ - transform/testdata/stringtobytes.out.ll | 10 ++++++++++ - 3 files changed, 44 insertions(+), 6 deletions(-) - -diff --git a/transform/rtcalls.go b/transform/rtcalls.go -index 36d2853b..0b6feff2 100644 ---- a/transform/rtcalls.go -+++ b/transform/rtcalls.go -@@ -28,32 +28,44 @@ func OptimizeStringToBytes(mod llvm.Module) { - - // strptr is always constant because strings are always constant. - -- convertedAllUses := true -+ var pointerUses []llvm.Value -+ canConvertPointer := true - for _, use := range getUses(call) { - if use.IsAExtractValueInst().IsNil() { - // Expected an extractvalue, but this is something else. -- convertedAllUses = false -+ canConvertPointer = false - continue - } - switch use.Type().TypeKind() { - case llvm.IntegerTypeKind: - // A length (len or cap). Propagate the length value. -+ // This can always be done because the byte slice is always the -+ // same length as the original string. - use.ReplaceAllUsesWith(strlen) - use.EraseFromParentAsInstruction() - case llvm.PointerTypeKind: - // The string pointer itself. - if !isReadOnly(use) { -- convertedAllUses = false -+ // There is a store to the byte slice. This means that none -+ // of the pointer uses can't be propagated. -+ canConvertPointer = false - continue - } -- use.ReplaceAllUsesWith(strptr) -- use.EraseFromParentAsInstruction() -+ // It may be that the pointer value can be propagated, if all of -+ // the pointer uses are readonly. -+ pointerUses = append(pointerUses, use) - default: - // should not happen - panic("unknown return type of runtime.stringToBytes: " + use.Type().String()) - } - } -- if convertedAllUses { -+ if canConvertPointer { -+ // All pointer uses are readonly, so they can be converted. -+ for _, use := range pointerUses { -+ use.ReplaceAllUsesWith(strptr) -+ use.EraseFromParentAsInstruction() -+ } -+ - // Call to runtime.stringToBytes can be eliminated: both the input - // and the output is constant. - call.EraseFromParentAsInstruction() -diff --git a/transform/testdata/stringtobytes.ll b/transform/testdata/stringtobytes.ll -index fa43f3d0..06373a51 100644 ---- a/transform/testdata/stringtobytes.ll -+++ b/transform/testdata/stringtobytes.ll -@@ -30,3 +30,19 @@ entry: - call fastcc void @writeToSlice(ptr %1, i64 %2, i64 %3) - ret void - } -+ -+; Test that pointer values are never propagated if there is even a single write -+; to the pointer value (but len/cap values still can be). -+define void @testReadSome() { -+entry: -+ %s = call fastcc { ptr, i64, i64 } @runtime.stringToBytes(ptr @str, i64 6) -+ %s.ptr = extractvalue { ptr, i64, i64 } %s, 0 -+ %s.len = extractvalue { ptr, i64, i64 } %s, 1 -+ %s.cap = extractvalue { ptr, i64, i64 } %s, 2 -+ call fastcc void @writeToSlice(ptr %s.ptr, i64 %s.len, i64 %s.cap) -+ %s.ptr2 = extractvalue { ptr, i64, i64 } %s, 0 -+ %s.len2 = extractvalue { ptr, i64, i64 } %s, 1 -+ %s.cap2 = extractvalue { ptr, i64, i64 } %s, 2 -+ call fastcc void @printSlice(ptr %s.ptr2, i64 %s.len2, i64 %s.cap2) -+ ret void -+} -diff --git a/transform/testdata/stringtobytes.out.ll b/transform/testdata/stringtobytes.out.ll -index 30aa520a..b33a1755 100644 ---- a/transform/testdata/stringtobytes.out.ll -+++ b/transform/testdata/stringtobytes.out.ll -@@ -22,3 +22,13 @@ entry: - call fastcc void @writeToSlice(ptr %1, i64 6, i64 6) - ret void - } -+ -+define void @testReadSome() { -+entry: -+ %s = call fastcc { ptr, i64, i64 } @runtime.stringToBytes(ptr @str, i64 6) -+ %s.ptr = extractvalue { ptr, i64, i64 } %s, 0 -+ call fastcc void @writeToSlice(ptr %s.ptr, i64 6, i64 6) -+ %s.ptr2 = extractvalue { ptr, i64, i64 } %s, 0 -+ call fastcc void @printSlice(ptr %s.ptr2, i64 6, i64 6) -+ ret void -+} --- -2.47.0 - diff --git a/0008-Set-LLVM-search-paths-for-Fedora.patch b/0005-Set-LLVM-search-paths-for-Fedora.patch similarity index 72% rename from 0008-Set-LLVM-search-paths-for-Fedora.patch rename to 0005-Set-LLVM-search-paths-for-Fedora.patch index cdca4f6..38ac98a 100644 --- a/0008-Set-LLVM-search-paths-for-Fedora.patch +++ b/0005-Set-LLVM-search-paths-for-Fedora.patch @@ -1,19 +1,18 @@ -From 0e3fa31505241d5317eb61d78c2d3141b179e482 Mon Sep 17 00:00:00 2001 +From 15f17a3a4b59b199b5935d4da7ba6fcd4b69b765 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 27 Oct 2024 23:33:18 -0400 -Subject: [PATCH 8/8] Set LLVM search paths for Fedora +Subject: [PATCH 5/6] 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 | 15 +++++++++++++++ - 4 files changed, 21 insertions(+), 6 deletions(-) - create mode 100644 cgo/libclang_config_llvm18.go + cgo/libclang_config_llvm15.go | 4 ++-- + cgo/libclang_config_llvm16.go | 4 ++-- + cgo/libclang_config_llvm17.go | 4 ++-- + cgo/libclang_config_llvm18.go | 4 ++-- + 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cgo/libclang_config_llvm15.go b/cgo/libclang_config_llvm15.go -index e105dfe7..7e54fc9e 100644 +index edb1128d..0dc87193 100644 --- a/cgo/libclang_config_llvm15.go +++ b/cgo/libclang_config_llvm15.go @@ -3,11 +3,11 @@ @@ -27,11 +26,11 @@ index e105dfe7..7e54fc9e 100644 #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 -lffi - #cgo darwin,arm64 LDFLAGS: -L/opt/homebrew/opt/llvm@15/lib -lclang -lffi + #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 28091701..e78f02ff 100644 +index ee354e21..4c338678 100644 --- a/cgo/libclang_config_llvm16.go +++ b/cgo/libclang_config_llvm16.go @@ -9,11 +9,11 @@ package cgo @@ -45,11 +44,11 @@ index 28091701..e78f02ff 100644 #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 -lffi - #cgo darwin,arm64 LDFLAGS: -L/opt/homebrew/opt/llvm@16/lib -lclang -lffi + #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 fd6d1480..fdf72400 100644 +index 6395d8a3..609b0758 100644 --- a/cgo/libclang_config_llvm17.go +++ b/cgo/libclang_config_llvm17.go @@ -3,11 +3,11 @@ @@ -63,30 +62,27 @@ index fd6d1480..fdf72400 100644 #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 -lffi - #cgo darwin,arm64 LDFLAGS: -L/opt/homebrew/opt/llvm@17/lib -lclang -lffi + #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 -new file mode 100644 -index 00000000..18db6c08 ---- /dev/null +index 3b769c62..18db6c08 100644 +--- a/cgo/libclang_config_llvm18.go +++ b/cgo/libclang_config_llvm18.go -@@ -0,0 +1,15 @@ -+//go:build !byollvm && !llvm15 && !llvm16 && !llvm17 -+ -+package cgo -+ -+/* +@@ -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 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 -+*/ -+import "C" + #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 -- 2.47.0 diff --git a/0005-all-use-the-new-LLVM-pass-manager.patch b/0005-all-use-the-new-LLVM-pass-manager.patch deleted file mode 100644 index 5816031..0000000 --- a/0005-all-use-the-new-LLVM-pass-manager.patch +++ /dev/null @@ -1,424 +0,0 @@ -From 35221dacbc382c00d57055a3c327b8462282ddbf Mon Sep 17 00:00:00 2001 -From: Ayke van Laethem -Date: Tue, 19 Sep 2023 22:37:44 +0200 -Subject: [PATCH 5/8] all: use the new LLVM pass manager - -The old LLVM pass manager is deprecated and should not be used anymore. -Moreover, the pass manager builder (which we used to set up a pass -pipeline) is actually removed from LLVM entirely in LLVM 17: -https://reviews.llvm.org/D145387 -https://reviews.llvm.org/D145835 - -The new pass manager does change the binary size in many cases: both -growing and shrinking it. However, on average the binary size remains -more or less the same. - -This is needed as a preparation for LLVM 17. - -Signed-off-by: Elliott Sales de Andrade ---- - builder/build.go | 19 +++-- - builder/sizes_test.go | 6 +- - compileopts/config.go | 12 ++-- - compiler/compiler_test.go | 12 ++-- - interp/interp_test.go | 9 +-- - transform/allocs_test.go | 11 +-- - transform/interface-lowering_test.go | 10 +-- - transform/maps_test.go | 11 +-- - transform/optimizer.go | 102 +++++++++------------------ - transform/transform.go | 2 +- - 10 files changed, 76 insertions(+), 118 deletions(-) - -diff --git a/builder/build.go b/builder/build.go -index dc360b92..d920a598 100644 ---- a/builder/build.go -+++ b/builder/build.go -@@ -83,8 +83,7 @@ type packageAction struct { - FileHashes map[string]string // hash of every file that's part of the package - EmbeddedFiles map[string]string // hash of all the //go:embed files in the package - Imports map[string]string // map from imported package to action ID hash -- OptLevel int // LLVM optimization level (0-3) -- SizeLevel int // LLVM optimization for size level (0-2) -+ OptLevel string // LLVM optimization level (O0, O1, O2, Os, Oz) - UndefinedGlobals []string // globals that are left as external globals (no initializer) - } - -@@ -158,7 +157,7 @@ func Build(pkgName, outpath, tmpdir string, config *compileopts.Config) (BuildRe - return BuildResult{}, fmt.Errorf("unknown libc: %s", config.Target.Libc) - } - -- optLevel, sizeLevel, _ := config.OptLevels() -+ optLevel, speedLevel, sizeLevel := config.OptLevel() - compilerConfig := &compiler.Config{ - Triple: config.Triple(), - CPU: config.CPU(), -@@ -321,7 +320,6 @@ func Build(pkgName, outpath, tmpdir string, config *compileopts.Config) (BuildRe - EmbeddedFiles: make(map[string]string, len(allFiles)), - Imports: make(map[string]string, len(pkg.Pkg.Imports())), - OptLevel: optLevel, -- SizeLevel: sizeLevel, - UndefinedGlobals: undefinedGlobals, - } - for filePath, hash := range pkg.FileHashes { -@@ -743,17 +741,17 @@ func Build(pkgName, outpath, tmpdir string, config *compileopts.Config) (BuildRe - if config.GOOS() == "windows" { - // Options for the MinGW wrapper for the lld COFF linker. - ldflags = append(ldflags, -- "-Xlink=/opt:lldlto="+strconv.Itoa(optLevel), -+ "-Xlink=/opt:lldlto="+strconv.Itoa(speedLevel), - "--thinlto-cache-dir="+filepath.Join(cacheDir, "thinlto")) - } else if config.GOOS() == "darwin" { - // Options for the ld64-compatible lld linker. - ldflags = append(ldflags, -- "--lto-O"+strconv.Itoa(optLevel), -+ "--lto-O"+strconv.Itoa(speedLevel), - "-cache_path_lto", filepath.Join(cacheDir, "thinlto")) - } else { - // Options for the ELF linker. - ldflags = append(ldflags, -- "--lto-O"+strconv.Itoa(optLevel), -+ "--lto-O"+strconv.Itoa(speedLevel), - "--thinlto-cache-dir="+filepath.Join(cacheDir, "thinlto"), - ) - } -@@ -1066,10 +1064,9 @@ func optimizeProgram(mod llvm.Module, config *compileopts.Config) error { - return err - } - -- // Optimization levels here are roughly the same as Clang, but probably not -- // exactly. -- optLevel, sizeLevel, inlinerThreshold := config.OptLevels() -- errs := transform.Optimize(mod, config, optLevel, sizeLevel, inlinerThreshold) -+ // Run most of the whole-program optimizations (including the whole -+ // O0/O1/O2/Os/Oz optimization pipeline). -+ errs := transform.Optimize(mod, config) - if len(errs) > 0 { - return newMultiError(errs) - } -diff --git a/builder/sizes_test.go b/builder/sizes_test.go -index 7aaab78a..dc45898e 100644 ---- a/builder/sizes_test.go -+++ b/builder/sizes_test.go -@@ -41,9 +41,9 @@ func TestBinarySize(t *testing.T) { - // This is a small number of very diverse targets that we want to test. - tests := []sizeTest{ - // microcontrollers -- {"hifive1b", "examples/echo", 4568, 280, 0, 2252}, -- {"microbit", "examples/serial", 2728, 388, 8, 2256}, -- {"wioterminal", "examples/pininterrupt", 5996, 1484, 116, 6816}, -+ {"hifive1b", "examples/echo", 4484, 280, 0, 2252}, -+ {"microbit", "examples/serial", 2724, 388, 8, 2256}, -+ {"wioterminal", "examples/pininterrupt", 6000, 1484, 116, 6816}, - - // TODO: also check wasm. Right now this is difficult, because - // wasm binaries are run through wasm-opt and therefore the -diff --git a/compileopts/config.go b/compileopts/config.go -index 39fc4f2a..5ad45c60 100644 ---- a/compileopts/config.go -+++ b/compileopts/config.go -@@ -145,18 +145,18 @@ func (c *Config) Serial() string { - - // OptLevels returns the optimization level (0-2), size level (0-2), and inliner - // threshold as used in the LLVM optimization pipeline. --func (c *Config) OptLevels() (optLevel, sizeLevel int, inlinerThreshold uint) { -+func (c *Config) OptLevel() (level string, speedLevel, sizeLevel int) { - switch c.Options.Opt { - case "none", "0": -- return 0, 0, 0 // -O0 -+ return "O0", 0, 0 - case "1": -- return 1, 0, 0 // -O1 -+ return "O1", 1, 0 - case "2": -- return 2, 0, 225 // -O2 -+ return "O2", 2, 0 - case "s": -- return 2, 1, 225 // -Os -+ return "Os", 2, 1 - case "z": -- return 2, 2, 5 // -Oz, default -+ return "Oz", 2, 2 // default - default: - // This is not shown to the user: valid choices are already checked as - // part of Options.Verify(). It is here as a sanity check. -diff --git a/compiler/compiler_test.go b/compiler/compiler_test.go -index 92ce31b0..147e622a 100644 ---- a/compiler/compiler_test.go -+++ b/compiler/compiler_test.go -@@ -91,14 +91,12 @@ func TestCompiler(t *testing.T) { - } - - // Optimize IR a little. -- funcPasses := llvm.NewFunctionPassManagerForModule(mod) -- defer funcPasses.Dispose() -- funcPasses.AddInstructionCombiningPass() -- funcPasses.InitializeFunc() -- for fn := mod.FirstFunction(); !fn.IsNil(); fn = llvm.NextFunction(fn) { -- funcPasses.RunFunc(fn) -+ passOptions := llvm.NewPassBuilderOptions() -+ defer passOptions.Dispose() -+ err = mod.RunPasses("instcombine", llvm.TargetMachine{}, passOptions) -+ if err != nil { -+ t.Error(err) - } -- funcPasses.FinalizeFunc() - - outFilePrefix := tc.file[:len(tc.file)-3] - if tc.target != "" { -diff --git a/interp/interp_test.go b/interp/interp_test.go -index fc567af2..cac56508 100644 ---- a/interp/interp_test.go -+++ b/interp/interp_test.go -@@ -77,12 +77,9 @@ func runTest(t *testing.T, pathPrefix string) { - } - - // Run some cleanup passes to get easy-to-read outputs. -- pm := llvm.NewPassManager() -- defer pm.Dispose() -- pm.AddGlobalOptimizerPass() -- pm.AddDeadStoreEliminationPass() -- pm.AddAggressiveDCEPass() -- pm.Run(mod) -+ to := llvm.NewPassBuilderOptions() -+ defer to.Dispose() -+ mod.RunPasses("globalopt,dse,adce", llvm.TargetMachine{}, to) - - // Read the expected output IR. - out, err := os.ReadFile(pathPrefix + ".out.ll") -diff --git a/transform/allocs_test.go b/transform/allocs_test.go -index 27bb9706..59a5b14e 100644 ---- a/transform/allocs_test.go -+++ b/transform/allocs_test.go -@@ -38,11 +38,12 @@ func TestAllocs2(t *testing.T) { - mod := compileGoFileForTesting(t, "./testdata/allocs2.go") - - // Run functionattrs pass, which is necessary for escape analysis. -- pm := llvm.NewPassManager() -- defer pm.Dispose() -- pm.AddInstructionCombiningPass() -- pm.AddFunctionAttrsPass() -- pm.Run(mod) -+ po := llvm.NewPassBuilderOptions() -+ defer po.Dispose() -+ err := mod.RunPasses("function(instcombine),function-attrs", llvm.TargetMachine{}, po) -+ if err != nil { -+ t.Error("failed to run passes:", err) -+ } - - // Run heap to stack transform. - var testOutputs []allocsTestOutput -diff --git a/transform/interface-lowering_test.go b/transform/interface-lowering_test.go -index 7bcce605..65f14dd9 100644 ---- a/transform/interface-lowering_test.go -+++ b/transform/interface-lowering_test.go -@@ -15,9 +15,11 @@ func TestInterfaceLowering(t *testing.T) { - t.Error(err) - } - -- pm := llvm.NewPassManager() -- defer pm.Dispose() -- pm.AddGlobalDCEPass() -- pm.Run(mod) -+ po := llvm.NewPassBuilderOptions() -+ defer po.Dispose() -+ err = mod.RunPasses("globaldce", llvm.TargetMachine{}, po) -+ if err != nil { -+ t.Error("failed to run passes:", err) -+ } - }) - } -diff --git a/transform/maps_test.go b/transform/maps_test.go -index e8b11133..329de698 100644 ---- a/transform/maps_test.go -+++ b/transform/maps_test.go -@@ -15,10 +15,11 @@ func TestOptimizeMaps(t *testing.T) { - - // Run an optimization pass, to clean up the result. - // This shows that all code related to the map is really eliminated. -- pm := llvm.NewPassManager() -- defer pm.Dispose() -- pm.AddDeadStoreEliminationPass() -- pm.AddAggressiveDCEPass() -- pm.Run(mod) -+ po := llvm.NewPassBuilderOptions() -+ defer po.Dispose() -+ err := mod.RunPasses("dse,adce", llvm.TargetMachine{}, po) -+ if err != nil { -+ t.Error("failed to run passes:", err) -+ } - }) - } -diff --git a/transform/optimizer.go b/transform/optimizer.go -index 20258ef4..42acc2dd 100644 ---- a/transform/optimizer.go -+++ b/transform/optimizer.go -@@ -14,54 +14,22 @@ import ( - // OptimizePackage runs optimization passes over the LLVM module for the given - // Go package. - func OptimizePackage(mod llvm.Module, config *compileopts.Config) { -- optLevel, sizeLevel, _ := config.OptLevels() -- -- // Run function passes for each function in the module. -- // These passes are intended to be run on each function right -- // after they're created to reduce IR size (and maybe also for -- // cache locality to improve performance), but for now they're -- // run here for each function in turn. Maybe this can be -- // improved in the future. -- builder := llvm.NewPassManagerBuilder() -- defer builder.Dispose() -- builder.SetOptLevel(optLevel) -- builder.SetSizeLevel(sizeLevel) -- funcPasses := llvm.NewFunctionPassManagerForModule(mod) -- defer funcPasses.Dispose() -- builder.PopulateFunc(funcPasses) -- funcPasses.InitializeFunc() -- for fn := mod.FirstFunction(); !fn.IsNil(); fn = llvm.NextFunction(fn) { -- if fn.IsDeclaration() { -- continue -- } -- funcPasses.RunFunc(fn) -- } -- funcPasses.FinalizeFunc() -+ _, speedLevel, _ := config.OptLevel() - - // Run TinyGo-specific optimization passes. -- if optLevel > 0 { -+ if speedLevel > 0 { - OptimizeMaps(mod) - } - } - - // Optimize runs a number of optimization and transformation passes over the - // given module. Some passes are specific to TinyGo, others are generic LLVM --// passes. You can set a preferred performance (0-3) and size (0-2) level and --// control the limits of the inliner (higher numbers mean more inlining, set it --// to 0 to disable entirely). -+// passes. - // - // Please note that some optimizations are not optional, thus Optimize must --// alwasy be run before emitting machine code. Set all controls (optLevel, --// sizeLevel, inlinerThreshold) to 0 to reduce the number of optimizations to a --// minimum. --func Optimize(mod llvm.Module, config *compileopts.Config, optLevel, sizeLevel int, inlinerThreshold uint) []error { -- builder := llvm.NewPassManagerBuilder() -- defer builder.Dispose() -- builder.SetOptLevel(optLevel) -- builder.SetSizeLevel(sizeLevel) -- if inlinerThreshold != 0 { -- builder.UseInlinerWithThreshold(inlinerThreshold) -- } -+// alwasy be run before emitting machine code. -+func Optimize(mod llvm.Module, config *compileopts.Config) []error { -+ optLevel, speedLevel, _ := config.OptLevel() - - // Make sure these functions are kept in tact during TinyGo transformation passes. - for _, name := range functionsUsedInTransforms { -@@ -84,23 +52,20 @@ func Optimize(mod llvm.Module, config *compileopts.Config, optLevel, sizeLevel i - } - } - -- if optLevel > 0 { -+ if speedLevel > 0 { - // Run some preparatory passes for the Go optimizer. -- goPasses := llvm.NewPassManager() -- defer goPasses.Dispose() -- goPasses.AddGlobalDCEPass() -- goPasses.AddGlobalOptimizerPass() -- goPasses.AddIPSCCPPass() -- goPasses.AddInstructionCombiningPass() // necessary for OptimizeReflectImplements -- goPasses.AddAggressiveDCEPass() -- goPasses.AddFunctionAttrsPass() -- goPasses.Run(mod) -+ po := llvm.NewPassBuilderOptions() -+ defer po.Dispose() -+ err := mod.RunPasses("globaldce,globalopt,ipsccp,instcombine,adce,function-attrs", llvm.TargetMachine{}, po) -+ if err != nil { -+ return []error{fmt.Errorf("could not build pass pipeline: %w", err)} -+ } - - // Run TinyGo-specific optimization passes. - OptimizeStringToBytes(mod) - OptimizeReflectImplements(mod) - OptimizeAllocs(mod, nil, nil) -- err := LowerInterfaces(mod, config) -+ err = LowerInterfaces(mod, config) - if err != nil { - return []error{err} - } -@@ -113,7 +78,10 @@ func Optimize(mod llvm.Module, config *compileopts.Config, optLevel, sizeLevel i - // After interfaces are lowered, there are many more opportunities for - // interprocedural optimizations. To get them to work, function - // attributes have to be updated first. -- goPasses.Run(mod) -+ err = mod.RunPasses("globaldce,globalopt,ipsccp,instcombine,adce,function-attrs", llvm.TargetMachine{}, po) -+ if err != nil { -+ return []error{fmt.Errorf("could not build pass pipeline: %w", err)} -+ } - - // Run TinyGo-specific interprocedural optimizations. - OptimizeAllocs(mod, config.Options.PrintAllocs, func(pos token.Position, msg string) { -@@ -134,10 +102,12 @@ func Optimize(mod llvm.Module, config *compileopts.Config, optLevel, sizeLevel i - } - - // Clean up some leftover symbols of the previous transformations. -- goPasses := llvm.NewPassManager() -- defer goPasses.Dispose() -- goPasses.AddGlobalDCEPass() -- goPasses.Run(mod) -+ po := llvm.NewPassBuilderOptions() -+ defer po.Dispose() -+ err = mod.RunPasses("globaldce", llvm.TargetMachine{}, po) -+ if err != nil { -+ return []error{fmt.Errorf("could not build pass pipeline: %w", err)} -+ } - } - - if config.Scheduler() == "none" { -@@ -169,23 +139,15 @@ func Optimize(mod llvm.Module, config *compileopts.Config, optLevel, sizeLevel i - fn.SetLinkage(llvm.InternalLinkage) - } - -- // Run function passes again, because without it, llvm.coro.size.i32() -- // doesn't get lowered. -- funcPasses := llvm.NewFunctionPassManagerForModule(mod) -- defer funcPasses.Dispose() -- builder.PopulateFunc(funcPasses) -- funcPasses.InitializeFunc() -- for fn := mod.FirstFunction(); !fn.IsNil(); fn = llvm.NextFunction(fn) { -- funcPasses.RunFunc(fn) -+ // Run the default pass pipeline. -+ // TODO: set the PrepareForThinLTO flag somehow. -+ po := llvm.NewPassBuilderOptions() -+ defer po.Dispose() -+ passes := fmt.Sprintf("default<%s>", optLevel) -+ err := mod.RunPasses(passes, llvm.TargetMachine{}, po) -+ if err != nil { -+ return []error{fmt.Errorf("could not build pass pipeline: %w", err)} - } -- funcPasses.FinalizeFunc() -- -- // Run module passes. -- // TODO: somehow set the PrepareForThinLTO flag in the pass manager builder. -- modPasses := llvm.NewPassManager() -- defer modPasses.Dispose() -- builder.Populate(modPasses) -- modPasses.Run(mod) - - hasGCPass := MakeGCStackSlots(mod) - if hasGCPass { -diff --git a/transform/transform.go b/transform/transform.go -index ab08317e..429cbd5f 100644 ---- a/transform/transform.go -+++ b/transform/transform.go -@@ -22,7 +22,7 @@ import ( - // the -opt= compiler flag. - func AddStandardAttributes(fn llvm.Value, config *compileopts.Config) { - ctx := fn.Type().Context() -- _, sizeLevel, _ := config.OptLevels() -+ _, _, sizeLevel := config.OptLevel() - if sizeLevel >= 1 { - fn.AddFunctionAttr(ctx.CreateEnumAttribute(llvm.AttributeKindID("optsize"), 0)) - } --- -2.47.0 - diff --git a/0006-avr-don-t-compile-large-parts-of-picolibc-math-stdio.patch b/0006-avr-don-t-compile-large-parts-of-picolibc-math-stdio.patch deleted file mode 100644 index 9ec250f..0000000 --- a/0006-avr-don-t-compile-large-parts-of-picolibc-math-stdio.patch +++ /dev/null @@ -1,222 +0,0 @@ -From 2ad6ed3429443910fcb5baacb6a05a1bfe9351ae Mon Sep 17 00:00:00 2001 -From: Ayke van Laethem -Date: Sat, 23 Sep 2023 14:57:25 +0200 -Subject: [PATCH 6/8] avr: don't compile large parts of picolibc (math, stdio) - -These parts aren't critical and lead to crashes on small chips without -long jumps (like the attiny85) with LLVM 17. (Older LLVM versions would -emit long jumps regardless, even if the chip didn't support those). - -For more information, see: https://github.com/llvm/llvm-project/issues/67042 - -Signed-off-by: Elliott Sales de Andrade ---- - builder/picolibc.go | 172 ++++++++++++++++++++++++-------------------- - 1 file changed, 93 insertions(+), 79 deletions(-) - -diff --git a/builder/picolibc.go b/builder/picolibc.go -index 1b7c748b..91ad27be 100644 ---- a/builder/picolibc.go -+++ b/builder/picolibc.go -@@ -3,6 +3,7 @@ package builder - import ( - "os" - "path/filepath" -+ "strings" - - "github.com/tinygo-org/tinygo/goenv" - ) -@@ -41,91 +42,23 @@ var Picolibc = Library{ - }, - sourceDir: func() string { return filepath.Join(goenv.Get("TINYGOROOT"), "lib/picolibc/newlib") }, - librarySources: func(target string) ([]string, error) { -- return picolibcSources, nil -+ sources := append([]string(nil), picolibcSources...) -+ if !strings.HasPrefix(target, "avr") { -+ // Small chips without long jumps can't compile many files (printf, -+ // pow, etc). Therefore exclude those source files for those chips. -+ // Unfortunately it's difficult to exclude only some chips, so this -+ // excludes those files on all AVR chips for now. -+ // More information: -+ // https://github.com/llvm/llvm-project/issues/67042 -+ sources = append(sources, picolibcSourcesLarge...) -+ } -+ return sources, nil - }, - } - - var picolibcSources = []string{ - "../../picolibc-stdio.c", - -- // srcs_tinystdio -- "libc/tinystdio/asprintf.c", -- "libc/tinystdio/bufio.c", -- "libc/tinystdio/clearerr.c", -- "libc/tinystdio/ecvt_r.c", -- "libc/tinystdio/ecvt.c", -- "libc/tinystdio/ecvtf_r.c", -- "libc/tinystdio/ecvtf.c", -- "libc/tinystdio/fcvt.c", -- "libc/tinystdio/fcvt_r.c", -- "libc/tinystdio/fcvtf.c", -- "libc/tinystdio/fcvtf_r.c", -- "libc/tinystdio/gcvt.c", -- "libc/tinystdio/gcvtf.c", -- "libc/tinystdio/fclose.c", -- "libc/tinystdio/fdevopen.c", -- "libc/tinystdio/feof.c", -- "libc/tinystdio/ferror.c", -- "libc/tinystdio/fflush.c", -- "libc/tinystdio/fgetc.c", -- "libc/tinystdio/fgets.c", -- "libc/tinystdio/fileno.c", -- "libc/tinystdio/filestrget.c", -- "libc/tinystdio/filestrput.c", -- "libc/tinystdio/filestrputalloc.c", -- "libc/tinystdio/fmemopen.c", -- "libc/tinystdio/fprintf.c", -- "libc/tinystdio/fputc.c", -- "libc/tinystdio/fputs.c", -- "libc/tinystdio/fread.c", -- //"libc/tinystdio/freopen.c", // crashes with AVR, see: https://github.com/picolibc/picolibc/pull/369 -- "libc/tinystdio/fscanf.c", -- "libc/tinystdio/fseek.c", -- "libc/tinystdio/fseeko.c", -- "libc/tinystdio/ftell.c", -- "libc/tinystdio/ftello.c", -- "libc/tinystdio/fwrite.c", -- "libc/tinystdio/getchar.c", -- "libc/tinystdio/gets.c", -- "libc/tinystdio/matchcaseprefix.c", -- "libc/tinystdio/mktemp.c", -- "libc/tinystdio/perror.c", -- "libc/tinystdio/printf.c", -- "libc/tinystdio/putchar.c", -- "libc/tinystdio/puts.c", -- "libc/tinystdio/rewind.c", -- "libc/tinystdio/scanf.c", -- "libc/tinystdio/setbuf.c", -- "libc/tinystdio/setbuffer.c", -- "libc/tinystdio/setlinebuf.c", -- "libc/tinystdio/setvbuf.c", -- "libc/tinystdio/snprintf.c", -- "libc/tinystdio/sprintf.c", -- "libc/tinystdio/snprintfd.c", -- "libc/tinystdio/snprintff.c", -- "libc/tinystdio/sprintff.c", -- "libc/tinystdio/sprintfd.c", -- "libc/tinystdio/sscanf.c", -- "libc/tinystdio/strfromf.c", -- "libc/tinystdio/strfromd.c", -- "libc/tinystdio/strtof.c", -- "libc/tinystdio/strtof_l.c", -- "libc/tinystdio/strtod.c", -- "libc/tinystdio/strtod_l.c", -- "libc/tinystdio/ungetc.c", -- "libc/tinystdio/vasprintf.c", -- "libc/tinystdio/vfiprintf.c", -- "libc/tinystdio/vfprintf.c", -- "libc/tinystdio/vfprintff.c", -- "libc/tinystdio/vfscanf.c", -- "libc/tinystdio/vfiscanf.c", -- "libc/tinystdio/vfscanff.c", -- "libc/tinystdio/vprintf.c", -- "libc/tinystdio/vscanf.c", -- "libc/tinystdio/vsscanf.c", -- "libc/tinystdio/vsnprintf.c", -- "libc/tinystdio/vsprintf.c", -- - "libc/string/bcmp.c", - "libc/string/bcopy.c", - "libc/string/bzero.c", -@@ -229,6 +162,87 @@ var picolibcSources = []string{ - "libc/string/wmempcpy.c", - "libc/string/wmemset.c", - "libc/string/xpg_strerror_r.c", -+} -+ -+// Parts of picolibc that are too large for small AVRs. -+var picolibcSourcesLarge = []string{ -+ // srcs_tinystdio -+ "libc/tinystdio/asprintf.c", -+ "libc/tinystdio/bufio.c", -+ "libc/tinystdio/clearerr.c", -+ "libc/tinystdio/ecvt_r.c", -+ "libc/tinystdio/ecvt.c", -+ "libc/tinystdio/ecvtf_r.c", -+ "libc/tinystdio/ecvtf.c", -+ "libc/tinystdio/fcvt.c", -+ "libc/tinystdio/fcvt_r.c", -+ "libc/tinystdio/fcvtf.c", -+ "libc/tinystdio/fcvtf_r.c", -+ "libc/tinystdio/gcvt.c", -+ "libc/tinystdio/gcvtf.c", -+ "libc/tinystdio/fclose.c", -+ "libc/tinystdio/fdevopen.c", -+ "libc/tinystdio/feof.c", -+ "libc/tinystdio/ferror.c", -+ "libc/tinystdio/fflush.c", -+ "libc/tinystdio/fgetc.c", -+ "libc/tinystdio/fgets.c", -+ "libc/tinystdio/fileno.c", -+ "libc/tinystdio/filestrget.c", -+ "libc/tinystdio/filestrput.c", -+ "libc/tinystdio/filestrputalloc.c", -+ "libc/tinystdio/fmemopen.c", -+ "libc/tinystdio/fprintf.c", -+ "libc/tinystdio/fputc.c", -+ "libc/tinystdio/fputs.c", -+ "libc/tinystdio/fread.c", -+ //"libc/tinystdio/freopen.c", // crashes with AVR, see: https://github.com/picolibc/picolibc/pull/369 -+ "libc/tinystdio/fscanf.c", -+ "libc/tinystdio/fseek.c", -+ "libc/tinystdio/fseeko.c", -+ "libc/tinystdio/ftell.c", -+ "libc/tinystdio/ftello.c", -+ "libc/tinystdio/fwrite.c", -+ "libc/tinystdio/getchar.c", -+ "libc/tinystdio/gets.c", -+ "libc/tinystdio/matchcaseprefix.c", -+ "libc/tinystdio/mktemp.c", -+ "libc/tinystdio/perror.c", -+ "libc/tinystdio/printf.c", -+ "libc/tinystdio/putchar.c", -+ "libc/tinystdio/puts.c", -+ "libc/tinystdio/rewind.c", -+ "libc/tinystdio/scanf.c", -+ "libc/tinystdio/setbuf.c", -+ "libc/tinystdio/setbuffer.c", -+ "libc/tinystdio/setlinebuf.c", -+ "libc/tinystdio/setvbuf.c", -+ "libc/tinystdio/snprintf.c", -+ "libc/tinystdio/sprintf.c", -+ "libc/tinystdio/snprintfd.c", -+ "libc/tinystdio/snprintff.c", -+ "libc/tinystdio/sprintff.c", -+ "libc/tinystdio/sprintfd.c", -+ "libc/tinystdio/sscanf.c", -+ "libc/tinystdio/strfromf.c", -+ "libc/tinystdio/strfromd.c", -+ "libc/tinystdio/strtof.c", -+ "libc/tinystdio/strtof_l.c", -+ "libc/tinystdio/strtod.c", -+ "libc/tinystdio/strtod_l.c", -+ "libc/tinystdio/ungetc.c", -+ "libc/tinystdio/vasprintf.c", -+ "libc/tinystdio/vfiprintf.c", -+ "libc/tinystdio/vfprintf.c", -+ "libc/tinystdio/vfprintff.c", -+ "libc/tinystdio/vfscanf.c", -+ "libc/tinystdio/vfiscanf.c", -+ "libc/tinystdio/vfscanff.c", -+ "libc/tinystdio/vprintf.c", -+ "libc/tinystdio/vscanf.c", -+ "libc/tinystdio/vsscanf.c", -+ "libc/tinystdio/vsnprintf.c", -+ "libc/tinystdio/vsprintf.c", - - "libm/common/sf_finite.c", - "libm/common/sf_copysign.c", --- -2.47.0 - diff --git a/0006-builder-Fix-parsing-of-external-ld.lld-error-message.patch b/0006-builder-Fix-parsing-of-external-ld.lld-error-message.patch new file mode 100644 index 0000000..ed55301 --- /dev/null +++ b/0006-builder-Fix-parsing-of-external-ld.lld-error-message.patch @@ -0,0 +1,45 @@ +From bc0fcf1b16b50738615df96f1f2f7e6e0267da9e Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Sun, 5 Jan 2025 02:20:33 -0500 +Subject: [PATCH 6/6] builder: Fix parsing of external ld.lld error messages + +If `ld.lld` is a version-specific binary (e.g., `ld.lld-18`), then its +error messages include the version. The parsing previously incorrectly +assumed it would be unversioned. + +Signed-off-by: Elliott Sales de Andrade +--- + builder/tools.go | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/builder/tools.go b/builder/tools.go +index bd18aa09..65d5c63b 100644 +--- a/builder/tools.go ++++ b/builder/tools.go +@@ -85,8 +85,8 @@ func parseLLDErrors(text string) error { + + // Check for undefined symbols. + // This can happen in some cases like with CGo and //go:linkname tricker. +- if matches := regexp.MustCompile(`^ld.lld: error: undefined symbol: (.*)\n`).FindStringSubmatch(message); matches != nil { +- symbolName := matches[1] ++ if matches := regexp.MustCompile(`^ld.lld(-[0-9]+)?: error: undefined symbol: (.*)\n`).FindStringSubmatch(message); matches != nil { ++ symbolName := matches[2] + for _, line := range strings.Split(message, "\n") { + matches := regexp.MustCompile(`referenced by .* \(((.*):([0-9]+))\)`).FindStringSubmatch(line) + if matches != nil { +@@ -105,9 +105,9 @@ func parseLLDErrors(text string) error { + } + + // Check for flash/RAM overflow. +- if matches := regexp.MustCompile(`^ld.lld: error: section '(.*?)' will not fit in region '(.*?)': overflowed by ([0-9]+) bytes$`).FindStringSubmatch(message); matches != nil { +- region := matches[2] +- n, err := strconv.ParseUint(matches[3], 10, 64) ++ if matches := regexp.MustCompile(`^ld.lld(-[0-9]+)?: error: section '(.*?)' will not fit in region '(.*?)': overflowed by ([0-9]+) bytes$`).FindStringSubmatch(message); matches != nil { ++ region := matches[3] ++ n, err := strconv.ParseUint(matches[4], 10, 64) + if err != nil { + // Should not happen at all (unless it overflows an uint64 for some reason). + continue +-- +2.47.0 + diff --git a/0007-all-add-initial-LLVM-17-support.patch b/0007-all-add-initial-LLVM-17-support.patch deleted file mode 100644 index 37591ba..0000000 --- a/0007-all-add-initial-LLVM-17-support.patch +++ /dev/null @@ -1,157 +0,0 @@ -From d4bda089b8e33050cf05e0d9fce0a73b0b13e014 Mon Sep 17 00:00:00 2001 -From: Ayke van Laethem -Date: Sat, 23 Sep 2023 15:03:24 +0200 -Subject: [PATCH 7/8] all: add initial LLVM 17 support - -This allows us to test LLVM 17 already, before it's available in -Homebrew etc. - -Full support for LLVM 17 will have to wait until Espressif rebases their -Xtensa fork of LLVM. - -Signed-off-by: Elliott Sales de Andrade ---- - .circleci/config.yml | 13 +++++++++++-- - .github/workflows/build-macos.yml | 16 +++++++++++++--- - cgo/libclang_config_llvm16.go | 2 +- - cgo/libclang_config_llvm17.go | 15 +++++++++++++++ - go.mod | 2 +- - go.sum | 4 ++-- - 6 files changed, 43 insertions(+), 9 deletions(-) - create mode 100644 cgo/libclang_config_llvm17.go - -diff --git a/.circleci/config.yml b/.circleci/config.yml -index 1dff3ba7..86da321d 100644 ---- a/.circleci/config.yml -+++ b/.circleci/config.yml -@@ -55,7 +55,7 @@ commands: - - run: - name: "Install apt dependencies" - command: | -- echo 'deb https://apt.llvm.org/buster/ llvm-toolchain-buster-<> main' > /etc/apt/sources.list.d/llvm.list -+ echo 'deb https://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-<> main' > /etc/apt/sources.list.d/llvm.list - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - - apt-get update - apt-get install --no-install-recommends -y \ -@@ -100,11 +100,18 @@ commands: - jobs: - test-llvm14-go118: - docker: -- - image: golang:1.18-buster -+ - image: golang:1.18-bullseye - steps: - - test-linux: - llvm: "14" - resource_class: large -+ test-llvm17-go121: -+ docker: -+ - image: golang:1.21-bullseye -+ steps: -+ - test-linux: -+ llvm: "17" -+ resource_class: large - - workflows: - test-all: -@@ -112,3 +119,5 @@ workflows: - # This tests our lowest supported versions of Go and LLVM, to make sure at - # least the smoke tests still pass. - - test-llvm14-go118 -+ # This tests the upcoming LLVM 17 support. -+ - test-llvm17-go121 -diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml -index 1284a4ed..be8bdb03 100644 ---- a/.github/workflows/build-macos.yml -+++ b/.github/workflows/build-macos.yml -@@ -116,11 +116,15 @@ jobs: - test-macos-homebrew: - name: homebrew-install - runs-on: macos-latest -+ strategy: -+ matrix: -+ version: [16, 17] - steps: -+ - name: Update Homebrew -+ run: brew update - - name: Install LLVM -- shell: bash - run: | -- HOMEBREW_NO_AUTO_UPDATE=1 brew install llvm@16 -+ HOMEBREW_NO_AUTO_UPDATE=1 brew install llvm@${{ matrix.version }} - - name: Checkout - uses: actions/checkout@v3 - - name: Install Go -@@ -128,7 +132,13 @@ jobs: - with: - go-version: '1.21' - cache: true -- - name: Build TinyGo -+ - name: Build TinyGo (LLVM ${{ matrix.version }}) -+ run: go install -tags=llvm${{ matrix.version }} -+ - name: Check binary -+ run: tinygo version -+ - name: Build TinyGo (default LLVM) -+ if: matrix.version == 16 - run: go install - - name: Check binary -+ if: matrix.version == 16 - run: tinygo version -diff --git a/cgo/libclang_config_llvm16.go b/cgo/libclang_config_llvm16.go -index 79aacd2f..28091701 100644 ---- a/cgo/libclang_config_llvm16.go -+++ b/cgo/libclang_config_llvm16.go -@@ -1,4 +1,4 @@ --//go:build !byollvm && !llvm14 && !llvm15 -+//go:build !byollvm && !llvm14 && !llvm15 && !llvm17 - - package cgo - -diff --git a/cgo/libclang_config_llvm17.go b/cgo/libclang_config_llvm17.go -new file mode 100644 -index 00000000..fd6d1480 ---- /dev/null -+++ b/cgo/libclang_config_llvm17.go -@@ -0,0 +1,15 @@ -+//go:build !byollvm && llvm17 -+ -+package cgo -+ -+/* -+#cgo linux CFLAGS: -I/usr/include/llvm-17 -I/usr/include/llvm-c-17 -I/usr/lib/llvm-17/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 darwin,amd64 LDFLAGS: -L/usr/local/opt/llvm@17/lib -lclang -lffi -+#cgo darwin,arm64 LDFLAGS: -L/opt/homebrew/opt/llvm@17/lib -lclang -lffi -+#cgo freebsd LDFLAGS: -L/usr/local/llvm17/lib -lclang -+*/ -+import "C" -diff --git a/go.mod b/go.mod -index 9af3402b..36d601f8 100644 ---- a/go.mod -+++ b/go.mod -@@ -18,7 +18,7 @@ require ( - golang.org/x/sys v0.11.0 - golang.org/x/tools v0.12.0 - gopkg.in/yaml.v2 v2.4.0 -- tinygo.org/x/go-llvm v0.0.0-20230918183930-9edb6403d0bc -+ tinygo.org/x/go-llvm v0.0.0-20230923132128-bba3c7009bfd - ) - - require ( -diff --git a/go.sum b/go.sum -index 587efdf2..1b5ad074 100644 ---- a/go.sum -+++ b/go.sum -@@ -65,5 +65,5 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8 - gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= - gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= - gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= --tinygo.org/x/go-llvm v0.0.0-20230918183930-9edb6403d0bc h1:IVX1dqCX3c88P7iEMBtz1xCAM4UIqCMgbqHdSefBaWE= --tinygo.org/x/go-llvm v0.0.0-20230918183930-9edb6403d0bc/go.mod h1:GFbusT2VTA4I+l4j80b17KFK+6whv69Wtny5U+T8RR0= -+tinygo.org/x/go-llvm v0.0.0-20230923132128-bba3c7009bfd h1:iSVvs8r3ooxYTsmcf7FKCHq83eOSUkWKtmQhnDadDQU= -+tinygo.org/x/go-llvm v0.0.0-20230923132128-bba3c7009bfd/go.mod h1:GFbusT2VTA4I+l4j80b17KFK+6whv69Wtny5U+T8RR0= --- -2.47.0 - diff --git a/clean_tarballs.sh b/clean_tarballs.sh index 3e8e11d..6f47204 100755 --- a/clean_tarballs.sh +++ b/clean_tarballs.sh @@ -1,7 +1,7 @@ #!/bin/bash -e CMSIS_VERSION=9fe411cef1cef5de58e5957b89760759de44e393 -CMSIS_SVD_VERSION=df75ff974c76a911fc2815e29807f5ecaae06fc2 +CMSIS_SVD_DATA_VERSION=40327a4d2dff0992682be2872aaa6e096f35d2f4 if [ -e "cmsis-${CMSIS_VERSION}-clean.tar.xz" ]; then echo "Not downloading cmsis-${CMSIS_VERSION}-clean.tar.xz again!" @@ -16,8 +16,8 @@ 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, @@ -27,32 +27,37 @@ else # - Espressif-Community: Apache-2.0 OR MIT # - Kendryte-Community: ISC # - NXP/L*: Proprietary, so not included. +# - NXP/Q*: Unknown, so not included. # - NXP/M*: BSD-3-Clause # - RaspberryPi: BSD-3-Clause # - SiFive-Community: ISC # - STMicro: Proprietary, so not 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 # - Nordic: BSD-3-Clause # - Nuvoton: Unknown -# - SiliconLabs: Unknown +# - Renesas: Proprietary +# - SiliconLabs: Zlib # - Spansion: Proprietary # - TexasInstruments: Proprietary # - Toshiba: Unknown -#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/NXP/M* \ - cmsis-svd-${CMSIS_SVD_VERSION}/data/RaspberryPi/ \ - cmsis-svd-${CMSIS_SVD_VERSION}/data/SiFive-Community/ -rm -r cmsis-svd-${CMSIS_SVD_VERSION}/ +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 +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/NXP/M* \ + cmsis-svd-data-${CMSIS_SVD_DATA_VERSION}/data/RaspberryPi/ \ + cmsis-svd-data-${CMSIS_SVD_DATA_VERSION}/data/SiFive-Community/ +rm -r cmsis-svd-data-${CMSIS_SVD_DATA_VERSION}/ fi diff --git a/sources b/sources index 92a1b43..43b242a 100644 --- a/sources +++ b/sources @@ -1,13 +1,14 @@ -SHA512 (tinygo-0.30.0.tar.gz) = 91c4b6a578d5730e6915d48c69f567b814d5d1201150df053f116b78be5c29553f2fa8bf05f4565ffb7d1acabc58819a1f0ef2beea9830c4cb99d69116ac4fee +SHA512 (tinygo-0.33.0.tar.gz) = 3f899d7486d71847bb1fc904e8ad8ecb3b3153475bae954df8e486fbc711622e36d9a2fb3b45fe52a9ed62c618cc5a2dd7bf73d2d25d86670636689712f8a5a9 SHA512 (avr-6624554c02b237b23dc17d53e992bf54033fc228.tar.gz) = 1aa157bd761db38f8680614fa1cf47d7009508f65291b7eaaa5aba1ae76d35103f68a42947b7269a170d2f1cf8fb09941a5d74070fe6d204b68dd15a9ad2ed29 SHA512 (cmsis-9fe411cef1cef5de58e5957b89760759de44e393-clean.tar.xz) = f131fc241f61982c49f334eb502c2f13da61eb7bdaa641ee84a8de30c4d576b735b8aadeafd7d75351473a2df6a42de6a236ecc5dcc616ee6cfcc07af29446f9 -SHA512 (cmsis_svd-df75ff974c76a911fc2815e29807f5ecaae06fc2-clean.tar.xz) = 8abbc6f366aed9571a74a4b6e7065ed2d6a59e0495c3745681d9a654d61edd136319788741f7afc781211adb64ed1faeafe9d6acc6be5a16d9ee48e98c5ddeb1 -SHA512 (compiler-rt-17.0.1.src.tar.xz) = a440cca467e51cd7e3484adb8ea189ca1af61f9da928b17fed7ee48ebf3e997a55b4b5e0a8309c02a59b59be6ea8458745e9e898c403cfff83b93ff57fbf922d -SHA512 (compiler-rt-17.0.1.src.tar.xz.sig) = 5f8922e2e660e7b91c9a089caba51e8132c59f8502d39a70889b6508811dbbeece734a06b97ea366e87c023b957d09d6a62a06f7d848539bc894f6841084d61c -SHA512 (macos-minimal-sdk-ebb736fda2bec7cea38dcda807518b835a539525.tar.gz) = 2f97d5826c79116c851e1efde74faf806de56ac8acc5509d1ab7690d0edf88f6e227b273d2c5ef7d894a8ada2e316e285ef4e58d74ca0c6f91584653154eae10 +SHA512 (cmsis_svd_data-40327a4d2dff0992682be2872aaa6e096f35d2f4-clean.tar.xz) = 851179df0f9fb86b6c8c340659568bd367ffd9ac801f0bbf1a0a10713599c6e78fb5d0cb27ac31c6ea5d8c4f71c52f925bdeef0d49a8a93c63b62ef555423718 +SHA512 (compiler-rt-18.1.8.src.tar.xz) = fb8795bd51c9b005c2ad1975591e9e2715740d6407ccad41379f136ef2e8d24ded8b97b01165a3ae4bd377119a6a1049ca05d3220404fc12bee86114ff2bff0d +SHA512 (compiler-rt-18.1.8.src.tar.xz.sig) = 06d90afa46fb8c7ad6879564d1eb35e45711768593b580cf59e9908ed89efd459a312ae3c317c38119b0142ce0f96bcc0f8e6010ec8b31d9620c5e8f6d2f932e +SHA512 (macos-minimal-sdk-91ac2eabd80f10d95cb4255c78999d9d2c45a3be.tar.gz) = fff681d5dda92a4aa510a99c3f3c72640bcc2cb02fa7e5b506d988aabb3aa0c249f8ab3a7d2635733daabaa57ad35b59dad91af9a64b7d87a57bf1171ccdc6af +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 0b2794a..80840e8 100644 --- a/tinygo.spec +++ b/tinygo.spec @@ -1,24 +1,29 @@ -# 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.33.0 -%global CMSIS_commit 9fe411cef1cef5de58e5957b89760759de44e393 -%global avr_commit 6624554c02b237b23dc17d53e992bf54033fc228 -%global clang_llvm_version 17 -%global cmsis_svd_commit df75ff974c76a911fc2815e29807f5ecaae06fc2 -%global compiler_rt_version %{clang_llvm_version}.0.1 -%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 clang_llvm_version 18 +%global cmsis_svd_data_commit 40327a4d2dff0992682be2872aaa6e096f35d2f4 +%global compiler_rt_version %{clang_llvm_version}.1.8 +%global macos_minsdk_commit 91ac2eabd80f10d95cb4255c78999d9d2c45a3be +%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. @@ -41,13 +46,13 @@ Summary: Go compiler for small places # Main files: BSD-3-Clause # builder/cc1as.*: Apache-2.0 WITH LLVM-exception # corpus_test.go: MIT -# src/net: BSD-2-Clause # 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 +# 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) @@ -62,7 +67,7 @@ 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 @@ -72,30 +77,29 @@ 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 + # We don't have wasmtime to run these. -Patch0001: 0001-Skip-WASI-tests.patch +Patch: 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 +Patch: 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 - -# Support LLVM 17. -# https://github.com/tinygo-org/tinygo/pull/3923 -Patch0004: 0004-transform-fix-bug-in-StringToBytes-optimization-pass.patch -# https://github.com/tinygo-org/tinygo/pull/3918 -Patch0005: 0005-all-use-the-new-LLVM-pass-manager.patch -# https://github.com/tinygo-org/tinygo/pull/3913 -Patch0006: 0006-avr-don-t-compile-large-parts-of-picolibc-math-stdio.patch -Patch0007: 0007-all-add-initial-LLVM-17-support.patch - +Patch: 0003-Suggest-optional-packages-to-install-if-missing.patch +# We set GO111MODULE=off during tests, so can't run a few of them. +Patch: 0004-Skip-tests-that-require-Go-module-mode.patch # Better search paths for non-default LLVM. -Patch0008: 0008-Set-LLVM-search-paths-for-Fedora.patch +Patch: 0005-Set-LLVM-search-paths-for-Fedora.patch +# https://github.com/tinygo-org/tinygo/pull/4686 +Patch: 0006-builder-Fix-parsing-of-external-ld.lld-error-message.patch # Not supported upstream yet. ExcludeArch: ppc64le s390x @@ -112,26 +116,27 @@ 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(golang.org/x/net/http/httpguts) >= 0.26 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.11 +BuildRequires: golang(golang.org/x/tools/go/ssa) >= 0.21 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(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 @@ -154,7 +159,7 @@ Recommends: qemu-user 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} @@ -176,7 +181,7 @@ mv lib/avr-mcu-%{avr_commit} lib/avr 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 # Verify *before* actually unpacking! %{gpgverify} --keyring='%{SOURCE52}' --signature='%{SOURCE51}' --data='%{SOURCE50}' @@ -207,27 +212,28 @@ mv lib/picolibc-%{picolibc_commit} lib/picolibc 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 tar -C lib -xf %{SOURCE11} rmdir lib/mingw-w64 mv lib/mingw-w64-%{mingw64_commit} lib/mingw-w64 +tar -C src -xf %{SOURCE12} +rmdir src/net +mv src/net-%{net_commit} src/net + +%if %{with wasi_cli} +tar -C lib -xf %{SOURCE13} +rmdir lib/wasi-cli +mv lib/wasi-cli-%{wasi_cli_version} lib/wasi-cli +%endif + %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} " %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 LLVM_AR=llvm-ar-%{clang_llvm_version} if ! command -v $LLVM_AR 2>&1 >/dev/null then @@ -259,6 +265,8 @@ install -vdm 0755 %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt/lib-comm 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/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/kernel32.def.in %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt/lib-common +install -vdm 0755 %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt/stdio +cp -rp lib/mingw-w64/mingw-w64-crt/stdio/ucrt_* %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt/stdio 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/defaults/include %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-headers/defaults @@ -270,6 +278,7 @@ 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 @@ -280,9 +289,12 @@ 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/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/multibyte %{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 @@ -292,6 +304,24 @@ cp -rp lib/musl/src/unistd %{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/libc-bottom-half +install -vdm 0755 %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-bottom-half/headers +cp -rp lib/wasi-libc/libc-bottom-half/headers/public %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-bottom-half/headers +install -vdm 0755 %{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/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/math %{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 +%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} @@ -305,13 +335,6 @@ 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}/ From 5f84d1ac7a10f216b8617765976d1f85f9f138cf Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 31 Dec 2024 03:39:09 -0500 Subject: [PATCH 10/18] Update to 0.34.0 --- 0001-Skip-WASI-tests.patch | 10 +++--- ...oss-Linux-tests-where-qemu-is-broken.patch | 18 +++++----- ...ional-packages-to-install-if-missing.patch | 8 ++--- ...ip-tests-that-require-Go-module-mode.patch | 16 ++++----- 0005-Set-LLVM-search-paths-for-Fedora.patch | 4 +-- ...-Add-flag-to-skip-Renesas-SVD-builds.patch | 29 ++++++++++++++++ ...malize-expected-path-for-chdir-tests.patch | 33 +++++++++++++++++++ ...ing-of-external-ld.lld-error-message.patch | 10 +++--- sources | 4 +-- tinygo.spec | 19 ++++++++--- 10 files changed, 112 insertions(+), 39 deletions(-) create mode 100644 0006-Add-flag-to-skip-Renesas-SVD-builds.patch create mode 100644 0007-Normalize-expected-path-for-chdir-tests.patch rename 0006-builder-Fix-parsing-of-external-ld.lld-error-message.patch => 0008-builder-Fix-parsing-of-external-ld.lld-error-message.patch (86%) diff --git a/0001-Skip-WASI-tests.patch b/0001-Skip-WASI-tests.patch index 9b8492d..67fb988 100644 --- a/0001-Skip-WASI-tests.patch +++ b/0001-Skip-WASI-tests.patch @@ -1,7 +1,7 @@ -From 0395d806d83b1dffc5cd5e2c08c2d3771e585695 Mon Sep 17 00:00:00 2001 +From f0ed6e6aa02bdb74e0cee40e5ac1b100e0e3fcea Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 15 Dec 2020 05:06:04 -0500 -Subject: [PATCH 1/6] Skip WASI tests. +Subject: [PATCH 1/8] Skip WASI tests. We do not have wasmtime available. @@ -11,10 +11,10 @@ Signed-off-by: Elliott Sales de Andrade 1 file changed, 9 deletions(-) diff --git a/main_test.go b/main_test.go -index 836a4b17..21618761 100644 +index 136128d5..b48e9eef 100644 --- a/main_test.go +++ b/main_test.go -@@ -181,14 +181,6 @@ func TestBuild(t *testing.T) { +@@ -195,14 +195,6 @@ func TestBuild(t *testing.T) { t.Parallel() runPlatTests(optionsFromTarget("wasm", sema), tests, t) }) @@ -29,7 +29,7 @@ index 836a4b17..21618761 100644 } } -@@ -535,7 +527,6 @@ func TestTest(t *testing.T) { +@@ -809,7 +801,6 @@ func TestTest(t *testing.T) { // Node/Wasmtime targ{"WASM", optionsFromTarget("wasm", sema)}, 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 index 6fe65c2..db48b94 100644 --- a/0002-Skip-some-cross-Linux-tests-where-qemu-is-broken.patch +++ b/0002-Skip-some-cross-Linux-tests-where-qemu-is-broken.patch @@ -1,7 +1,7 @@ -From e782ed360fb028180e3c0a7f5ce1bac06b7ed035 Mon Sep 17 00:00:00 2001 +From 2df64834032a8224809485cffac7c30ce589753f Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 3 Jan 2022 22:39:31 -0500 -Subject: [PATCH 2/6] Skip some cross Linux tests where qemu is broken +Subject: [PATCH 2/8] 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, 19 insertions(+) diff --git a/main_test.go b/main_test.go -index 21618761..0eae5141 100644 +index b48e9eef..b5a152ce 100644 --- a/main_test.go +++ b/main_test.go -@@ -296,6 +296,13 @@ func runPlatTests(options compileopts.Options, tests []string, t *testing.T) { +@@ -325,6 +325,13 @@ func runPlatTests(options compileopts.Options, tests []string, t *testing.T) { } func emuCheck(t *testing.T, options compileopts.Options) { @@ -31,7 +31,7 @@ index 21618761..0eae5141 100644 // Check if the emulator is installed. spec, err := compileopts.LoadTarget(&options) if err != nil { -@@ -385,6 +392,11 @@ func runTestWithConfig(name string, t *testing.T, options compileopts.Options, c +@@ -410,6 +417,11 @@ func runTestWithConfig(name string, t *testing.T, options compileopts.Options, c t.Fatal(err) } @@ -43,7 +43,7 @@ index 21618761..0eae5141 100644 // Build the test binary. stdout := &bytes.Buffer{} _, err = buildAndRun(pkgName, config, stdout, cmdArgs, environmentVars, time.Minute, func(cmd *exec.Cmd, result builder.BuildResult) error { -@@ -400,6 +412,13 @@ func runTestWithConfig(name string, t *testing.T, options compileopts.Options, c +@@ -425,6 +437,13 @@ func runTestWithConfig(name string, t *testing.T, options compileopts.Options, c return } @@ -54,9 +54,9 @@ index 21618761..0eae5141 100644 + 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 + actual := stdout.Bytes() + if config.EmulatorName() == "simavr" { + // Strip simavr log formatting. -- 2.47.0 diff --git a/0003-Suggest-optional-packages-to-install-if-missing.patch b/0003-Suggest-optional-packages-to-install-if-missing.patch index c7894f2..1c5b4ba 100644 --- a/0003-Suggest-optional-packages-to-install-if-missing.patch +++ b/0003-Suggest-optional-packages-to-install-if-missing.patch @@ -1,7 +1,7 @@ -From 85d91373b6a302cc1f468adab6413472f56f295a Mon Sep 17 00:00:00 2001 +From 19a6901099ee8adbb5f085c5e98334019b9e92e9 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 6 Feb 2022 03:49:16 -0500 -Subject: [PATCH 3/6] Suggest optional packages to install if missing +Subject: [PATCH 3/8] Suggest optional packages to install if missing Signed-off-by: Elliott Sales de Andrade --- @@ -9,7 +9,7 @@ Signed-off-by: Elliott Sales de Andrade 1 file changed, 17 insertions(+) diff --git a/builder/jobs.go b/builder/jobs.go -index a23d0753..2380f683 100644 +index 11688746..cc561763 100644 --- a/builder/jobs.go +++ b/builder/jobs.go @@ -7,6 +7,7 @@ import ( @@ -20,7 +20,7 @@ index a23d0753..2380f683 100644 "runtime" "sort" "strings" -@@ -37,6 +38,22 @@ type compileJob struct { +@@ -29,6 +30,22 @@ type compileJob struct { duration time.Duration // how long it took to run this job (only set after finishing) } diff --git a/0004-Skip-tests-that-require-Go-module-mode.patch b/0004-Skip-tests-that-require-Go-module-mode.patch index 0777a68..1f84e14 100644 --- a/0004-Skip-tests-that-require-Go-module-mode.patch +++ b/0004-Skip-tests-that-require-Go-module-mode.patch @@ -1,7 +1,7 @@ -From 74d6f158651bcd5a923aaae31d93e01dbb35e4f7 Mon Sep 17 00:00:00 2001 +From 31b8b93dea42516caabf904f02172eef9350ff80 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 28 Feb 2024 04:26:40 -0500 -Subject: [PATCH 4/6] Skip tests that require Go module mode +Subject: [PATCH 4/8] Skip tests that require Go module mode Signed-off-by: Elliott Sales de Andrade --- @@ -11,10 +11,10 @@ Signed-off-by: Elliott Sales de Andrade 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/errors_test.go b/errors_test.go -index 62d5af2c..4a51da59 100644 +index fe118616..16421eee 100644 --- a/errors_test.go +++ b/errors_test.go -@@ -34,7 +34,7 @@ func TestErrors(t *testing.T) { +@@ -36,7 +36,7 @@ func TestErrors(t *testing.T) { {name: "loader-importcycle"}, {name: "loader-invaliddep"}, {name: "loader-invalidpackage"}, @@ -24,18 +24,18 @@ index 62d5af2c..4a51da59 100644 {name: "syntax"}, {name: "types"}, diff --git a/main_test.go b/main_test.go -index 0eae5141..c2d0e088 100644 +index b5a152ce..6991b5a1 100644 --- a/main_test.go +++ b/main_test.go -@@ -72,7 +72,6 @@ func TestBuild(t *testing.T) { +@@ -76,7 +76,6 @@ func TestBuild(t *testing.T) { "json.go", "map.go", "math.go", - "oldgo/", "print.go", "reflect.go", - "slice.go", -@@ -668,6 +667,7 @@ func ioLogger(t *testing.T, wg *sync.WaitGroup) io.WriteCloser { + "signal.go", +@@ -942,6 +941,7 @@ func ioLogger(t *testing.T, wg *sync.WaitGroup) io.WriteCloser { } func TestGetListOfPackages(t *testing.T) { diff --git a/0005-Set-LLVM-search-paths-for-Fedora.patch b/0005-Set-LLVM-search-paths-for-Fedora.patch index 38ac98a..6030480 100644 --- a/0005-Set-LLVM-search-paths-for-Fedora.patch +++ b/0005-Set-LLVM-search-paths-for-Fedora.patch @@ -1,7 +1,7 @@ -From 15f17a3a4b59b199b5935d4da7ba6fcd4b69b765 Mon Sep 17 00:00:00 2001 +From 71d2c05e4733c76590443c46d1f32a66fff33a35 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 27 Oct 2024 23:33:18 -0400 -Subject: [PATCH 5/6] Set LLVM search paths for Fedora +Subject: [PATCH 5/8] Set LLVM search paths for Fedora Signed-off-by: Elliott Sales de Andrade --- diff --git a/0006-Add-flag-to-skip-Renesas-SVD-builds.patch b/0006-Add-flag-to-skip-Renesas-SVD-builds.patch new file mode 100644 index 0000000..6662288 --- /dev/null +++ b/0006-Add-flag-to-skip-Renesas-SVD-builds.patch @@ -0,0 +1,29 @@ +From c249a5e2553f6c2d15623d4f1a1e9b09ae729c34 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Tue, 31 Dec 2024 00:34:13 -0500 +Subject: [PATCH 6/8] Add flag to skip Renesas SVD builds + +Signed-off-by: Elliott Sales de Andrade +--- + GNUmakefile | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/GNUmakefile b/GNUmakefile +index fd2d282c..f173486c 100644 +--- a/GNUmakefile ++++ b/GNUmakefile +@@ -185,7 +185,10 @@ fmt-check: ## Warn if any source needs reformatting + @unformatted=$$(gofmt -l $(FMT_PATHS)); [ -z "$$unformatted" ] && exit 0; echo "Unformatted:"; for fn in $$unformatted; do echo " $$fn"; done; exit 1 + + +-gen-device: gen-device-avr gen-device-esp gen-device-nrf gen-device-sam gen-device-sifive gen-device-kendryte gen-device-nxp gen-device-rp gen-device-renesas ## Generate microcontroller-specific sources ++gen-device: gen-device-avr gen-device-esp gen-device-nrf gen-device-sam gen-device-sifive gen-device-kendryte gen-device-nxp gen-device-rp ## Generate microcontroller-specific sources ++ifneq ($(RENESAS), 0) ++gen-device: gen-device-renesas ++endif + ifneq ($(STM32), 0) + gen-device: gen-device-stm32 + endif +-- +2.47.0 + diff --git a/0007-Normalize-expected-path-for-chdir-tests.patch b/0007-Normalize-expected-path-for-chdir-tests.patch new file mode 100644 index 0000000..5880eb7 --- /dev/null +++ b/0007-Normalize-expected-path-for-chdir-tests.patch @@ -0,0 +1,33 @@ +From f3d14b6d0ce2b680f0ca8e298818e2b11817aeaf Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Tue, 31 Dec 2024 02:00:17 -0500 +Subject: [PATCH 7/8] 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.47.0 + diff --git a/0006-builder-Fix-parsing-of-external-ld.lld-error-message.patch b/0008-builder-Fix-parsing-of-external-ld.lld-error-message.patch similarity index 86% rename from 0006-builder-Fix-parsing-of-external-ld.lld-error-message.patch rename to 0008-builder-Fix-parsing-of-external-ld.lld-error-message.patch index ed55301..e7d8f9b 100644 --- a/0006-builder-Fix-parsing-of-external-ld.lld-error-message.patch +++ b/0008-builder-Fix-parsing-of-external-ld.lld-error-message.patch @@ -1,7 +1,7 @@ -From bc0fcf1b16b50738615df96f1f2f7e6e0267da9e Mon Sep 17 00:00:00 2001 +From 0c8f59a18436d7405ad5977b4ebb607a2d3ef7d1 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 5 Jan 2025 02:20:33 -0500 -Subject: [PATCH 6/6] builder: Fix parsing of external ld.lld error messages +Subject: [PATCH 8/8] builder: Fix parsing of external ld.lld error messages If `ld.lld` is a version-specific binary (e.g., `ld.lld-18`), then its error messages include the version. The parsing previously incorrectly @@ -13,10 +13,10 @@ Signed-off-by: Elliott Sales de Andrade 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/builder/tools.go b/builder/tools.go -index bd18aa09..65d5c63b 100644 +index b4087828..1c4214da 100644 --- a/builder/tools.go +++ b/builder/tools.go -@@ -85,8 +85,8 @@ func parseLLDErrors(text string) error { +@@ -98,8 +98,8 @@ func parseLLDErrors(text string) error { // Check for undefined symbols. // This can happen in some cases like with CGo and //go:linkname tricker. @@ -27,7 +27,7 @@ index bd18aa09..65d5c63b 100644 for _, line := range strings.Split(message, "\n") { matches := regexp.MustCompile(`referenced by .* \(((.*):([0-9]+))\)`).FindStringSubmatch(line) if matches != nil { -@@ -105,9 +105,9 @@ func parseLLDErrors(text string) error { +@@ -118,9 +118,9 @@ func parseLLDErrors(text string) error { } // Check for flash/RAM overflow. diff --git a/sources b/sources index 43b242a..b36c23c 100644 --- a/sources +++ b/sources @@ -1,10 +1,10 @@ -SHA512 (tinygo-0.33.0.tar.gz) = 3f899d7486d71847bb1fc904e8ad8ecb3b3153475bae954df8e486fbc711622e36d9a2fb3b45fe52a9ed62c618cc5a2dd7bf73d2d25d86670636689712f8a5a9 +SHA512 (tinygo-0.34.0.tar.gz) = 2c6c4b8b727540c6d83d6429125a8011cc049b9670e92e1fc31a4da74be4c078b19eec8f324b5dd7becb389ef15f613b619a29fa3b1ecc4208ddcb5d662708b5 SHA512 (avr-6624554c02b237b23dc17d53e992bf54033fc228.tar.gz) = 1aa157bd761db38f8680614fa1cf47d7009508f65291b7eaaa5aba1ae76d35103f68a42947b7269a170d2f1cf8fb09941a5d74070fe6d204b68dd15a9ad2ed29 SHA512 (cmsis-9fe411cef1cef5de58e5957b89760759de44e393-clean.tar.xz) = f131fc241f61982c49f334eb502c2f13da61eb7bdaa641ee84a8de30c4d576b735b8aadeafd7d75351473a2df6a42de6a236ecc5dcc616ee6cfcc07af29446f9 SHA512 (cmsis_svd_data-40327a4d2dff0992682be2872aaa6e096f35d2f4-clean.tar.xz) = 851179df0f9fb86b6c8c340659568bd367ffd9ac801f0bbf1a0a10713599c6e78fb5d0cb27ac31c6ea5d8c4f71c52f925bdeef0d49a8a93c63b62ef555423718 SHA512 (compiler-rt-18.1.8.src.tar.xz) = fb8795bd51c9b005c2ad1975591e9e2715740d6407ccad41379f136ef2e8d24ded8b97b01165a3ae4bd377119a6a1049ca05d3220404fc12bee86114ff2bff0d SHA512 (compiler-rt-18.1.8.src.tar.xz.sig) = 06d90afa46fb8c7ad6879564d1eb35e45711768593b580cf59e9908ed89efd459a312ae3c317c38119b0142ce0f96bcc0f8e6010ec8b31d9620c5e8f6d2f932e -SHA512 (macos-minimal-sdk-91ac2eabd80f10d95cb4255c78999d9d2c45a3be.tar.gz) = fff681d5dda92a4aa510a99c3f3c72640bcc2cb02fa7e5b506d988aabb3aa0c249f8ab3a7d2635733daabaa57ad35b59dad91af9a64b7d87a57bf1171ccdc6af +SHA512 (macos-minimal-sdk-4e4113e3b1244b8fdc5e1486577f25e22d63f36e.tar.gz) = 10de6205ee6f7c6079e1120d4f42a72b984e1727a81a8f7fc9c9d4dd16e51c71291ab9d4fd88b36843b2b39a3c981fe4007b93ebaf920627f524417fbfdc823a SHA512 (mingw64-8526cb618269440a94810b94b77f8bd48c5c3396.tar.gz) = 723d1ac22d8026f31b59d39328f711f36976798445a82daddcdc9fa6ab4346a5030e9c2efc84ef009439b8f021c5c7c120cfa083a7912a5b0212ac6852c005a7 SHA512 (musl-1.2.3.tar.gz) = 9332f713d3eb7de4369bc0327d99252275ee52abf523ee34b894b24a387f67579787f7c72a46cf652e090cffdb0bc3719a4e7b84dca66890b6a37f12e8ad089c SHA512 (musl-1.2.3.tar.gz.asc) = 01a857dbc3981c90244d4d1d883efe51986652ca5734a741c9d1a4d06c5a22831e85520ac67212268b70c22049317a8f39b3219be182e7e67741add428ac5bc6 diff --git a/tinygo.spec b/tinygo.spec index 80840e8..466597c 100644 --- a/tinygo.spec +++ b/tinygo.spec @@ -8,14 +8,14 @@ # https://github.com/tinygo-org/tinygo %global goipath github.com/tinygo-org/tinygo -Version: 0.33.0 +Version: 0.34.0 %global CMSIS_commit 9fe411cef1cef5de58e5957b89760759de44e393 %global avr_commit 6624554c02b237b23dc17d53e992bf54033fc228 %global clang_llvm_version 18 %global cmsis_svd_data_commit 40327a4d2dff0992682be2872aaa6e096f35d2f4 %global compiler_rt_version %{clang_llvm_version}.1.8 -%global macos_minsdk_commit 91ac2eabd80f10d95cb4255c78999d9d2c45a3be +%global macos_minsdk_commit 4e4113e3b1244b8fdc5e1486577f25e22d63f36e %global mingw64_commit 8526cb618269440a94810b94b77f8bd48c5c3396 %global musl_version 1.2.3 %global net_commit c134160ae47d38b468b1c5ade43e78ad5a1e616d @@ -98,8 +98,12 @@ Patch: 0003-Suggest-optional-packages-to-install-if-missing.patch Patch: 0004-Skip-tests-that-require-Go-module-mode.patch # Better search paths for non-default LLVM. Patch: 0005-Set-LLVM-search-paths-for-Fedora.patch +# We can't include these due to poor licensing. +Patch: 0006-Add-flag-to-skip-Renesas-SVD-builds.patch +#https://github.com/tinygo-org/tinygo/pull/4677 +Patch: 0007-Normalize-expected-path-for-chdir-tests.patch # https://github.com/tinygo-org/tinygo/pull/4686 -Patch: 0006-builder-Fix-parsing-of-external-ld.lld-error-message.patch +Patch: 0008-builder-Fix-parsing-of-external-ld.lld-error-message.patch # Not supported upstream yet. ExcludeArch: ppc64le s390x @@ -118,6 +122,7 @@ 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.26 BuildRequires: golang(github.com/sigurn/crc16) BuildRequires: golang(go.bug.st/serial) >= 1.6.0 @@ -228,12 +233,18 @@ rmdir lib/wasi-cli mv lib/wasi-cli-%{wasi_cli_version} lib/wasi-cli %endif +# Fix permissions +# https://github.com/tinygo-org/tinygo/pull/4676 +chmod -x \ + src/internal/wasi/cli/v0.2.0/command/command.wit \ + src/internal/wasi/*/v0.2.0/*/*.wasm.go + %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} " %gobuild -o %{gobuilddir}/bin/tinygo %{goipath} -GO111MODULE=off %make_build gen-device STM32=0 +GO111MODULE=off %make_build gen-device RENESAS=0 STM32=0 LLVM_AR=llvm-ar-%{clang_llvm_version} if ! command -v $LLVM_AR 2>&1 >/dev/null then From 4bdd7c5cf353d8a2790c6b84943870f643550a50 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 5 Jan 2025 18:40:10 -0500 Subject: [PATCH 11/18] Remove older patches - QEMU is no longer broken for the cases we need. - The optional package suggestion was never fully implemented, so drop it for now. --- 0001-Skip-WASI-tests.patch | 4 +- ...oss-Linux-tests-where-qemu-is-broken.patch | 62 ------------------- ...ip-tests-that-require-Go-module-mode.patch | 8 +-- ...003-Set-LLVM-search-paths-for-Fedora.patch | 4 +- ...ional-packages-to-install-if-missing.patch | 48 -------------- ...-Add-flag-to-skip-Renesas-SVD-builds.patch | 4 +- ...malize-expected-path-for-chdir-tests.patch | 4 +- ...ing-of-external-ld.lld-error-message.patch | 4 +- tinygo.spec | 18 ++---- 9 files changed, 19 insertions(+), 137 deletions(-) delete mode 100644 0002-Skip-some-cross-Linux-tests-where-qemu-is-broken.patch rename 0004-Skip-tests-that-require-Go-module-mode.patch => 0002-Skip-tests-that-require-Go-module-mode.patch (88%) rename 0005-Set-LLVM-search-paths-for-Fedora.patch => 0003-Set-LLVM-search-paths-for-Fedora.patch (97%) delete mode 100644 0003-Suggest-optional-packages-to-install-if-missing.patch rename 0006-Add-flag-to-skip-Renesas-SVD-builds.patch => 0004-Add-flag-to-skip-Renesas-SVD-builds.patch (90%) rename 0007-Normalize-expected-path-for-chdir-tests.patch => 0005-Normalize-expected-path-for-chdir-tests.patch (88%) rename 0008-builder-Fix-parsing-of-external-ld.lld-error-message.patch => 0006-builder-Fix-parsing-of-external-ld.lld-error-message.patch (93%) diff --git a/0001-Skip-WASI-tests.patch b/0001-Skip-WASI-tests.patch index 67fb988..a9cd369 100644 --- a/0001-Skip-WASI-tests.patch +++ b/0001-Skip-WASI-tests.patch @@ -1,7 +1,7 @@ -From f0ed6e6aa02bdb74e0cee40e5ac1b100e0e3fcea Mon Sep 17 00:00:00 2001 +From fdea482c9630b297ccdb7232c9a3dc28f753c912 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 15 Dec 2020 05:06:04 -0500 -Subject: [PATCH 1/8] Skip WASI tests. +Subject: [PATCH 1/6] Skip WASI tests We do not have wasmtime available. 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 db48b94..0000000 --- a/0002-Skip-some-cross-Linux-tests-where-qemu-is-broken.patch +++ /dev/null @@ -1,62 +0,0 @@ -From 2df64834032a8224809485cffac7c30ce589753f Mon Sep 17 00:00:00 2001 -From: Elliott Sales de Andrade -Date: Mon, 3 Jan 2022 22:39:31 -0500 -Subject: [PATCH 2/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 ---- - main_test.go | 19 +++++++++++++++++++ - 1 file changed, 19 insertions(+) - -diff --git a/main_test.go b/main_test.go -index b48e9eef..b5a152ce 100644 ---- a/main_test.go -+++ b/main_test.go -@@ -325,6 +325,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 { -@@ -410,6 +417,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(pkgName, config, stdout, cmdArgs, environmentVars, time.Minute, func(cmd *exec.Cmd, result builder.BuildResult) error { -@@ -425,6 +437,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 -+ } -+ - actual := stdout.Bytes() - if config.EmulatorName() == "simavr" { - // Strip simavr log formatting. --- -2.47.0 - diff --git a/0004-Skip-tests-that-require-Go-module-mode.patch b/0002-Skip-tests-that-require-Go-module-mode.patch similarity index 88% rename from 0004-Skip-tests-that-require-Go-module-mode.patch rename to 0002-Skip-tests-that-require-Go-module-mode.patch index 1f84e14..f1fdc1a 100644 --- a/0004-Skip-tests-that-require-Go-module-mode.patch +++ b/0002-Skip-tests-that-require-Go-module-mode.patch @@ -1,7 +1,7 @@ -From 31b8b93dea42516caabf904f02172eef9350ff80 Mon Sep 17 00:00:00 2001 +From 791e9bf907c5c968f9e4b38c0d8c9083d42e82dd Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 28 Feb 2024 04:26:40 -0500 -Subject: [PATCH 4/8] Skip tests that require Go module mode +Subject: [PATCH 2/6] Skip tests that require Go module mode Signed-off-by: Elliott Sales de Andrade --- @@ -24,7 +24,7 @@ index fe118616..16421eee 100644 {name: "syntax"}, {name: "types"}, diff --git a/main_test.go b/main_test.go -index b5a152ce..6991b5a1 100644 +index b48e9eef..c7b11229 100644 --- a/main_test.go +++ b/main_test.go @@ -76,7 +76,6 @@ func TestBuild(t *testing.T) { @@ -35,7 +35,7 @@ index b5a152ce..6991b5a1 100644 "print.go", "reflect.go", "signal.go", -@@ -942,6 +941,7 @@ func ioLogger(t *testing.T, wg *sync.WaitGroup) io.WriteCloser { +@@ -923,6 +922,7 @@ func ioLogger(t *testing.T, wg *sync.WaitGroup) io.WriteCloser { } func TestGetListOfPackages(t *testing.T) { diff --git a/0005-Set-LLVM-search-paths-for-Fedora.patch b/0003-Set-LLVM-search-paths-for-Fedora.patch similarity index 97% rename from 0005-Set-LLVM-search-paths-for-Fedora.patch rename to 0003-Set-LLVM-search-paths-for-Fedora.patch index 6030480..a619e68 100644 --- a/0005-Set-LLVM-search-paths-for-Fedora.patch +++ b/0003-Set-LLVM-search-paths-for-Fedora.patch @@ -1,7 +1,7 @@ -From 71d2c05e4733c76590443c46d1f32a66fff33a35 Mon Sep 17 00:00:00 2001 +From d18d696a118fa2078daf4cecb87cf1c64680ccb2 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 27 Oct 2024 23:33:18 -0400 -Subject: [PATCH 5/8] Set LLVM search paths for Fedora +Subject: [PATCH 3/6] Set LLVM search paths for Fedora Signed-off-by: Elliott Sales de Andrade --- 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 1c5b4ba..0000000 --- a/0003-Suggest-optional-packages-to-install-if-missing.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 19a6901099ee8adbb5f085c5e98334019b9e92e9 Mon Sep 17 00:00:00 2001 -From: Elliott Sales de Andrade -Date: Sun, 6 Feb 2022 03:49:16 -0500 -Subject: [PATCH 3/8] 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 11688746..cc561763 100644 ---- a/builder/jobs.go -+++ b/builder/jobs.go -@@ -7,6 +7,7 @@ import ( - "container/heap" - "errors" - "fmt" -+ "os" - "runtime" - "sort" - "strings" -@@ -29,6 +30,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.47.0 - diff --git a/0006-Add-flag-to-skip-Renesas-SVD-builds.patch b/0004-Add-flag-to-skip-Renesas-SVD-builds.patch similarity index 90% rename from 0006-Add-flag-to-skip-Renesas-SVD-builds.patch rename to 0004-Add-flag-to-skip-Renesas-SVD-builds.patch index 6662288..1b2a44e 100644 --- a/0006-Add-flag-to-skip-Renesas-SVD-builds.patch +++ b/0004-Add-flag-to-skip-Renesas-SVD-builds.patch @@ -1,7 +1,7 @@ -From c249a5e2553f6c2d15623d4f1a1e9b09ae729c34 Mon Sep 17 00:00:00 2001 +From 40a1ef5d46b91cf32f09be7e6247ae1c32bd0dbd Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 31 Dec 2024 00:34:13 -0500 -Subject: [PATCH 6/8] Add flag to skip Renesas SVD builds +Subject: [PATCH 4/6] Add flag to skip Renesas SVD builds Signed-off-by: Elliott Sales de Andrade --- diff --git a/0007-Normalize-expected-path-for-chdir-tests.patch b/0005-Normalize-expected-path-for-chdir-tests.patch similarity index 88% rename from 0007-Normalize-expected-path-for-chdir-tests.patch rename to 0005-Normalize-expected-path-for-chdir-tests.patch index 5880eb7..9425503 100644 --- a/0007-Normalize-expected-path-for-chdir-tests.patch +++ b/0005-Normalize-expected-path-for-chdir-tests.patch @@ -1,7 +1,7 @@ -From f3d14b6d0ce2b680f0ca8e298818e2b11817aeaf Mon Sep 17 00:00:00 2001 +From 89167785ea2820fd19444b5c02c937486c6c4ad7 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 31 Dec 2024 02:00:17 -0500 -Subject: [PATCH 7/8] Normalize expected path for chdir tests +Subject: [PATCH 5/6] 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 diff --git a/0008-builder-Fix-parsing-of-external-ld.lld-error-message.patch b/0006-builder-Fix-parsing-of-external-ld.lld-error-message.patch similarity index 93% rename from 0008-builder-Fix-parsing-of-external-ld.lld-error-message.patch rename to 0006-builder-Fix-parsing-of-external-ld.lld-error-message.patch index e7d8f9b..c471e58 100644 --- a/0008-builder-Fix-parsing-of-external-ld.lld-error-message.patch +++ b/0006-builder-Fix-parsing-of-external-ld.lld-error-message.patch @@ -1,7 +1,7 @@ -From 0c8f59a18436d7405ad5977b4ebb607a2d3ef7d1 Mon Sep 17 00:00:00 2001 +From 7c03dcc9f5b8e632f1d33dc4e09f74853c1951cc Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 5 Jan 2025 02:20:33 -0500 -Subject: [PATCH 8/8] builder: Fix parsing of external ld.lld error messages +Subject: [PATCH 6/6] builder: Fix parsing of external ld.lld error messages If `ld.lld` is a version-specific binary (e.g., `ld.lld-18`), then its error messages include the version. The parsing previously incorrectly diff --git a/tinygo.spec b/tinygo.spec index 466597c..6b0d279 100644 --- a/tinygo.spec +++ b/tinygo.spec @@ -86,24 +86,16 @@ Source13: https://github.com/WebAssembly/wasi-cli/archive/v%{wasi_cli_vers # We don't have wasmtime to run these. Patch: 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 -Patch: 0002-Skip-some-cross-Linux-tests-where-qemu-is-broken.patch -# Add Fedora specific dnf instructions -Patch: 0003-Suggest-optional-packages-to-install-if-missing.patch # We set GO111MODULE=off during tests, so can't run a few of them. -Patch: 0004-Skip-tests-that-require-Go-module-mode.patch +Patch: 0002-Skip-tests-that-require-Go-module-mode.patch # Better search paths for non-default LLVM. -Patch: 0005-Set-LLVM-search-paths-for-Fedora.patch +Patch: 0003-Set-LLVM-search-paths-for-Fedora.patch # We can't include these due to poor licensing. -Patch: 0006-Add-flag-to-skip-Renesas-SVD-builds.patch +Patch: 0004-Add-flag-to-skip-Renesas-SVD-builds.patch #https://github.com/tinygo-org/tinygo/pull/4677 -Patch: 0007-Normalize-expected-path-for-chdir-tests.patch +Patch: 0005-Normalize-expected-path-for-chdir-tests.patch # https://github.com/tinygo-org/tinygo/pull/4686 -Patch: 0008-builder-Fix-parsing-of-external-ld.lld-error-message.patch +Patch: 0006-builder-Fix-parsing-of-external-ld.lld-error-message.patch # Not supported upstream yet. ExcludeArch: ppc64le s390x From 98fdc4179f488b2d37157a60ce55bba0b538ffdb Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 20 Jul 2025 04:07:35 -0400 Subject: [PATCH 12/18] Update to latest version (#2266297) --- .gitignore | 1 + 0001-Skip-WASI-tests.patch | 32 ++-- ...ip-tests-that-require-Go-module-mode.patch | 14 +- 0003-Set-LLVM-search-paths-for-Fedora.patch | 46 ++++- ...-Add-flag-to-skip-Renesas-SVD-builds.patch | 8 +- ...malize-expected-path-for-chdir-tests.patch | 4 +- 0006-Skip-x86-tests-on-ARM.patch | 44 +++++ ...ing-of-external-ld.lld-error-message.patch | 45 ----- ...312c689a004434cb77f161f65b9615c98036.patch | 69 ++++++++ clean_tarballs.sh | 16 +- musl-cve-2025-26519-1.patch | 38 +++++ musl-cve-2025-26519-2.patch | 38 +++++ sources | 7 +- tinygo.spec | 158 +++++++++++++----- 14 files changed, 395 insertions(+), 125 deletions(-) create mode 100644 0006-Skip-x86-tests-on-ARM.patch delete mode 100644 0006-builder-Fix-parsing-of-external-ld.lld-error-message.patch create mode 100644 1b5d312c689a004434cb77f161f65b9615c98036.patch create mode 100644 musl-cve-2025-26519-1.patch create mode 100644 musl-cve-2025-26519-2.patch diff --git a/.gitignore b/.gitignore index 0e53e41..18595d5 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,4 @@ /nrfx-*.tar.gz /picolibc-*.tar.gz /wasi-libc-*.tar.gz +/bdwgc-1166f11f7dee08d7ad369296b24cf8c9582f8789.tar.gz diff --git a/0001-Skip-WASI-tests.patch b/0001-Skip-WASI-tests.patch index a9cd369..8a26135 100644 --- a/0001-Skip-WASI-tests.patch +++ b/0001-Skip-WASI-tests.patch @@ -1,35 +1,43 @@ -From fdea482c9630b297ccdb7232c9a3dc28f753c912 Mon Sep 17 00:00:00 2001 +From cedd957d01a235fa05957242ea5c291b0fbc2e3d Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 15 Dec 2020 05:06:04 -0500 -Subject: [PATCH 1/6] Skip WASI tests +Subject: [PATCH 1/6] Skip WASI tests. We do not have wasmtime available. Signed-off-by: Elliott Sales de Andrade --- - main_test.go | 9 --------- - 1 file changed, 9 deletions(-) + main_test.go | 17 ----------------- + 1 file changed, 17 deletions(-) diff --git a/main_test.go b/main_test.go -index 136128d5..b48e9eef 100644 +index 5563b7ca..77b93c4d 100644 --- a/main_test.go +++ b/main_test.go -@@ -195,14 +195,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("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) - }) } - } -@@ -809,7 +801,6 @@ func TestTest(t *testing.T) { + if runtime.GOOS == "linux" { +@@ -921,7 +905,6 @@ func TestTest(t *testing.T) { // Node/Wasmtime targ{"WASM", optionsFromTarget("wasm", sema)}, @@ -38,5 +46,5 @@ index 136128d5..b48e9eef 100644 } for _, targ := range targs { -- -2.47.0 +2.50.0 diff --git a/0002-Skip-tests-that-require-Go-module-mode.patch b/0002-Skip-tests-that-require-Go-module-mode.patch index f1fdc1a..a4df02a 100644 --- a/0002-Skip-tests-that-require-Go-module-mode.patch +++ b/0002-Skip-tests-that-require-Go-module-mode.patch @@ -1,4 +1,4 @@ -From 791e9bf907c5c968f9e4b38c0d8c9083d42e82dd Mon Sep 17 00:00:00 2001 +From e3af7cfc28d948721d94cf6eafedf731453c50b5 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 28 Feb 2024 04:26:40 -0500 Subject: [PATCH 2/6] Skip tests that require Go module mode @@ -11,10 +11,10 @@ Signed-off-by: Elliott Sales de Andrade 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/errors_test.go b/errors_test.go -index fe118616..16421eee 100644 +index 871dc4c0..3d0bb162 100644 --- a/errors_test.go +++ b/errors_test.go -@@ -36,7 +36,7 @@ func TestErrors(t *testing.T) { +@@ -37,7 +37,7 @@ func TestErrors(t *testing.T) { {name: "loader-importcycle"}, {name: "loader-invaliddep"}, {name: "loader-invalidpackage"}, @@ -24,10 +24,10 @@ index fe118616..16421eee 100644 {name: "syntax"}, {name: "types"}, diff --git a/main_test.go b/main_test.go -index b48e9eef..c7b11229 100644 +index 77b93c4d..62153c69 100644 --- a/main_test.go +++ b/main_test.go -@@ -76,7 +76,6 @@ func TestBuild(t *testing.T) { +@@ -78,7 +78,6 @@ func TestBuild(t *testing.T) { "json.go", "map.go", "math.go", @@ -35,7 +35,7 @@ index b48e9eef..c7b11229 100644 "print.go", "reflect.go", "signal.go", -@@ -923,6 +922,7 @@ func ioLogger(t *testing.T, wg *sync.WaitGroup) io.WriteCloser { +@@ -1027,6 +1026,7 @@ func ioLogger(t *testing.T, wg *sync.WaitGroup) io.WriteCloser { } func TestGetListOfPackages(t *testing.T) { @@ -54,5 +54,5 @@ index 05c2f2d5..719a617b 100644 -// ERROR: invaliddep{{[\\/]}}invaliddep.go:1:1: expected 'package', found ppackage +// ERROR: {{.*}}invaliddep{{[\\/]}}invaliddep.go:1:1: expected 'package', found ppackage -- -2.47.0 +2.50.0 diff --git a/0003-Set-LLVM-search-paths-for-Fedora.patch b/0003-Set-LLVM-search-paths-for-Fedora.patch index a619e68..513149c 100644 --- a/0003-Set-LLVM-search-paths-for-Fedora.patch +++ b/0003-Set-LLVM-search-paths-for-Fedora.patch @@ -1,4 +1,4 @@ -From d18d696a118fa2078daf4cecb87cf1c64680ccb2 Mon Sep 17 00:00:00 2001 +From 18c5c78780371a39e79b983f8c3c71b24f5663d1 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 27 Oct 2024 23:33:18 -0400 Subject: [PATCH 3/6] Set LLVM search paths for Fedora @@ -9,7 +9,9 @@ Signed-off-by: Elliott Sales de Andrade cgo/libclang_config_llvm16.go | 4 ++-- cgo/libclang_config_llvm17.go | 4 ++-- cgo/libclang_config_llvm18.go | 4 ++-- - 4 files changed, 8 insertions(+), 8 deletions(-) + 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 @@ -66,7 +68,7 @@ index 6395d8a3..609b0758 100644 #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 3b769c62..18db6c08 100644 +index da181291..76f23129 100644 --- a/cgo/libclang_config_llvm18.go +++ b/cgo/libclang_config_llvm18.go @@ -3,11 +3,11 @@ @@ -83,6 +85,42 @@ index 3b769c62..18db6c08 100644 #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.47.0 +2.50.0 diff --git a/0004-Add-flag-to-skip-Renesas-SVD-builds.patch b/0004-Add-flag-to-skip-Renesas-SVD-builds.patch index 1b2a44e..4af0f29 100644 --- a/0004-Add-flag-to-skip-Renesas-SVD-builds.patch +++ b/0004-Add-flag-to-skip-Renesas-SVD-builds.patch @@ -1,4 +1,4 @@ -From 40a1ef5d46b91cf32f09be7e6247ae1c32bd0dbd Mon Sep 17 00:00:00 2001 +From 4a6bd01a01e551ea3ba0c5128628eea2714ba122 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 31 Dec 2024 00:34:13 -0500 Subject: [PATCH 4/6] Add flag to skip Renesas SVD builds @@ -9,10 +9,10 @@ Signed-off-by: Elliott Sales de Andrade 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/GNUmakefile b/GNUmakefile -index fd2d282c..f173486c 100644 +index f078bde5..321444da 100644 --- a/GNUmakefile +++ b/GNUmakefile -@@ -185,7 +185,10 @@ fmt-check: ## Warn if any source needs reformatting +@@ -187,7 +187,10 @@ fmt-check: ## Warn if any source needs reformatting @unformatted=$$(gofmt -l $(FMT_PATHS)); [ -z "$$unformatted" ] && exit 0; echo "Unformatted:"; for fn in $$unformatted; do echo " $$fn"; done; exit 1 @@ -25,5 +25,5 @@ index fd2d282c..f173486c 100644 gen-device: gen-device-stm32 endif -- -2.47.0 +2.50.0 diff --git a/0005-Normalize-expected-path-for-chdir-tests.patch b/0005-Normalize-expected-path-for-chdir-tests.patch index 9425503..2869273 100644 --- a/0005-Normalize-expected-path-for-chdir-tests.patch +++ b/0005-Normalize-expected-path-for-chdir-tests.patch @@ -1,4 +1,4 @@ -From 89167785ea2820fd19444b5c02c937486c6c4ad7 Mon Sep 17 00:00:00 2001 +From cef23b5da7902eaf69cc621ad384ea7815082e86 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Tue, 31 Dec 2024 02:00:17 -0500 Subject: [PATCH 5/6] Normalize expected path for chdir tests @@ -29,5 +29,5 @@ index 75281c21..660b25ac 100644 if cwd != expectDir { log.Fatalf("expected:\"%v\" != os.Getwd():\"%v\"", expectDir, cwd) -- -2.47.0 +2.50.0 diff --git a/0006-Skip-x86-tests-on-ARM.patch b/0006-Skip-x86-tests-on-ARM.patch new file mode 100644 index 0000000..e933ac9 --- /dev/null +++ b/0006-Skip-x86-tests-on-ARM.patch @@ -0,0 +1,44 @@ +From 342403c5c6e1d7d2a38c791c90c0937ecb5713d5 Mon Sep 17 00:00:00 2001 +From: Elliott Sales de Andrade +Date: Sat, 2 Aug 2025 18:30:43 -0400 +Subject: [PATCH 6/6] 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 62153c69..c1de9e72 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) + }) +@@ -891,7 +894,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/0006-builder-Fix-parsing-of-external-ld.lld-error-message.patch b/0006-builder-Fix-parsing-of-external-ld.lld-error-message.patch deleted file mode 100644 index c471e58..0000000 --- a/0006-builder-Fix-parsing-of-external-ld.lld-error-message.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 7c03dcc9f5b8e632f1d33dc4e09f74853c1951cc Mon Sep 17 00:00:00 2001 -From: Elliott Sales de Andrade -Date: Sun, 5 Jan 2025 02:20:33 -0500 -Subject: [PATCH 6/6] builder: Fix parsing of external ld.lld error messages - -If `ld.lld` is a version-specific binary (e.g., `ld.lld-18`), then its -error messages include the version. The parsing previously incorrectly -assumed it would be unversioned. - -Signed-off-by: Elliott Sales de Andrade ---- - builder/tools.go | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/builder/tools.go b/builder/tools.go -index b4087828..1c4214da 100644 ---- a/builder/tools.go -+++ b/builder/tools.go -@@ -98,8 +98,8 @@ func parseLLDErrors(text string) error { - - // Check for undefined symbols. - // This can happen in some cases like with CGo and //go:linkname tricker. -- if matches := regexp.MustCompile(`^ld.lld: error: undefined symbol: (.*)\n`).FindStringSubmatch(message); matches != nil { -- symbolName := matches[1] -+ if matches := regexp.MustCompile(`^ld.lld(-[0-9]+)?: error: undefined symbol: (.*)\n`).FindStringSubmatch(message); matches != nil { -+ symbolName := matches[2] - for _, line := range strings.Split(message, "\n") { - matches := regexp.MustCompile(`referenced by .* \(((.*):([0-9]+))\)`).FindStringSubmatch(line) - if matches != nil { -@@ -118,9 +118,9 @@ func parseLLDErrors(text string) error { - } - - // Check for flash/RAM overflow. -- if matches := regexp.MustCompile(`^ld.lld: error: section '(.*?)' will not fit in region '(.*?)': overflowed by ([0-9]+) bytes$`).FindStringSubmatch(message); matches != nil { -- region := matches[2] -- n, err := strconv.ParseUint(matches[3], 10, 64) -+ if matches := regexp.MustCompile(`^ld.lld(-[0-9]+)?: error: section '(.*?)' will not fit in region '(.*?)': overflowed by ([0-9]+) bytes$`).FindStringSubmatch(message); matches != nil { -+ region := matches[3] -+ n, err := strconv.ParseUint(matches[4], 10, 64) - if err != nil { - // Should not happen at all (unless it overflows an uint64 for some reason). - continue --- -2.47.0 - diff --git a/1b5d312c689a004434cb77f161f65b9615c98036.patch b/1b5d312c689a004434cb77f161f65b9615c98036.patch new file mode 100644 index 0000000..796bf7c --- /dev/null +++ b/1b5d312c689a004434cb77f161f65b9615c98036.patch @@ -0,0 +1,69 @@ +From 1b5d312c689a004434cb77f161f65b9615c98036 Mon Sep 17 00:00:00 2001 +From: Elias Naur +Date: Thu, 17 Jul 2025 12:58:43 +0200 +Subject: [PATCH] tests: de-flake goroutines test + +--- + main_test.go | 4 ++++ + testdata/goroutines.go | 4 ++++ + 2 files changed, 8 insertions(+) + +diff --git a/main_test.go b/main_test.go +index 5563b7cab2..b07d6aaaa4 100644 +--- a/main_test.go ++++ b/main_test.go +@@ -424,10 +424,12 @@ func optionsFromOSARCH(osarch string, sema chan struct{}) compileopts.Options { + } + + func runTest(name string, options compileopts.Options, t *testing.T, cmdArgs, environmentVars []string) { ++ t.Helper() + runTestWithConfig(name, t, options, cmdArgs, environmentVars) + } + + func runTestWithConfig(name string, t *testing.T, options compileopts.Options, cmdArgs, environmentVars []string) { ++ t.Helper() + // Get the expected output for this test. + // Note: not using filepath.Join as it strips the path separator at the end + // of the path. +@@ -876,6 +878,7 @@ func TestWasmExit(t *testing.T) { + + // Check whether the output of a test equals the expected output. + func checkOutput(t *testing.T, filename string, actual []byte) { ++ t.Helper() + expectedOutput, err := os.ReadFile(filename) + if err != nil { + t.Fatal("could not read output file:", err) +@@ -884,6 +887,7 @@ func checkOutput(t *testing.T, filename string, actual []byte) { + } + + func checkOutputData(t *testing.T, expectedOutput, actual []byte) { ++ t.Helper() + expectedOutput = bytes.ReplaceAll(expectedOutput, []byte("\r\n"), []byte("\n")) + actual = bytes.ReplaceAll(actual, []byte("\r\n"), []byte("\n")) + +diff --git a/testdata/goroutines.go b/testdata/goroutines.go +index 8653cdb173..7397b5503a 100644 +--- a/testdata/goroutines.go ++++ b/testdata/goroutines.go +@@ -175,10 +175,13 @@ func testGoOnBuiltins() { + + var once sync.Once + ++var waitChan = make(chan struct{}) ++ + func testGoOnInterface(f Itf) { + go f.Nowait() + time.Sleep(time.Millisecond) + go f.Wait() ++ <-waitChan + time.Sleep(time.Millisecond * 2) + println("done with 'go on interface'") + } +@@ -204,6 +207,7 @@ func (f Foo) Nowait() { + + func (f Foo) Wait() { + println("called: Foo.Wait") ++ close(waitChan) + time.Sleep(time.Microsecond) + println(" ...waited") + } diff --git a/clean_tarballs.sh b/clean_tarballs.sh index 6f47204..c3d5ac3 100755 --- a/clean_tarballs.sh +++ b/clean_tarballs.sh @@ -1,7 +1,7 @@ #!/bin/bash -e CMSIS_VERSION=9fe411cef1cef5de58e5957b89760759de44e393 -CMSIS_SVD_DATA_VERSION=40327a4d2dff0992682be2872aaa6e096f35d2f4 +CMSIS_SVD_DATA_VERSION=05a9562ec59b87945a8d7177a4b08b7aa2f2fd58 if [ -e "cmsis-${CMSIS_VERSION}-clean.tar.xz" ]; then echo "Not downloading cmsis-${CMSIS_VERSION}-clean.tar.xz again!" @@ -26,12 +26,14 @@ else # - 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 -# - SiFive-Community: ISC -# - STMicro: Proprietary, so not included. +# - 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 @@ -42,22 +44,24 @@ else # - GigaDevice: Apache-2.0 # - Holtek: Proprietary # - Infineon: Proprietary -# - Nordic: BSD-3-Clause # - Nuvoton: Unknown -# - Renesas: Proprietary # - 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/ + 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 b36c23c..b90c8c9 100644 --- a/sources +++ b/sources @@ -1,10 +1,11 @@ -SHA512 (tinygo-0.34.0.tar.gz) = 2c6c4b8b727540c6d83d6429125a8011cc049b9670e92e1fc31a4da74be4c078b19eec8f324b5dd7becb389ef15f613b619a29fa3b1ecc4208ddcb5d662708b5 +SHA512 (tinygo-0.38.0.tar.gz) = 1e7d64caa20c2a12390de36067b50f3cc3b675a3e4818d6fa463816c42cbd94101989863936f5ed38ce1224e99cdf69e3c251debcdb7c9f16daf42876fae2f9e SHA512 (avr-6624554c02b237b23dc17d53e992bf54033fc228.tar.gz) = 1aa157bd761db38f8680614fa1cf47d7009508f65291b7eaaa5aba1ae76d35103f68a42947b7269a170d2f1cf8fb09941a5d74070fe6d204b68dd15a9ad2ed29 +SHA512 (bdwgc-1166f11f7dee08d7ad369296b24cf8c9582f8789.tar.gz) = 030d5a9a0931915a76b1ec270e7208199cf40973ac6c8141c02e34f118f965bedcadff3bb36481b0e45703df8eb2750d20809f3fde367fd5efed5f8a44ccab32 SHA512 (cmsis-9fe411cef1cef5de58e5957b89760759de44e393-clean.tar.xz) = f131fc241f61982c49f334eb502c2f13da61eb7bdaa641ee84a8de30c4d576b735b8aadeafd7d75351473a2df6a42de6a236ecc5dcc616ee6cfcc07af29446f9 -SHA512 (cmsis_svd_data-40327a4d2dff0992682be2872aaa6e096f35d2f4-clean.tar.xz) = 851179df0f9fb86b6c8c340659568bd367ffd9ac801f0bbf1a0a10713599c6e78fb5d0cb27ac31c6ea5d8c4f71c52f925bdeef0d49a8a93c63b62ef555423718 +SHA512 (cmsis_svd_data-05a9562ec59b87945a8d7177a4b08b7aa2f2fd58-clean.tar.xz) = e8ba9d74fb148dfa8b3ba140d307b243fb38378f69544529455eea5df57d4276b7177d3549228f8acadc4e72c94506456e78025d9b16d606b322fda8ab38327d SHA512 (compiler-rt-18.1.8.src.tar.xz) = fb8795bd51c9b005c2ad1975591e9e2715740d6407ccad41379f136ef2e8d24ded8b97b01165a3ae4bd377119a6a1049ca05d3220404fc12bee86114ff2bff0d SHA512 (compiler-rt-18.1.8.src.tar.xz.sig) = 06d90afa46fb8c7ad6879564d1eb35e45711768593b580cf59e9908ed89efd459a312ae3c317c38119b0142ce0f96bcc0f8e6010ec8b31d9620c5e8f6d2f932e -SHA512 (macos-minimal-sdk-4e4113e3b1244b8fdc5e1486577f25e22d63f36e.tar.gz) = 10de6205ee6f7c6079e1120d4f42a72b984e1727a81a8f7fc9c9d4dd16e51c71291ab9d4fd88b36843b2b39a3c981fe4007b93ebaf920627f524417fbfdc823a +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 diff --git a/tinygo.spec b/tinygo.spec index 6b0d279..c5cceb5 100644 --- a/tinygo.spec +++ b/tinygo.spec @@ -8,14 +8,15 @@ # https://github.com/tinygo-org/tinygo %global goipath github.com/tinygo-org/tinygo -Version: 0.34.0 +Version: 0.38.0 %global CMSIS_commit 9fe411cef1cef5de58e5957b89760759de44e393 %global avr_commit 6624554c02b237b23dc17d53e992bf54033fc228 +%global bdwgc_commit 1166f11f7dee08d7ad369296b24cf8c9582f8789 %global clang_llvm_version 18 -%global cmsis_svd_data_commit 40327a4d2dff0992682be2872aaa6e096f35d2f4 +%global cmsis_svd_data_commit 05a9562ec59b87945a8d7177a4b08b7aa2f2fd58 %global compiler_rt_version %{clang_llvm_version}.1.8 -%global macos_minsdk_commit 4e4113e3b1244b8fdc5e1486577f25e22d63f36e +%global macos_minsdk_commit e7c72156eac3ebf29c34cc2faa71efcb1296663f %global mingw64_commit 8526cb618269440a94810b94b77f8bd48c5c3396 %global musl_version 1.2.3 %global net_commit c134160ae47d38b468b1c5ade43e78ad5a1e616d @@ -35,10 +36,6 @@ Version: 0.34.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 @@ -83,6 +80,12 @@ Source12: https://github.com/tinygo-org/net/archive/%{net_commit}/net-%{ne %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. Patch: 0001-Skip-WASI-tests.patch @@ -91,11 +94,18 @@ 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 # We can't include these due to poor licensing. +# https://github.com/tinygo-org/tinygo/pull/4962 Patch: 0004-Add-flag-to-skip-Renesas-SVD-builds.patch #https://github.com/tinygo-org/tinygo/pull/4677 Patch: 0005-Normalize-expected-path-for-chdir-tests.patch -# https://github.com/tinygo-org/tinygo/pull/4686 -Patch: 0006-builder-Fix-parsing-of-external-ld.lld-error-message.patch +# https://github.com/tinygo-org/tinygo/pull/4958 +Patch: https://github.com/tinygo-org/tinygo/commit/1b5d312c689a004434cb77f161f65b9615c98036.patch +# https://github.com/tinygo-org/tinygo/issues/4969 +Patch: 0006-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 @@ -115,11 +125,11 @@ 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.26 +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.21 +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 @@ -153,6 +163,8 @@ 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} @@ -161,24 +173,31 @@ 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-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}' @@ -186,77 +205,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_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 -# Fix permissions -# https://github.com/tinygo-org/tinygo/pull/4676 -chmod -x \ - src/internal/wasi/cli/v0.2.0/command/command.wit \ - src/internal/wasi/*/v0.2.0/*/*.wasm.go +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 RENESAS=0 STM32=0 -LLVM_AR=llvm-ar-%{clang_llvm_version} -if ! command -v $LLVM_AR 2>&1 >/dev/null -then -LLVM_AR=llvm-ar -fi -LLVM_NM=llvm-nm-%{clang_llvm_version} -if ! command -v $LLVM_NM 2>&1 >/dev/null -then -LLVM_NM=llvm-ar -fi -%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 @@ -264,14 +299,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 -install -vdm 0755 %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt/stdio -cp -rp lib/mingw-w64/mingw-w64-crt/stdio/ucrt_* %{buildroot}%{tinygoroot}/lib/mingw-w64/mingw-w64-crt/stdio +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 @@ -286,9 +331,12 @@ 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 @@ -297,30 +345,56 @@ 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 -install -vdm 0755 %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-bottom-half/headers -cp -rp lib/wasi-libc/libc-bottom-half/headers/public %{buildroot}%{tinygoroot}/lib/wasi-libc/libc-bottom-half/headers +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 @@ -365,6 +439,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 @@ -372,8 +448,6 @@ make tinygo-test %doc %{tinygoroot}/lib/nrfx/README.md %license %{tinygoroot}/lib/musl/COPYRIGHT -#gopkgfiles - %changelog %autochangelog From dc10663dd3fc5bbd9c8c9f741c954732531cf713 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Sun, 20 Jul 2025 04:15:17 -0400 Subject: [PATCH 13/18] Update build to use LLVM 19 --- sources | 4 ++-- tinygo.spec | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sources b/sources index b90c8c9..0a75777 100644 --- a/sources +++ b/sources @@ -3,8 +3,8 @@ SHA512 (avr-6624554c02b237b23dc17d53e992bf54033fc228.tar.gz) = 1aa157bd761db38f8 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-18.1.8.src.tar.xz) = fb8795bd51c9b005c2ad1975591e9e2715740d6407ccad41379f136ef2e8d24ded8b97b01165a3ae4bd377119a6a1049ca05d3220404fc12bee86114ff2bff0d -SHA512 (compiler-rt-18.1.8.src.tar.xz.sig) = 06d90afa46fb8c7ad6879564d1eb35e45711768593b580cf59e9908ed89efd459a312ae3c317c38119b0142ce0f96bcc0f8e6010ec8b31d9620c5e8f6d2f932e +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 diff --git a/tinygo.spec b/tinygo.spec index c5cceb5..6c0bd0c 100644 --- a/tinygo.spec +++ b/tinygo.spec @@ -13,9 +13,9 @@ Version: 0.38.0 %global CMSIS_commit 9fe411cef1cef5de58e5957b89760759de44e393 %global avr_commit 6624554c02b237b23dc17d53e992bf54033fc228 %global bdwgc_commit 1166f11f7dee08d7ad369296b24cf8c9582f8789 -%global clang_llvm_version 18 +%global clang_llvm_version 19 %global cmsis_svd_data_commit 05a9562ec59b87945a8d7177a4b08b7aa2f2fd58 -%global compiler_rt_version %{clang_llvm_version}.1.8 +%global compiler_rt_version %{clang_llvm_version}.1.7 %global macos_minsdk_commit e7c72156eac3ebf29c34cc2faa71efcb1296663f %global mingw64_commit 8526cb618269440a94810b94b77f8bd48c5c3396 %global musl_version 1.2.3 @@ -418,7 +418,7 @@ 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} From 8526125e83d305de378ed7a5778e5d4cfbc8ac26 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 8 Aug 2025 19:35:38 -0400 Subject: [PATCH 14/18] Backport support for Go 1.25 --- 4954.patch | 575 ++++++++++++++++++++++++++++++++++++++++++++++++++++ tinygo.spec | 2 + 2 files changed, 577 insertions(+) create mode 100644 4954.patch diff --git a/4954.patch b/4954.patch new file mode 100644 index 0000000..e1ea046 --- /dev/null +++ b/4954.patch @@ -0,0 +1,575 @@ +From 2c34e1bce5f75ba34a6ba11755801ff0b82fd638 Mon Sep 17 00:00:00 2001 +From: Ayke van Laethem +Date: Fri, 11 Jul 2025 09:21:09 +0200 +Subject: [PATCH 1/8] ci: rename some jobs to avoid churn on every Go/LLVM + version bump + +--- + .circleci/config.yml | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/.circleci/config.yml b/.circleci/config.yml +index 5a73dceae2..afa7a73001 100644 +--- a/.circleci/config.yml ++++ b/.circleci/config.yml +@@ -92,14 +92,18 @@ commands: + - /go/pkg/mod + + jobs: +- test-llvm15-go122: ++ test-oldest: ++ # This tests our lowest supported versions of Go and LLVM, to make sure at ++ # least the smoke tests still pass. + docker: + - image: golang:1.22-bullseye + steps: + - test-linux: + llvm: "15" + resource_class: large +- test-llvm20-go124: ++ test-newest: ++ # This tests the latest supported LLVM version when linking against system ++ # libraries. + docker: + - image: golang:1.24-bullseye + steps: +@@ -110,8 +114,5 @@ jobs: + workflows: + test-all: + jobs: +- # This tests our lowest supported versions of Go and LLVM, to make sure at +- # least the smoke tests still pass. +- - test-llvm15-go122 +- # This tests LLVM 20 support when linking against system libraries. +- - test-llvm20-go124 ++ - test-oldest ++ - test-newest + +From 527ebbe6f74eedfc764252740744bcaf0ee6826f Mon Sep 17 00:00:00 2001 +From: Ayke van Laethem +Date: Fri, 11 Jul 2025 15:45:42 +0200 +Subject: [PATCH 2/8] reflect: implement Method.IsExported + +--- + src/reflect/type.go | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/src/reflect/type.go b/src/reflect/type.go +index 828cf12e27..884f89dc84 100644 +--- a/src/reflect/type.go ++++ b/src/reflect/type.go +@@ -127,6 +127,11 @@ type Method struct { + Index int // index for Type.Method + } + ++// IsExported reports whether the method is exported. ++func (m Method) IsExported() bool { ++ return m.PkgPath == "" ++} ++ + // The following Type type has been copied almost entirely from + // https://github.com/golang/go/blob/go1.15/src/reflect/type.go#L27-L212. + // Some methods have been commented out as they haven't yet been implemented. + +From 63ff828af46555f98d3a7fb0bcd0c53891049835 Mon Sep 17 00:00:00 2001 +From: Ayke van Laethem +Date: Thu, 31 Jul 2025 13:44:13 +0200 +Subject: [PATCH 3/8] sync: implement sync.Swap + +--- + src/sync/map.go | 12 ++++++++++++ + src/sync/map_test.go | 19 +++++++++++++++++++ + 2 files changed, 31 insertions(+) + +diff --git a/src/sync/map.go b/src/sync/map.go +index cd8a1967d6..8b5c0cff76 100644 +--- a/src/sync/map.go ++++ b/src/sync/map.go +@@ -70,3 +70,15 @@ func (m *Map) Range(f func(key, value interface{}) bool) { + } + } + } ++ ++// Swap replaces the value for the given key, and returns the old value if any. ++func (m *Map) Swap(key, value any) (previous any, loaded bool) { ++ m.lock.Lock() ++ defer m.lock.Unlock() ++ if m.m == nil { ++ m.m = make(map[interface{}]interface{}) ++ } ++ previous, loaded = m.m[key] ++ m.m[key] = value ++ return ++} +diff --git a/src/sync/map_test.go b/src/sync/map_test.go +index f493bdfb51..a41faa40fd 100644 +--- a/src/sync/map_test.go ++++ b/src/sync/map_test.go +@@ -17,3 +17,22 @@ func TestMapLoadAndDelete(t *testing.T) { + t.Errorf("LoadAndDelete returned %v, %v, want nil, false", v, ok) + } + } ++ ++func TestMapSwap(t *testing.T) { ++ var sm sync.Map ++ sm.Store("present", "value") ++ ++ if v, ok := sm.Swap("present", "value2"); !ok || v != "value" { ++ t.Errorf("Swap returned %v, %v, want value, true", v, ok) ++ } ++ if v, ok := sm.Load("present"); !ok || v != "value2" { ++ t.Errorf("Load after Swap returned %v, %v, want value2, true", v, ok) ++ } ++ ++ if v, ok := sm.Swap("new", "foo"); ok || v != nil { ++ t.Errorf("Swap returned %v, %v, want nil, false", v, ok) ++ } ++ if v, ok := sm.Load("present"); !ok || v != "value2" { ++ t.Errorf("Load after Swap returned %v, %v, want foo, true", v, ok) ++ } ++} + +From 87bed715943b5a8a11aaa5c84e0f2dc8ac8046cf Mon Sep 17 00:00:00 2001 +From: Ayke van Laethem +Date: Thu, 31 Jul 2025 13:51:17 +0200 +Subject: [PATCH 4/8] runtime: implement dummy AddCleanup + +--- + src/runtime/runtime.go | 19 +++++++++++++++++++ + 1 file changed, 19 insertions(+) + +diff --git a/src/runtime/runtime.go b/src/runtime/runtime.go +index 6bd719f548..7ad482a055 100644 +--- a/src/runtime/runtime.go ++++ b/src/runtime/runtime.go +@@ -106,6 +106,25 @@ func UnlockOSThread() { + // point of the call. + func KeepAlive(x interface{}) + ++// AddCleanup is a dummy cleanup implementation. It doesn't do any cleaning up. ++// ++// We base this on the following loophole in the official runtime.AddCleanup ++// documentation: ++// ++// > The cleanup(arg) call is not always guaranteed to run; in particular it is ++// > not guaranteed to run before program exit. ++// ++// So it's technically correct (the best kind of correct) to not run any ++// cleanups. But of course, this can lead to resource leaks so cleanups may need ++// to be implemented eventually. ++func AddCleanup[T, S any](ptr *T, cleanup func(S), arg S) Cleanup { ++ return Cleanup{} ++} ++ ++type Cleanup struct{} ++ ++func (c Cleanup) Stop() {} ++ + var godebugUpdate func(string, string) + + //go:linkname godebug_setUpdate internal/godebug.setUpdate + +From dd10065061fb3e33bf0f006ef3b4fae53483c019 Mon Sep 17 00:00:00 2001 +From: Ayke van Laethem +Date: Mon, 4 Aug 2025 10:27:41 +0200 +Subject: [PATCH 5/8] compiler: implement internal/abi.Escape + +--- + compiler/intrinsics.go | 23 +++++++++++++++++++++++ + compiler/symbol.go | 17 +++++++++++++++++ + src/internal/abi/escape.go | 7 +++++++ + 3 files changed, 47 insertions(+) + +diff --git a/compiler/intrinsics.go b/compiler/intrinsics.go +index 3c7edd7c95..5f1ba6f7d1 100644 +--- a/compiler/intrinsics.go ++++ b/compiler/intrinsics.go +@@ -121,6 +121,29 @@ func (b *builder) createKeepAliveImpl() { + b.CreateRetVoid() + } + ++// createAbiEscapeImpl implements the generic internal/abi.Escape function. It ++// currently only supports pointer types. ++func (b *builder) createAbiEscapeImpl() { ++ b.createFunctionStart(true) ++ ++ // The first parameter is assumed to be a pointer. This is checked at the ++ // call site of createAbiEscapeImpl. ++ pointerValue := b.getValue(b.fn.Params[0], getPos(b.fn)) ++ ++ // Create an equivalent of the following C code, which is basically just a ++ // nop but ensures the pointerValue is kept alive: ++ // ++ // __asm__ __volatile__("" : : "r"(pointerValue)) ++ // ++ // It should be portable to basically everything as the "r" register type ++ // exists basically everywhere. ++ asmType := llvm.FunctionType(b.dataPtrType, []llvm.Type{b.dataPtrType}, false) ++ asmFn := llvm.InlineAsm(asmType, "", "=r,0", true, false, 0, false) ++ result := b.createCall(asmType, asmFn, []llvm.Value{pointerValue}, "") ++ ++ b.CreateRet(result) ++} ++ + var mathToLLVMMapping = map[string]string{ + "math.Ceil": "llvm.ceil.f64", + "math.Exp": "llvm.exp.f64", +diff --git a/compiler/symbol.go b/compiler/symbol.go +index c56e0792f2..2507b3eedb 100644 +--- a/compiler/symbol.go ++++ b/compiler/symbol.go +@@ -253,6 +253,23 @@ func (c *compilerContext) maybeCreateSyntheticFunction(fn *ssa.Function, llvmFn + // The exception is the package initializer, which does appear in the + // *ssa.Package members and so shouldn't be created here. + if fn.Synthetic != "" && fn.Synthetic != "package initializer" && fn.Synthetic != "generic function" && fn.Synthetic != "range-over-func yield" { ++ if origin := fn.Origin(); origin != nil && origin.RelString(nil) == "internal/abi.Escape" { ++ // This is a special implementation or internal/abi.Escape, which ++ // can only really be implemented in the compiler. ++ // For simplicity we'll only implement pointer parameters for now. ++ if _, ok := fn.Params[0].Type().Underlying().(*types.Pointer); ok { ++ irbuilder := c.ctx.NewBuilder() ++ defer irbuilder.Dispose() ++ b := newBuilder(c, irbuilder, fn) ++ b.createAbiEscapeImpl() ++ llvmFn.SetLinkage(llvm.LinkOnceODRLinkage) ++ llvmFn.SetUnnamedAddr(true) ++ } ++ // If the parameter is not of a pointer type, it will be left ++ // unimplemented. This will result in a linker error if the function ++ // is really called, making it clear it needs to be implemented. ++ return ++ } + if len(fn.Blocks) == 0 { + c.addError(fn.Pos(), "missing function body") + return +diff --git a/src/internal/abi/escape.go b/src/internal/abi/escape.go +index 0ecdf80308..1f4c763312 100644 +--- a/src/internal/abi/escape.go ++++ b/src/internal/abi/escape.go +@@ -8,3 +8,10 @@ import "unsafe" + func NoEscape(p unsafe.Pointer) unsafe.Pointer { + return p + } ++ ++func Escape[T any](x T) T { ++ // This function is either implemented in the compiler, or left undefined ++ // for some variation of T. The body of this function should not be compiled ++ // as-is. ++ panic("internal/abi.Escape: unreachable (implemented in the compiler)") ++} + +From 6ea7aa68492ee4de9b9aa4ce0faa8104a5b3f590 Mon Sep 17 00:00:00 2001 +From: Ayke van Laethem +Date: Mon, 4 Aug 2025 10:28:01 +0200 +Subject: [PATCH 6/8] testing: stub out testing.B.Loop + +This gets the path package tests to pass, so we can move ahead with Go +1.25. It should be implemented in the future at some point (that, or +we'll use the upstream testing package instead). +--- + src/testing/benchmark.go | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/testing/benchmark.go b/src/testing/benchmark.go +index 53c7fc7b10..2dc59b72fd 100644 +--- a/src/testing/benchmark.go ++++ b/src/testing/benchmark.go +@@ -500,6 +500,10 @@ func (b *B) RunParallel(body func(*PB)) { + return + } + ++func (b *B) Loop() bool { ++ panic("unimplemented: testing.B.Loop") ++} ++ + // Benchmark benchmarks a single function. It is useful for creating + // custom benchmarks that do not use the "go test" command. + // + +From fc6d509c4235a980f0ef40cd30f207e9a1a697d0 Mon Sep 17 00:00:00 2001 +From: Ayke van Laethem +Date: Mon, 4 Aug 2025 10:31:48 +0200 +Subject: [PATCH 7/8] runtime: stub out weak pointer support + +--- + src/runtime/runtime.go | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/runtime/runtime.go b/src/runtime/runtime.go +index 7ad482a055..3bd98319e8 100644 +--- a/src/runtime/runtime.go ++++ b/src/runtime/runtime.go +@@ -125,6 +125,14 @@ type Cleanup struct{} + + func (c Cleanup) Stop() {} + ++//go:linkname registerWeakPointer weak.runtime_registerWeakPointer ++func registerWeakPointer(ptr unsafe.Pointer) unsafe.Pointer { ++ // TODO: unimplemented. ++ // I hope not implementing this won't break anything, like packages that ++ // expect weak pointers to be GC'd before they actually are. ++ return ptr ++} ++ + var godebugUpdate func(string, string) + + //go:linkname godebug_setUpdate internal/godebug.setUpdate + +From aae706cae0aec334d4a44ccb760caf9a1d422677 Mon Sep 17 00:00:00 2001 +From: Ayke van Laethem +Date: Fri, 11 Jul 2025 09:34:44 +0200 +Subject: [PATCH 8/8] all: add Go 1.25 support + +--- + .circleci/config.yml | 2 +- + .github/workflows/build-macos.yml | 4 ++-- + .github/workflows/linux.yml | 8 ++++---- + .github/workflows/windows.yml | 8 ++++---- + Dockerfile | 4 ++-- + GNUmakefile | 22 +++++++++++++--------- + builder/config.go | 2 +- + src/crypto/x509/internal/macos/macos.go | 4 ++++ + src/runtime/time.go | 6 ++++++ + 9 files changed, 37 insertions(+), 23 deletions(-) + +diff --git a/.circleci/config.yml b/.circleci/config.yml +index afa7a73001..68a013a253 100644 +--- a/.circleci/config.yml ++++ b/.circleci/config.yml +@@ -105,7 +105,7 @@ jobs: + # This tests the latest supported LLVM version when linking against system + # libraries. + docker: +- - image: golang:1.24-bullseye ++ - image: golang:1.25rc2-bullseye + steps: + - test-linux: + llvm: "20" +diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml +index bda9474327..564978c821 100644 +--- a/.github/workflows/build-macos.yml ++++ b/.github/workflows/build-macos.yml +@@ -39,7 +39,7 @@ jobs: + - name: Install Go + uses: actions/setup-go@v5 + with: +- go-version: '1.24' ++ go-version: '1.25.0-rc.2' + cache: true + - name: Restore LLVM source cache + uses: actions/cache/restore@v4 +@@ -134,7 +134,7 @@ jobs: + - name: Install Go + uses: actions/setup-go@v5 + with: +- go-version: '1.24' ++ go-version: '1.25.0-rc.2' + cache: true + - name: Build TinyGo (LLVM ${{ matrix.version }}) + run: go install -tags=llvm${{ matrix.version }} +diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml +index 803759892f..52e49eaff2 100644 +--- a/.github/workflows/linux.yml ++++ b/.github/workflows/linux.yml +@@ -18,7 +18,7 @@ jobs: + # statically linked binary. + runs-on: ubuntu-latest + container: +- image: golang:1.24-alpine ++ image: golang:1.25rc2-alpine + outputs: + version: ${{ steps.version.outputs.version }} + steps: +@@ -137,7 +137,7 @@ jobs: + - name: Install Go + uses: actions/setup-go@v5 + with: +- go-version: '1.24' ++ go-version: '1.25.0-rc.2' + cache: true + - name: Install wasmtime + uses: bytecodealliance/actions/wasmtime/setup@v1 +@@ -181,7 +181,7 @@ jobs: + - name: Install Go + uses: actions/setup-go@v5 + with: +- go-version: '1.24' ++ go-version: '1.25.0-rc.2' + cache: true + - name: Install Node.js + uses: actions/setup-node@v4 +@@ -298,7 +298,7 @@ jobs: + - name: Install Go + uses: actions/setup-go@v5 + with: +- go-version: '1.24' ++ go-version: '1.25.0-rc.2' + cache: true + - name: Restore LLVM source cache + uses: actions/cache/restore@v4 +diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml +index 6c428c98c4..ee7fbf1adb 100644 +--- a/.github/workflows/windows.yml ++++ b/.github/workflows/windows.yml +@@ -41,7 +41,7 @@ jobs: + - name: Install Go + uses: actions/setup-go@v5 + with: +- go-version: '1.24' ++ go-version: '1.25.0-rc.2' + cache: true + - name: Restore cached LLVM source + uses: actions/cache/restore@v4 +@@ -147,7 +147,7 @@ jobs: + - name: Install Go + uses: actions/setup-go@v5 + with: +- go-version: '1.24' ++ go-version: '1.25.0-rc.2' + cache: true + - name: Download TinyGo build + uses: actions/download-artifact@v4 +@@ -177,7 +177,7 @@ jobs: + - name: Install Go + uses: actions/setup-go@v5 + with: +- go-version: '1.24' ++ go-version: '1.25.0-rc.2' + cache: true + - name: Download TinyGo build + uses: actions/download-artifact@v4 +@@ -213,7 +213,7 @@ jobs: + - name: Install Go + uses: actions/setup-go@v5 + with: +- go-version: '1.24' ++ go-version: '1.25.0-rc.2' + cache: true + - name: Download TinyGo build + uses: actions/download-artifact@v4 +diff --git a/Dockerfile b/Dockerfile +index 520ad7c9b5..c45dd5d777 100644 +--- a/Dockerfile ++++ b/Dockerfile +@@ -1,5 +1,5 @@ + # tinygo-llvm stage obtains the llvm source for TinyGo +-FROM golang:1.24 AS tinygo-llvm ++FROM golang:1.25rc2 AS tinygo-llvm + + RUN apt-get update && \ + apt-get install -y apt-utils make cmake clang-15 ninja-build && \ +@@ -33,7 +33,7 @@ RUN cd /tinygo/ && \ + + # tinygo-compiler copies the compiler build over to a base Go container (without + # all the build tools etc). +-FROM golang:1.24 AS tinygo-compiler ++FROM golang:1.25rc2 AS tinygo-compiler + + # Copy tinygo build. + COPY --from=tinygo-compiler-build /tinygo/build/release/tinygo /tinygo +diff --git a/GNUmakefile b/GNUmakefile +index 2b14dd6ac0..61174600eb 100644 +--- a/GNUmakefile ++++ b/GNUmakefile +@@ -460,11 +460,15 @@ TEST_PACKAGES_HOST := $(TEST_PACKAGES_FAST) $(TEST_PACKAGES_WINDOWS) + TEST_IOFS := false + endif + ++TEST_SKIP_FLAG := -skip='TestExtraMethods|TestParseAndBytesRoundTrip/P256/Generic' ++ + # Test known-working standard library packages. + # TODO: parallelize, and only show failing tests (no implied -v flag). + .PHONY: tinygo-test + tinygo-test: +- $(TINYGO) test $(TEST_PACKAGES_HOST) $(TEST_PACKAGES_SLOW) ++ @# TestExtraMethods: used by many crypto packages and uses reflect.Type.Method which is not implemented. ++ @# TestParseAndBytesRoundTrip/P256/Generic: relies on t.Skip() which is not implemented ++ $(TINYGO) test $(TEST_SKIP_FLAG) $(TEST_PACKAGES_HOST) $(TEST_PACKAGES_SLOW) + @# io/fs requires os.ReadDir, not yet supported on windows or wasi. It also + @# requires a large stack-size. Hence, io/fs is only run conditionally. + @# For more details, see the comments on issue #3143. +@@ -472,7 +476,7 @@ ifeq ($(TEST_IOFS),true) + $(TINYGO) test -stack-size=6MB io/fs + endif + tinygo-test-fast: +- $(TINYGO) test $(TEST_PACKAGES_HOST) ++ $(TINYGO) test $(TEST_SKIP_FLAG) $(TEST_PACKAGES_HOST) + tinygo-bench: + $(TINYGO) test -bench . $(TEST_PACKAGES_HOST) $(TEST_PACKAGES_SLOW) + tinygo-bench-fast: +@@ -480,18 +484,18 @@ tinygo-bench-fast: + + # Same thing, except for wasi rather than the current platform. + tinygo-test-wasm: +- $(TINYGO) test -target wasm $(TEST_PACKAGES_WASM) ++ $(TINYGO) test -target wasm $(TEST_SKIP_FLAG) $(TEST_PACKAGES_WASM) + tinygo-test-wasi: +- $(TINYGO) test -target wasip1 $(TEST_PACKAGES_FAST) $(TEST_PACKAGES_SLOW) ./tests/runtime_wasi ++ $(TINYGO) test -target wasip1 $(TEST_SKIP_FLAG) $(TEST_PACKAGES_FAST) $(TEST_PACKAGES_SLOW) ./tests/runtime_wasi + tinygo-test-wasip1: +- GOOS=wasip1 GOARCH=wasm $(TINYGO) test $(TEST_PACKAGES_FAST) $(TEST_PACKAGES_SLOW) ./tests/runtime_wasi ++ GOOS=wasip1 GOARCH=wasm $(TINYGO) test $(TEST_SKIP_FLAG) $(TEST_PACKAGES_FAST) $(TEST_PACKAGES_SLOW) ./tests/runtime_wasi + tinygo-test-wasip1-fast: +- $(TINYGO) test -target=wasip1 $(TEST_PACKAGES_FAST) ./tests/runtime_wasi ++ $(TINYGO) test -target=wasip1 $(TEST_SKIP_FLAG) $(TEST_PACKAGES_FAST) ./tests/runtime_wasi + + tinygo-test-wasip2-slow: +- $(TINYGO) test -target=wasip2 $(TEST_PACKAGES_SLOW) ++ $(TINYGO) test -target=wasip2 $(TEST_SKIP_FLAG) $(TEST_PACKAGES_SLOW) + tinygo-test-wasip2-fast: +- $(TINYGO) test -target=wasip2 $(TEST_PACKAGES_FAST) ./tests/runtime_wasi ++ $(TINYGO) test -target=wasip2 $(TEST_SKIP_FLAG) $(TEST_PACKAGES_FAST) ./tests/runtime_wasi + + tinygo-test-wasip2-sum-slow: + TINYGO=$(TINYGO) \ +@@ -517,7 +521,7 @@ tinygo-bench-wasip2-fast: + + # Run tests on riscv-qemu since that one provides a large amount of memory. + tinygo-test-baremetal: +- $(TINYGO) test -target riscv-qemu $(TEST_PACKAGES_BAREMETAL) ++ $(TINYGO) test -target riscv-qemu $(TEST_SKIP_FLAG) $(TEST_PACKAGES_BAREMETAL) + + # Test external packages in a large corpus. + test-corpus: +diff --git a/builder/config.go b/builder/config.go +index b36b9333f3..5fb74ee192 100644 +--- a/builder/config.go ++++ b/builder/config.go +@@ -26,7 +26,7 @@ func NewConfig(options *compileopts.Options) (*compileopts.Config, error) { + + // Version range supported by TinyGo. + const minorMin = 19 +- const minorMax = 24 ++ const minorMax = 25 + + // Check that we support this Go toolchain version. + gorootMajor, gorootMinor, err := goenv.GetGorootVersion() +diff --git a/src/crypto/x509/internal/macos/macos.go b/src/crypto/x509/internal/macos/macos.go +index e9ec2ef843..c662acb577 100644 +--- a/src/crypto/x509/internal/macos/macos.go ++++ b/src/crypto/x509/internal/macos/macos.go +@@ -63,6 +63,10 @@ func SecCertificateCopyData(cert CFRef) ([]byte, error) { + return nil, errors.New("not implemented") + } + ++func SecTrustCopyCertificateChain(trustObj CFRef) (CFRef, error) { ++ return 0, errors.New("not implemented") ++} ++ + func SecTrustEvaluateWithError(trustObj CFRef) (int, error) { + return 0, errors.New("not implemented") + } +diff --git a/src/runtime/time.go b/src/runtime/time.go +index 3935b4486e..23a9bf5e2f 100644 +--- a/src/runtime/time.go ++++ b/src/runtime/time.go +@@ -46,3 +46,9 @@ func timerCallback(tn *timerNode, delta int64) { + addTimer(tn) + } + } ++ ++//go:linkname time_runtimeIsBubbled time.runtimeIsBubbled ++func time_runtimeIsBubbled() bool { ++ // We don't currently support bubbles. ++ return false ++} diff --git a/tinygo.spec b/tinygo.spec index 6c0bd0c..2e9fe62 100644 --- a/tinygo.spec +++ b/tinygo.spec @@ -102,6 +102,8 @@ Patch: 0005-Normalize-expected-path-for-chdir-tests.patch Patch: https://github.com/tinygo-org/tinygo/commit/1b5d312c689a004434cb77f161f65b9615c98036.patch # https://github.com/tinygo-org/tinygo/issues/4969 Patch: 0006-Skip-x86-tests-on-ARM.patch +# Support for Go 1.25. +Patch: https://github.com/tinygo-org/tinygo/pull/4954.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 From 1ba82360fbbef4718c4f37056a19efe9b24cf0c2 Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Fri, 15 Aug 2025 18:42:25 -0500 Subject: [PATCH 15/18] Rebuild for golang-1.25.0 From 20e209e6d0474503bf575c1bd1e2e86c4b372299 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 25 Aug 2025 03:25:16 -0400 Subject: [PATCH 16/18] Update to latest version (#2389619) --- 0001-Skip-WASI-tests.patch | 8 +- ...ip-tests-that-require-Go-module-mode.patch | 8 +- 0003-Set-LLVM-search-paths-for-Fedora.patch | 4 +- ...-Add-flag-to-skip-Renesas-SVD-builds.patch | 29 - ...malize-expected-path-for-chdir-tests.patch | 4 +- ....patch => 0005-Skip-x86-tests-on-ARM.patch | 8 +- ...312c689a004434cb77f161f65b9615c98036.patch | 69 --- 4954.patch | 575 ------------------ sources | 2 +- tinygo.spec | 13 +- 10 files changed, 20 insertions(+), 700 deletions(-) delete mode 100644 0004-Add-flag-to-skip-Renesas-SVD-builds.patch rename 0005-Normalize-expected-path-for-chdir-tests.patch => 0004-Normalize-expected-path-for-chdir-tests.patch (88%) rename 0006-Skip-x86-tests-on-ARM.patch => 0005-Skip-x86-tests-on-ARM.patch (89%) delete mode 100644 1b5d312c689a004434cb77f161f65b9615c98036.patch delete mode 100644 4954.patch diff --git a/0001-Skip-WASI-tests.patch b/0001-Skip-WASI-tests.patch index 8a26135..32e8ce8 100644 --- a/0001-Skip-WASI-tests.patch +++ b/0001-Skip-WASI-tests.patch @@ -1,7 +1,7 @@ -From cedd957d01a235fa05957242ea5c291b0fbc2e3d 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/6] Skip WASI tests. +Subject: [PATCH 1/5] Skip WASI tests. We do not have wasmtime available. @@ -11,7 +11,7 @@ Signed-off-by: Elliott Sales de Andrade 1 file changed, 17 deletions(-) diff --git a/main_test.go b/main_test.go -index 5563b7ca..77b93c4d 100644 +index b07d6aaa..ae0a4482 100644 --- a/main_test.go +++ b/main_test.go @@ -188,22 +188,6 @@ func TestBuild(t *testing.T) { @@ -37,7 +37,7 @@ index 5563b7ca..77b93c4d 100644 } if runtime.GOOS == "linux" { -@@ -921,7 +905,6 @@ func TestTest(t *testing.T) { +@@ -925,7 +909,6 @@ func TestTest(t *testing.T) { // Node/Wasmtime targ{"WASM", optionsFromTarget("wasm", sema)}, diff --git a/0002-Skip-tests-that-require-Go-module-mode.patch b/0002-Skip-tests-that-require-Go-module-mode.patch index a4df02a..01dc83c 100644 --- a/0002-Skip-tests-that-require-Go-module-mode.patch +++ b/0002-Skip-tests-that-require-Go-module-mode.patch @@ -1,7 +1,7 @@ -From e3af7cfc28d948721d94cf6eafedf731453c50b5 Mon Sep 17 00:00:00 2001 +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/6] Skip tests that require Go module mode +Subject: [PATCH 2/5] Skip tests that require Go module mode Signed-off-by: Elliott Sales de Andrade --- @@ -24,7 +24,7 @@ index 871dc4c0..3d0bb162 100644 {name: "syntax"}, {name: "types"}, diff --git a/main_test.go b/main_test.go -index 77b93c4d..62153c69 100644 +index ae0a4482..ca052821 100644 --- a/main_test.go +++ b/main_test.go @@ -78,7 +78,6 @@ func TestBuild(t *testing.T) { @@ -35,7 +35,7 @@ index 77b93c4d..62153c69 100644 "print.go", "reflect.go", "signal.go", -@@ -1027,6 +1026,7 @@ func ioLogger(t *testing.T, wg *sync.WaitGroup) io.WriteCloser { +@@ -1031,6 +1030,7 @@ func ioLogger(t *testing.T, wg *sync.WaitGroup) io.WriteCloser { } func TestGetListOfPackages(t *testing.T) { diff --git a/0003-Set-LLVM-search-paths-for-Fedora.patch b/0003-Set-LLVM-search-paths-for-Fedora.patch index 513149c..d375623 100644 --- a/0003-Set-LLVM-search-paths-for-Fedora.patch +++ b/0003-Set-LLVM-search-paths-for-Fedora.patch @@ -1,7 +1,7 @@ -From 18c5c78780371a39e79b983f8c3c71b24f5663d1 Mon Sep 17 00:00:00 2001 +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/6] Set LLVM search paths for Fedora +Subject: [PATCH 3/5] Set LLVM search paths for Fedora Signed-off-by: Elliott Sales de Andrade --- diff --git a/0004-Add-flag-to-skip-Renesas-SVD-builds.patch b/0004-Add-flag-to-skip-Renesas-SVD-builds.patch deleted file mode 100644 index 4af0f29..0000000 --- a/0004-Add-flag-to-skip-Renesas-SVD-builds.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 4a6bd01a01e551ea3ba0c5128628eea2714ba122 Mon Sep 17 00:00:00 2001 -From: Elliott Sales de Andrade -Date: Tue, 31 Dec 2024 00:34:13 -0500 -Subject: [PATCH 4/6] Add flag to skip Renesas SVD builds - -Signed-off-by: Elliott Sales de Andrade ---- - GNUmakefile | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/GNUmakefile b/GNUmakefile -index f078bde5..321444da 100644 ---- a/GNUmakefile -+++ b/GNUmakefile -@@ -187,7 +187,10 @@ fmt-check: ## Warn if any source needs reformatting - @unformatted=$$(gofmt -l $(FMT_PATHS)); [ -z "$$unformatted" ] && exit 0; echo "Unformatted:"; for fn in $$unformatted; do echo " $$fn"; done; exit 1 - - --gen-device: gen-device-avr gen-device-esp gen-device-nrf gen-device-sam gen-device-sifive gen-device-kendryte gen-device-nxp gen-device-rp gen-device-renesas ## Generate microcontroller-specific sources -+gen-device: gen-device-avr gen-device-esp gen-device-nrf gen-device-sam gen-device-sifive gen-device-kendryte gen-device-nxp gen-device-rp ## Generate microcontroller-specific sources -+ifneq ($(RENESAS), 0) -+gen-device: gen-device-renesas -+endif - ifneq ($(STM32), 0) - gen-device: gen-device-stm32 - endif --- -2.50.0 - diff --git a/0005-Normalize-expected-path-for-chdir-tests.patch b/0004-Normalize-expected-path-for-chdir-tests.patch similarity index 88% rename from 0005-Normalize-expected-path-for-chdir-tests.patch rename to 0004-Normalize-expected-path-for-chdir-tests.patch index 2869273..0285c03 100644 --- a/0005-Normalize-expected-path-for-chdir-tests.patch +++ b/0004-Normalize-expected-path-for-chdir-tests.patch @@ -1,7 +1,7 @@ -From cef23b5da7902eaf69cc621ad384ea7815082e86 Mon Sep 17 00:00:00 2001 +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 5/6] Normalize expected path for chdir tests +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 diff --git a/0006-Skip-x86-tests-on-ARM.patch b/0005-Skip-x86-tests-on-ARM.patch similarity index 89% rename from 0006-Skip-x86-tests-on-ARM.patch rename to 0005-Skip-x86-tests-on-ARM.patch index e933ac9..aab0e48 100644 --- a/0006-Skip-x86-tests-on-ARM.patch +++ b/0005-Skip-x86-tests-on-ARM.patch @@ -1,7 +1,7 @@ -From 342403c5c6e1d7d2a38c791c90c0937ecb5713d5 Mon Sep 17 00:00:00 2001 +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 6/6] Skip x86 tests on ARM +Subject: [PATCH 5/5] Skip x86 tests on ARM They are currently broken: https://github.com/tinygo-org/tinygo/issues/4969 @@ -12,7 +12,7 @@ Signed-off-by: Elliott Sales de Andrade 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main_test.go b/main_test.go -index 62153c69..c1de9e72 100644 +index ca052821..13a40997 100644 --- a/main_test.go +++ b/main_test.go @@ -192,7 +192,10 @@ func TestBuild(t *testing.T) { @@ -27,7 +27,7 @@ index 62153c69..c1de9e72 100644 t.Run(name, func(t *testing.T) { runPlatTests(options, tests, t) }) -@@ -891,7 +894,10 @@ func TestTest(t *testing.T) { +@@ -895,7 +898,10 @@ func TestTest(t *testing.T) { if runtime.GOOS == "linux" { for name, osArch := range supportedLinuxArches { options := optionsFromOSARCH(osArch, sema) diff --git a/1b5d312c689a004434cb77f161f65b9615c98036.patch b/1b5d312c689a004434cb77f161f65b9615c98036.patch deleted file mode 100644 index 796bf7c..0000000 --- a/1b5d312c689a004434cb77f161f65b9615c98036.patch +++ /dev/null @@ -1,69 +0,0 @@ -From 1b5d312c689a004434cb77f161f65b9615c98036 Mon Sep 17 00:00:00 2001 -From: Elias Naur -Date: Thu, 17 Jul 2025 12:58:43 +0200 -Subject: [PATCH] tests: de-flake goroutines test - ---- - main_test.go | 4 ++++ - testdata/goroutines.go | 4 ++++ - 2 files changed, 8 insertions(+) - -diff --git a/main_test.go b/main_test.go -index 5563b7cab2..b07d6aaaa4 100644 ---- a/main_test.go -+++ b/main_test.go -@@ -424,10 +424,12 @@ func optionsFromOSARCH(osarch string, sema chan struct{}) compileopts.Options { - } - - func runTest(name string, options compileopts.Options, t *testing.T, cmdArgs, environmentVars []string) { -+ t.Helper() - runTestWithConfig(name, t, options, cmdArgs, environmentVars) - } - - func runTestWithConfig(name string, t *testing.T, options compileopts.Options, cmdArgs, environmentVars []string) { -+ t.Helper() - // Get the expected output for this test. - // Note: not using filepath.Join as it strips the path separator at the end - // of the path. -@@ -876,6 +878,7 @@ func TestWasmExit(t *testing.T) { - - // Check whether the output of a test equals the expected output. - func checkOutput(t *testing.T, filename string, actual []byte) { -+ t.Helper() - expectedOutput, err := os.ReadFile(filename) - if err != nil { - t.Fatal("could not read output file:", err) -@@ -884,6 +887,7 @@ func checkOutput(t *testing.T, filename string, actual []byte) { - } - - func checkOutputData(t *testing.T, expectedOutput, actual []byte) { -+ t.Helper() - expectedOutput = bytes.ReplaceAll(expectedOutput, []byte("\r\n"), []byte("\n")) - actual = bytes.ReplaceAll(actual, []byte("\r\n"), []byte("\n")) - -diff --git a/testdata/goroutines.go b/testdata/goroutines.go -index 8653cdb173..7397b5503a 100644 ---- a/testdata/goroutines.go -+++ b/testdata/goroutines.go -@@ -175,10 +175,13 @@ func testGoOnBuiltins() { - - var once sync.Once - -+var waitChan = make(chan struct{}) -+ - func testGoOnInterface(f Itf) { - go f.Nowait() - time.Sleep(time.Millisecond) - go f.Wait() -+ <-waitChan - time.Sleep(time.Millisecond * 2) - println("done with 'go on interface'") - } -@@ -204,6 +207,7 @@ func (f Foo) Nowait() { - - func (f Foo) Wait() { - println("called: Foo.Wait") -+ close(waitChan) - time.Sleep(time.Microsecond) - println(" ...waited") - } diff --git a/4954.patch b/4954.patch deleted file mode 100644 index e1ea046..0000000 --- a/4954.patch +++ /dev/null @@ -1,575 +0,0 @@ -From 2c34e1bce5f75ba34a6ba11755801ff0b82fd638 Mon Sep 17 00:00:00 2001 -From: Ayke van Laethem -Date: Fri, 11 Jul 2025 09:21:09 +0200 -Subject: [PATCH 1/8] ci: rename some jobs to avoid churn on every Go/LLVM - version bump - ---- - .circleci/config.yml | 15 ++++++++------- - 1 file changed, 8 insertions(+), 7 deletions(-) - -diff --git a/.circleci/config.yml b/.circleci/config.yml -index 5a73dceae2..afa7a73001 100644 ---- a/.circleci/config.yml -+++ b/.circleci/config.yml -@@ -92,14 +92,18 @@ commands: - - /go/pkg/mod - - jobs: -- test-llvm15-go122: -+ test-oldest: -+ # This tests our lowest supported versions of Go and LLVM, to make sure at -+ # least the smoke tests still pass. - docker: - - image: golang:1.22-bullseye - steps: - - test-linux: - llvm: "15" - resource_class: large -- test-llvm20-go124: -+ test-newest: -+ # This tests the latest supported LLVM version when linking against system -+ # libraries. - docker: - - image: golang:1.24-bullseye - steps: -@@ -110,8 +114,5 @@ jobs: - workflows: - test-all: - jobs: -- # This tests our lowest supported versions of Go and LLVM, to make sure at -- # least the smoke tests still pass. -- - test-llvm15-go122 -- # This tests LLVM 20 support when linking against system libraries. -- - test-llvm20-go124 -+ - test-oldest -+ - test-newest - -From 527ebbe6f74eedfc764252740744bcaf0ee6826f Mon Sep 17 00:00:00 2001 -From: Ayke van Laethem -Date: Fri, 11 Jul 2025 15:45:42 +0200 -Subject: [PATCH 2/8] reflect: implement Method.IsExported - ---- - src/reflect/type.go | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/src/reflect/type.go b/src/reflect/type.go -index 828cf12e27..884f89dc84 100644 ---- a/src/reflect/type.go -+++ b/src/reflect/type.go -@@ -127,6 +127,11 @@ type Method struct { - Index int // index for Type.Method - } - -+// IsExported reports whether the method is exported. -+func (m Method) IsExported() bool { -+ return m.PkgPath == "" -+} -+ - // The following Type type has been copied almost entirely from - // https://github.com/golang/go/blob/go1.15/src/reflect/type.go#L27-L212. - // Some methods have been commented out as they haven't yet been implemented. - -From 63ff828af46555f98d3a7fb0bcd0c53891049835 Mon Sep 17 00:00:00 2001 -From: Ayke van Laethem -Date: Thu, 31 Jul 2025 13:44:13 +0200 -Subject: [PATCH 3/8] sync: implement sync.Swap - ---- - src/sync/map.go | 12 ++++++++++++ - src/sync/map_test.go | 19 +++++++++++++++++++ - 2 files changed, 31 insertions(+) - -diff --git a/src/sync/map.go b/src/sync/map.go -index cd8a1967d6..8b5c0cff76 100644 ---- a/src/sync/map.go -+++ b/src/sync/map.go -@@ -70,3 +70,15 @@ func (m *Map) Range(f func(key, value interface{}) bool) { - } - } - } -+ -+// Swap replaces the value for the given key, and returns the old value if any. -+func (m *Map) Swap(key, value any) (previous any, loaded bool) { -+ m.lock.Lock() -+ defer m.lock.Unlock() -+ if m.m == nil { -+ m.m = make(map[interface{}]interface{}) -+ } -+ previous, loaded = m.m[key] -+ m.m[key] = value -+ return -+} -diff --git a/src/sync/map_test.go b/src/sync/map_test.go -index f493bdfb51..a41faa40fd 100644 ---- a/src/sync/map_test.go -+++ b/src/sync/map_test.go -@@ -17,3 +17,22 @@ func TestMapLoadAndDelete(t *testing.T) { - t.Errorf("LoadAndDelete returned %v, %v, want nil, false", v, ok) - } - } -+ -+func TestMapSwap(t *testing.T) { -+ var sm sync.Map -+ sm.Store("present", "value") -+ -+ if v, ok := sm.Swap("present", "value2"); !ok || v != "value" { -+ t.Errorf("Swap returned %v, %v, want value, true", v, ok) -+ } -+ if v, ok := sm.Load("present"); !ok || v != "value2" { -+ t.Errorf("Load after Swap returned %v, %v, want value2, true", v, ok) -+ } -+ -+ if v, ok := sm.Swap("new", "foo"); ok || v != nil { -+ t.Errorf("Swap returned %v, %v, want nil, false", v, ok) -+ } -+ if v, ok := sm.Load("present"); !ok || v != "value2" { -+ t.Errorf("Load after Swap returned %v, %v, want foo, true", v, ok) -+ } -+} - -From 87bed715943b5a8a11aaa5c84e0f2dc8ac8046cf Mon Sep 17 00:00:00 2001 -From: Ayke van Laethem -Date: Thu, 31 Jul 2025 13:51:17 +0200 -Subject: [PATCH 4/8] runtime: implement dummy AddCleanup - ---- - src/runtime/runtime.go | 19 +++++++++++++++++++ - 1 file changed, 19 insertions(+) - -diff --git a/src/runtime/runtime.go b/src/runtime/runtime.go -index 6bd719f548..7ad482a055 100644 ---- a/src/runtime/runtime.go -+++ b/src/runtime/runtime.go -@@ -106,6 +106,25 @@ func UnlockOSThread() { - // point of the call. - func KeepAlive(x interface{}) - -+// AddCleanup is a dummy cleanup implementation. It doesn't do any cleaning up. -+// -+// We base this on the following loophole in the official runtime.AddCleanup -+// documentation: -+// -+// > The cleanup(arg) call is not always guaranteed to run; in particular it is -+// > not guaranteed to run before program exit. -+// -+// So it's technically correct (the best kind of correct) to not run any -+// cleanups. But of course, this can lead to resource leaks so cleanups may need -+// to be implemented eventually. -+func AddCleanup[T, S any](ptr *T, cleanup func(S), arg S) Cleanup { -+ return Cleanup{} -+} -+ -+type Cleanup struct{} -+ -+func (c Cleanup) Stop() {} -+ - var godebugUpdate func(string, string) - - //go:linkname godebug_setUpdate internal/godebug.setUpdate - -From dd10065061fb3e33bf0f006ef3b4fae53483c019 Mon Sep 17 00:00:00 2001 -From: Ayke van Laethem -Date: Mon, 4 Aug 2025 10:27:41 +0200 -Subject: [PATCH 5/8] compiler: implement internal/abi.Escape - ---- - compiler/intrinsics.go | 23 +++++++++++++++++++++++ - compiler/symbol.go | 17 +++++++++++++++++ - src/internal/abi/escape.go | 7 +++++++ - 3 files changed, 47 insertions(+) - -diff --git a/compiler/intrinsics.go b/compiler/intrinsics.go -index 3c7edd7c95..5f1ba6f7d1 100644 ---- a/compiler/intrinsics.go -+++ b/compiler/intrinsics.go -@@ -121,6 +121,29 @@ func (b *builder) createKeepAliveImpl() { - b.CreateRetVoid() - } - -+// createAbiEscapeImpl implements the generic internal/abi.Escape function. It -+// currently only supports pointer types. -+func (b *builder) createAbiEscapeImpl() { -+ b.createFunctionStart(true) -+ -+ // The first parameter is assumed to be a pointer. This is checked at the -+ // call site of createAbiEscapeImpl. -+ pointerValue := b.getValue(b.fn.Params[0], getPos(b.fn)) -+ -+ // Create an equivalent of the following C code, which is basically just a -+ // nop but ensures the pointerValue is kept alive: -+ // -+ // __asm__ __volatile__("" : : "r"(pointerValue)) -+ // -+ // It should be portable to basically everything as the "r" register type -+ // exists basically everywhere. -+ asmType := llvm.FunctionType(b.dataPtrType, []llvm.Type{b.dataPtrType}, false) -+ asmFn := llvm.InlineAsm(asmType, "", "=r,0", true, false, 0, false) -+ result := b.createCall(asmType, asmFn, []llvm.Value{pointerValue}, "") -+ -+ b.CreateRet(result) -+} -+ - var mathToLLVMMapping = map[string]string{ - "math.Ceil": "llvm.ceil.f64", - "math.Exp": "llvm.exp.f64", -diff --git a/compiler/symbol.go b/compiler/symbol.go -index c56e0792f2..2507b3eedb 100644 ---- a/compiler/symbol.go -+++ b/compiler/symbol.go -@@ -253,6 +253,23 @@ func (c *compilerContext) maybeCreateSyntheticFunction(fn *ssa.Function, llvmFn - // The exception is the package initializer, which does appear in the - // *ssa.Package members and so shouldn't be created here. - if fn.Synthetic != "" && fn.Synthetic != "package initializer" && fn.Synthetic != "generic function" && fn.Synthetic != "range-over-func yield" { -+ if origin := fn.Origin(); origin != nil && origin.RelString(nil) == "internal/abi.Escape" { -+ // This is a special implementation or internal/abi.Escape, which -+ // can only really be implemented in the compiler. -+ // For simplicity we'll only implement pointer parameters for now. -+ if _, ok := fn.Params[0].Type().Underlying().(*types.Pointer); ok { -+ irbuilder := c.ctx.NewBuilder() -+ defer irbuilder.Dispose() -+ b := newBuilder(c, irbuilder, fn) -+ b.createAbiEscapeImpl() -+ llvmFn.SetLinkage(llvm.LinkOnceODRLinkage) -+ llvmFn.SetUnnamedAddr(true) -+ } -+ // If the parameter is not of a pointer type, it will be left -+ // unimplemented. This will result in a linker error if the function -+ // is really called, making it clear it needs to be implemented. -+ return -+ } - if len(fn.Blocks) == 0 { - c.addError(fn.Pos(), "missing function body") - return -diff --git a/src/internal/abi/escape.go b/src/internal/abi/escape.go -index 0ecdf80308..1f4c763312 100644 ---- a/src/internal/abi/escape.go -+++ b/src/internal/abi/escape.go -@@ -8,3 +8,10 @@ import "unsafe" - func NoEscape(p unsafe.Pointer) unsafe.Pointer { - return p - } -+ -+func Escape[T any](x T) T { -+ // This function is either implemented in the compiler, or left undefined -+ // for some variation of T. The body of this function should not be compiled -+ // as-is. -+ panic("internal/abi.Escape: unreachable (implemented in the compiler)") -+} - -From 6ea7aa68492ee4de9b9aa4ce0faa8104a5b3f590 Mon Sep 17 00:00:00 2001 -From: Ayke van Laethem -Date: Mon, 4 Aug 2025 10:28:01 +0200 -Subject: [PATCH 6/8] testing: stub out testing.B.Loop - -This gets the path package tests to pass, so we can move ahead with Go -1.25. It should be implemented in the future at some point (that, or -we'll use the upstream testing package instead). ---- - src/testing/benchmark.go | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/src/testing/benchmark.go b/src/testing/benchmark.go -index 53c7fc7b10..2dc59b72fd 100644 ---- a/src/testing/benchmark.go -+++ b/src/testing/benchmark.go -@@ -500,6 +500,10 @@ func (b *B) RunParallel(body func(*PB)) { - return - } - -+func (b *B) Loop() bool { -+ panic("unimplemented: testing.B.Loop") -+} -+ - // Benchmark benchmarks a single function. It is useful for creating - // custom benchmarks that do not use the "go test" command. - // - -From fc6d509c4235a980f0ef40cd30f207e9a1a697d0 Mon Sep 17 00:00:00 2001 -From: Ayke van Laethem -Date: Mon, 4 Aug 2025 10:31:48 +0200 -Subject: [PATCH 7/8] runtime: stub out weak pointer support - ---- - src/runtime/runtime.go | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/src/runtime/runtime.go b/src/runtime/runtime.go -index 7ad482a055..3bd98319e8 100644 ---- a/src/runtime/runtime.go -+++ b/src/runtime/runtime.go -@@ -125,6 +125,14 @@ type Cleanup struct{} - - func (c Cleanup) Stop() {} - -+//go:linkname registerWeakPointer weak.runtime_registerWeakPointer -+func registerWeakPointer(ptr unsafe.Pointer) unsafe.Pointer { -+ // TODO: unimplemented. -+ // I hope not implementing this won't break anything, like packages that -+ // expect weak pointers to be GC'd before they actually are. -+ return ptr -+} -+ - var godebugUpdate func(string, string) - - //go:linkname godebug_setUpdate internal/godebug.setUpdate - -From aae706cae0aec334d4a44ccb760caf9a1d422677 Mon Sep 17 00:00:00 2001 -From: Ayke van Laethem -Date: Fri, 11 Jul 2025 09:34:44 +0200 -Subject: [PATCH 8/8] all: add Go 1.25 support - ---- - .circleci/config.yml | 2 +- - .github/workflows/build-macos.yml | 4 ++-- - .github/workflows/linux.yml | 8 ++++---- - .github/workflows/windows.yml | 8 ++++---- - Dockerfile | 4 ++-- - GNUmakefile | 22 +++++++++++++--------- - builder/config.go | 2 +- - src/crypto/x509/internal/macos/macos.go | 4 ++++ - src/runtime/time.go | 6 ++++++ - 9 files changed, 37 insertions(+), 23 deletions(-) - -diff --git a/.circleci/config.yml b/.circleci/config.yml -index afa7a73001..68a013a253 100644 ---- a/.circleci/config.yml -+++ b/.circleci/config.yml -@@ -105,7 +105,7 @@ jobs: - # This tests the latest supported LLVM version when linking against system - # libraries. - docker: -- - image: golang:1.24-bullseye -+ - image: golang:1.25rc2-bullseye - steps: - - test-linux: - llvm: "20" -diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml -index bda9474327..564978c821 100644 ---- a/.github/workflows/build-macos.yml -+++ b/.github/workflows/build-macos.yml -@@ -39,7 +39,7 @@ jobs: - - name: Install Go - uses: actions/setup-go@v5 - with: -- go-version: '1.24' -+ go-version: '1.25.0-rc.2' - cache: true - - name: Restore LLVM source cache - uses: actions/cache/restore@v4 -@@ -134,7 +134,7 @@ jobs: - - name: Install Go - uses: actions/setup-go@v5 - with: -- go-version: '1.24' -+ go-version: '1.25.0-rc.2' - cache: true - - name: Build TinyGo (LLVM ${{ matrix.version }}) - run: go install -tags=llvm${{ matrix.version }} -diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml -index 803759892f..52e49eaff2 100644 ---- a/.github/workflows/linux.yml -+++ b/.github/workflows/linux.yml -@@ -18,7 +18,7 @@ jobs: - # statically linked binary. - runs-on: ubuntu-latest - container: -- image: golang:1.24-alpine -+ image: golang:1.25rc2-alpine - outputs: - version: ${{ steps.version.outputs.version }} - steps: -@@ -137,7 +137,7 @@ jobs: - - name: Install Go - uses: actions/setup-go@v5 - with: -- go-version: '1.24' -+ go-version: '1.25.0-rc.2' - cache: true - - name: Install wasmtime - uses: bytecodealliance/actions/wasmtime/setup@v1 -@@ -181,7 +181,7 @@ jobs: - - name: Install Go - uses: actions/setup-go@v5 - with: -- go-version: '1.24' -+ go-version: '1.25.0-rc.2' - cache: true - - name: Install Node.js - uses: actions/setup-node@v4 -@@ -298,7 +298,7 @@ jobs: - - name: Install Go - uses: actions/setup-go@v5 - with: -- go-version: '1.24' -+ go-version: '1.25.0-rc.2' - cache: true - - name: Restore LLVM source cache - uses: actions/cache/restore@v4 -diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml -index 6c428c98c4..ee7fbf1adb 100644 ---- a/.github/workflows/windows.yml -+++ b/.github/workflows/windows.yml -@@ -41,7 +41,7 @@ jobs: - - name: Install Go - uses: actions/setup-go@v5 - with: -- go-version: '1.24' -+ go-version: '1.25.0-rc.2' - cache: true - - name: Restore cached LLVM source - uses: actions/cache/restore@v4 -@@ -147,7 +147,7 @@ jobs: - - name: Install Go - uses: actions/setup-go@v5 - with: -- go-version: '1.24' -+ go-version: '1.25.0-rc.2' - cache: true - - name: Download TinyGo build - uses: actions/download-artifact@v4 -@@ -177,7 +177,7 @@ jobs: - - name: Install Go - uses: actions/setup-go@v5 - with: -- go-version: '1.24' -+ go-version: '1.25.0-rc.2' - cache: true - - name: Download TinyGo build - uses: actions/download-artifact@v4 -@@ -213,7 +213,7 @@ jobs: - - name: Install Go - uses: actions/setup-go@v5 - with: -- go-version: '1.24' -+ go-version: '1.25.0-rc.2' - cache: true - - name: Download TinyGo build - uses: actions/download-artifact@v4 -diff --git a/Dockerfile b/Dockerfile -index 520ad7c9b5..c45dd5d777 100644 ---- a/Dockerfile -+++ b/Dockerfile -@@ -1,5 +1,5 @@ - # tinygo-llvm stage obtains the llvm source for TinyGo --FROM golang:1.24 AS tinygo-llvm -+FROM golang:1.25rc2 AS tinygo-llvm - - RUN apt-get update && \ - apt-get install -y apt-utils make cmake clang-15 ninja-build && \ -@@ -33,7 +33,7 @@ RUN cd /tinygo/ && \ - - # tinygo-compiler copies the compiler build over to a base Go container (without - # all the build tools etc). --FROM golang:1.24 AS tinygo-compiler -+FROM golang:1.25rc2 AS tinygo-compiler - - # Copy tinygo build. - COPY --from=tinygo-compiler-build /tinygo/build/release/tinygo /tinygo -diff --git a/GNUmakefile b/GNUmakefile -index 2b14dd6ac0..61174600eb 100644 ---- a/GNUmakefile -+++ b/GNUmakefile -@@ -460,11 +460,15 @@ TEST_PACKAGES_HOST := $(TEST_PACKAGES_FAST) $(TEST_PACKAGES_WINDOWS) - TEST_IOFS := false - endif - -+TEST_SKIP_FLAG := -skip='TestExtraMethods|TestParseAndBytesRoundTrip/P256/Generic' -+ - # Test known-working standard library packages. - # TODO: parallelize, and only show failing tests (no implied -v flag). - .PHONY: tinygo-test - tinygo-test: -- $(TINYGO) test $(TEST_PACKAGES_HOST) $(TEST_PACKAGES_SLOW) -+ @# TestExtraMethods: used by many crypto packages and uses reflect.Type.Method which is not implemented. -+ @# TestParseAndBytesRoundTrip/P256/Generic: relies on t.Skip() which is not implemented -+ $(TINYGO) test $(TEST_SKIP_FLAG) $(TEST_PACKAGES_HOST) $(TEST_PACKAGES_SLOW) - @# io/fs requires os.ReadDir, not yet supported on windows or wasi. It also - @# requires a large stack-size. Hence, io/fs is only run conditionally. - @# For more details, see the comments on issue #3143. -@@ -472,7 +476,7 @@ ifeq ($(TEST_IOFS),true) - $(TINYGO) test -stack-size=6MB io/fs - endif - tinygo-test-fast: -- $(TINYGO) test $(TEST_PACKAGES_HOST) -+ $(TINYGO) test $(TEST_SKIP_FLAG) $(TEST_PACKAGES_HOST) - tinygo-bench: - $(TINYGO) test -bench . $(TEST_PACKAGES_HOST) $(TEST_PACKAGES_SLOW) - tinygo-bench-fast: -@@ -480,18 +484,18 @@ tinygo-bench-fast: - - # Same thing, except for wasi rather than the current platform. - tinygo-test-wasm: -- $(TINYGO) test -target wasm $(TEST_PACKAGES_WASM) -+ $(TINYGO) test -target wasm $(TEST_SKIP_FLAG) $(TEST_PACKAGES_WASM) - tinygo-test-wasi: -- $(TINYGO) test -target wasip1 $(TEST_PACKAGES_FAST) $(TEST_PACKAGES_SLOW) ./tests/runtime_wasi -+ $(TINYGO) test -target wasip1 $(TEST_SKIP_FLAG) $(TEST_PACKAGES_FAST) $(TEST_PACKAGES_SLOW) ./tests/runtime_wasi - tinygo-test-wasip1: -- GOOS=wasip1 GOARCH=wasm $(TINYGO) test $(TEST_PACKAGES_FAST) $(TEST_PACKAGES_SLOW) ./tests/runtime_wasi -+ GOOS=wasip1 GOARCH=wasm $(TINYGO) test $(TEST_SKIP_FLAG) $(TEST_PACKAGES_FAST) $(TEST_PACKAGES_SLOW) ./tests/runtime_wasi - tinygo-test-wasip1-fast: -- $(TINYGO) test -target=wasip1 $(TEST_PACKAGES_FAST) ./tests/runtime_wasi -+ $(TINYGO) test -target=wasip1 $(TEST_SKIP_FLAG) $(TEST_PACKAGES_FAST) ./tests/runtime_wasi - - tinygo-test-wasip2-slow: -- $(TINYGO) test -target=wasip2 $(TEST_PACKAGES_SLOW) -+ $(TINYGO) test -target=wasip2 $(TEST_SKIP_FLAG) $(TEST_PACKAGES_SLOW) - tinygo-test-wasip2-fast: -- $(TINYGO) test -target=wasip2 $(TEST_PACKAGES_FAST) ./tests/runtime_wasi -+ $(TINYGO) test -target=wasip2 $(TEST_SKIP_FLAG) $(TEST_PACKAGES_FAST) ./tests/runtime_wasi - - tinygo-test-wasip2-sum-slow: - TINYGO=$(TINYGO) \ -@@ -517,7 +521,7 @@ tinygo-bench-wasip2-fast: - - # Run tests on riscv-qemu since that one provides a large amount of memory. - tinygo-test-baremetal: -- $(TINYGO) test -target riscv-qemu $(TEST_PACKAGES_BAREMETAL) -+ $(TINYGO) test -target riscv-qemu $(TEST_SKIP_FLAG) $(TEST_PACKAGES_BAREMETAL) - - # Test external packages in a large corpus. - test-corpus: -diff --git a/builder/config.go b/builder/config.go -index b36b9333f3..5fb74ee192 100644 ---- a/builder/config.go -+++ b/builder/config.go -@@ -26,7 +26,7 @@ func NewConfig(options *compileopts.Options) (*compileopts.Config, error) { - - // Version range supported by TinyGo. - const minorMin = 19 -- const minorMax = 24 -+ const minorMax = 25 - - // Check that we support this Go toolchain version. - gorootMajor, gorootMinor, err := goenv.GetGorootVersion() -diff --git a/src/crypto/x509/internal/macos/macos.go b/src/crypto/x509/internal/macos/macos.go -index e9ec2ef843..c662acb577 100644 ---- a/src/crypto/x509/internal/macos/macos.go -+++ b/src/crypto/x509/internal/macos/macos.go -@@ -63,6 +63,10 @@ func SecCertificateCopyData(cert CFRef) ([]byte, error) { - return nil, errors.New("not implemented") - } - -+func SecTrustCopyCertificateChain(trustObj CFRef) (CFRef, error) { -+ return 0, errors.New("not implemented") -+} -+ - func SecTrustEvaluateWithError(trustObj CFRef) (int, error) { - return 0, errors.New("not implemented") - } -diff --git a/src/runtime/time.go b/src/runtime/time.go -index 3935b4486e..23a9bf5e2f 100644 ---- a/src/runtime/time.go -+++ b/src/runtime/time.go -@@ -46,3 +46,9 @@ func timerCallback(tn *timerNode, delta int64) { - addTimer(tn) - } - } -+ -+//go:linkname time_runtimeIsBubbled time.runtimeIsBubbled -+func time_runtimeIsBubbled() bool { -+ // We don't currently support bubbles. -+ return false -+} diff --git a/sources b/sources index 0a75777..e96310c 100644 --- a/sources +++ b/sources @@ -1,4 +1,4 @@ -SHA512 (tinygo-0.38.0.tar.gz) = 1e7d64caa20c2a12390de36067b50f3cc3b675a3e4818d6fa463816c42cbd94101989863936f5ed38ce1224e99cdf69e3c251debcdb7c9f16daf42876fae2f9e +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 diff --git a/tinygo.spec b/tinygo.spec index 2e9fe62..0242570 100644 --- a/tinygo.spec +++ b/tinygo.spec @@ -8,7 +8,7 @@ # https://github.com/tinygo-org/tinygo %global goipath github.com/tinygo-org/tinygo -Version: 0.38.0 +Version: 0.39.0 %global CMSIS_commit 9fe411cef1cef5de58e5957b89760759de44e393 %global avr_commit 6624554c02b237b23dc17d53e992bf54033fc228 @@ -93,17 +93,10 @@ Patch: 0001-Skip-WASI-tests.patch 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 -# We can't include these due to poor licensing. -# https://github.com/tinygo-org/tinygo/pull/4962 -Patch: 0004-Add-flag-to-skip-Renesas-SVD-builds.patch #https://github.com/tinygo-org/tinygo/pull/4677 -Patch: 0005-Normalize-expected-path-for-chdir-tests.patch -# https://github.com/tinygo-org/tinygo/pull/4958 -Patch: https://github.com/tinygo-org/tinygo/commit/1b5d312c689a004434cb77f161f65b9615c98036.patch +Patch: 0004-Normalize-expected-path-for-chdir-tests.patch # https://github.com/tinygo-org/tinygo/issues/4969 -Patch: 0006-Skip-x86-tests-on-ARM.patch -# Support for Go 1.25. -Patch: https://github.com/tinygo-org/tinygo/pull/4954.patch +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 From faf08a188dd9cacdda772a9cb100ea48a6d0bebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20S=C3=A1ez?= Date: Fri, 10 Oct 2025 15:13:25 +0200 Subject: [PATCH 17/18] rebuild From da069d072ea5fe63a44329666b4b46f3a2c0c41b Mon Sep 17 00:00:00 2001 From: Maxwell G Date: Sat, 11 Oct 2025 21:17:25 -0500 Subject: [PATCH 18/18] Rebuild for golang 1.25.2