diff --git a/.gitignore b/.gitignore index 7da6ab5..3083458 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ /tinygo-0.9.0.tar.gz /tinygo-0.10.0.tar.gz /tinygo-0.11.0.tar.gz +/tinygo-0.12.0.tar.gz +/wasi-libc-a280fead2ae71b9a230d3b48c1f95867431888e4.tar.gz diff --git a/0001-Use-Fedora-command-names.patch b/0001-Use-Fedora-command-names.patch index 71cdacf..d662dd9 100644 --- a/0001-Use-Fedora-command-names.patch +++ b/0001-Use-Fedora-command-names.patch @@ -1,19 +1,19 @@ -From 356e9032645d59732584af64bc4e90a9a7063083 Mon Sep 17 00:00:00 2001 +From 76c62ae314fcc8a7e3b51f1fb41a24f2ebfd1a80 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Fri, 7 Jun 2019 20:55:25 -0400 Subject: [PATCH 1/4] Use Fedora command names. Signed-off-by: Elliott Sales de Andrade --- - compileopts/target.go | 8 ++++---- - main_test.go | 2 +- - 2 files changed, 5 insertions(+), 5 deletions(-) + compileopts/target.go | 10 +++++----- + main_test.go | 2 +- + 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/compileopts/target.go b/compileopts/target.go -index 3bc05da..ab9c25a 100644 +index 637712c..0dfaead 100644 --- a/compileopts/target.go +++ b/compileopts/target.go -@@ -193,7 +193,7 @@ func LoadTarget(target string) (*TargetSpec, error) { +@@ -201,7 +201,7 @@ func LoadTarget(target string) (*TargetSpec, error) { } target = llvmarch + "--" + llvmos if goarch == "arm" { @@ -22,24 +22,26 @@ index 3bc05da..ab9c25a 100644 } return defaultTarget(goos, goarch, target) } -@@ -259,9 +259,9 @@ func defaultTarget(goos, goarch, triple string) (*TargetSpec, error) { +@@ -277,10 +277,10 @@ func defaultTarget(goos, goarch, triple string) (*TargetSpec, error) { if goarch != runtime.GOARCH { // Some educated guesses as to how to invoke helper programs. if goarch == "arm" && goos == "linux" { +- spec.CFlags = append(spec.CFlags, "--sysroot=/usr/arm-linux-gnueabihf") - spec.Linker = "arm-linux-gnueabihf-gcc" - spec.GDB = "arm-linux-gnueabihf-gdb" - spec.Emulator = []string{"qemu-arm", "-L", "/usr/arm-linux-gnueabihf"} ++ spec.CFlags = append(spec.CFlags, "--sysroot=/usr/arm-linux-none") + spec.Linker = "arm-linux-gnu-gcc" + spec.GDB = "arm-linux-gnu-gdb" + spec.Emulator = []string{"qemu-arm", "-L", "/usr/arm-linux-none"} } if goarch == "arm64" && goos == "linux" { - spec.Linker = "aarch64-linux-gnu-gcc" + spec.CFlags = append(spec.CFlags, "--sysroot=/usr/aarch64-linux-gnu") diff --git a/main_test.go b/main_test.go -index bb04c39..040e487 100644 +index dbdca1f..52ae124 100644 --- a/main_test.go +++ b/main_test.go -@@ -56,7 +56,7 @@ func TestCompiler(t *testing.T) { +@@ -57,7 +57,7 @@ func TestCompiler(t *testing.T) { if runtime.GOOS == "linux" { t.Run("ARMLinux", func(t *testing.T) { diff --git a/0002-Skip-ARM-Linux-tests.patch b/0002-Skip-ARM-Linux-tests.patch index d90e032..57b2443 100644 --- a/0002-Skip-ARM-Linux-tests.patch +++ b/0002-Skip-ARM-Linux-tests.patch @@ -1,4 +1,4 @@ -From 88990f62cb88b2155dc65f2c2e4913e5fbd5476a Mon Sep 17 00:00:00 2001 +From a36eebae67fe22ae2dd959a10a2164680a499051 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Wed, 12 Jun 2019 04:28:55 -0400 Subject: [PATCH 2/4] Skip ARM Linux tests. @@ -11,10 +11,10 @@ Signed-off-by: Elliott Sales de Andrade 1 file changed, 6 deletions(-) diff --git a/main_test.go b/main_test.go -index 040e487..5ab606d 100644 +index 52ae124..cba449a 100644 --- a/main_test.go +++ b/main_test.go -@@ -55,12 +55,6 @@ func TestCompiler(t *testing.T) { +@@ -56,12 +56,6 @@ func TestCompiler(t *testing.T) { }) if runtime.GOOS == "linux" { diff --git a/0003-Skip-STM32-tests.patch b/0003-Skip-STM32-tests.patch index ef6f0f5..95358c5 100644 --- a/0003-Skip-STM32-tests.patch +++ b/0003-Skip-STM32-tests.patch @@ -1,4 +1,4 @@ -From b3923119b77a2a25229f264472cb8243240e1c95 Mon Sep 17 00:00:00 2001 +From 08660a7f0a6ab6b079b26422d89b9f30b722a38d Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Thu, 13 Jun 2019 02:50:40 -0400 Subject: [PATCH 3/4] Skip STM32 tests. @@ -11,10 +11,10 @@ Signed-off-by: Elliott Sales de Andrade 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Makefile b/Makefile -index ff189ca..11866dc 100644 +index 81bbfac..3ea842a 100644 --- a/Makefile +++ b/Makefile -@@ -91,7 +91,7 @@ fmt-check: +@@ -101,7 +101,7 @@ fmt-check: @unformatted=$$(gofmt -l $(FMT_PATHS)); [ -z "$$unformatted" ] && exit 0; echo "Unformatted:"; for fn in $$unformatted; do echo " $$fn"; done; exit 1 @@ -23,7 +23,7 @@ index ff189ca..11866dc 100644 gen-device-avr: $(GO) build -o ./build/gen-device-avr ./tools/gen-device-avr/ -@@ -199,8 +199,6 @@ smoketest: +@@ -216,8 +216,6 @@ smoketest: @$(MD5SUM) test.hex $(TINYGO) build -size short -o test.hex -target=pca10031 examples/blinky1 @$(MD5SUM) test.hex @@ -32,7 +32,7 @@ index ff189ca..11866dc 100644 $(TINYGO) build -size short -o test.hex -target=reelboard examples/blinky1 @$(MD5SUM) test.hex $(TINYGO) build -size short -o test.hex -target=reelboard examples/blinky2 -@@ -217,10 +215,6 @@ smoketest: +@@ -234,10 +232,6 @@ smoketest: @$(MD5SUM) test.hex $(TINYGO) build -size short -o test.hex -target=circuitplay-express examples/blinky1 @$(MD5SUM) test.hex @@ -40,12 +40,12 @@ index ff189ca..11866dc 100644 - @$(MD5SUM) test.hex - $(TINYGO) build -size short -o test.hex -target=stm32f4disco examples/blinky2 - @$(MD5SUM) test.hex - $(TINYGO) build -size short -o test.hex -target=circuitplay-express examples/i2s + $(TINYGO) build -size short -o test.hex -target=circuitplay-bluefruit examples/blinky1 @$(MD5SUM) test.hex - $(TINYGO) build -size short -o test.gba -target=gameboy-advance examples/gba-display -@@ -233,8 +227,6 @@ smoketest: + $(TINYGO) build -size short -o test.hex -target=circuitplay-express examples/i2s +@@ -254,8 +248,6 @@ smoketest: @$(MD5SUM) test.hex - $(TINYGO) build -size short -o test.hex -target=metro-m4-airlift examples/blinky1 + $(TINYGO) build -size short -o test.hex -target=pyportal examples/blinky1 @$(MD5SUM) test.hex - $(TINYGO) build -size short -o test.hex -target=nucleo-f103rb examples/blinky1 - @$(MD5SUM) test.hex diff --git a/0004-Use-go-mod-expected-path-for-go.bug.st-serial.patch b/0004-Use-go-mod-expected-path-for-go.bug.st-serial.patch index ccc3549..1be0b88 100644 --- a/0004-Use-go-mod-expected-path-for-go.bug.st-serial.patch +++ b/0004-Use-go-mod-expected-path-for-go.bug.st-serial.patch @@ -1,4 +1,4 @@ -From f0651d6ee7a7bdc00b7ec41025b1dca74ffc38dd Mon Sep 17 00:00:00 2001 +From 76b185114de84e434a0f69b561817f447620b836 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Mon, 10 Feb 2020 17:23:25 -0500 Subject: [PATCH 4/4] Use go mod expected path for go.bug.st/serial. @@ -11,7 +11,7 @@ Signed-off-by: Elliott Sales de Andrade 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod -index 810ebee..dc21040 100644 +index 3d58ce4..128c133 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ require ( @@ -22,9 +22,9 @@ index 810ebee..dc21040 100644 + go.bug.st/serial v0.0.0-20180827123349-5f7892a7bb45 golang.org/x/sys v0.0.0-20191010194322-b09406accb47 // indirect golang.org/x/tools v0.0.0-20190227180812-8dcc6e70cdef - tinygo.org/x/go-llvm v0.0.0-20191124211856-b2db3df3f257 + tinygo.org/x/go-llvm v0.0.0-20200104190746-1ff21df33566 diff --git a/go.sum b/go.sum -index 6009c58..02037af 100644 +index 0446f72..099fda2 100644 --- a/go.sum +++ b/go.sum @@ -7,8 +7,8 @@ github.com/google/shlex v0.0.0-20181106134648-c34317bd91bf h1:7+FW5aGwISbqUtkfmI @@ -39,7 +39,7 @@ index 6009c58..02037af 100644 golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= diff --git a/main.go b/main.go -index c954e97..056789a 100644 +index 363afff..2ff2019 100644 --- a/main.go +++ b/main.go @@ -24,7 +24,7 @@ import ( diff --git a/sources b/sources index 55903f9..1d72bfe 100644 --- a/sources +++ b/sources @@ -1,6 +1,7 @@ -SHA512 (tinygo-0.11.0.tar.gz) = 3402c8634646fd4a9070cba95da075f508bf153e36f6b103792ab10fedcd869d85e01815199388a7cfc990fb82e54f7dafd5d51a189d9fb348ef3f89efc78333 +SHA512 (tinygo-0.12.0.tar.gz) = 5d668b0e16377a060fac48887ba49a4f3bcd5f90a18054a56e12caf07e2a20352948cb3ffb0c11d09fb55000fac0d2066d401c80b1eab8418d5d20d9be7ca3dc SHA512 (avr-6624554c02b237b23dc17d53e992bf54033fc228.tar.gz) = 1aa157bd761db38f8680614fa1cf47d7009508f65291b7eaaa5aba1ae76d35103f68a42947b7269a170d2f1cf8fb09941a5d74070fe6d204b68dd15a9ad2ed29 SHA512 (cmsis-9fe411cef1cef5de58e5957b89760759de44e393-clean.tar.xz) = f131fc241f61982c49f334eb502c2f13da61eb7bdaa641ee84a8de30c4d576b735b8aadeafd7d75351473a2df6a42de6a236ecc5dcc616ee6cfcc07af29446f9 SHA512 (cmsis_svd-7d9b4167010feed9e59ac45e56519180295b3813-clean.tar.xz) = 013a5991a0fc170bd86e8c3cafe41b722061d9c631a51ecca762e00ea61ab2d14cb794a78a4ff8f449b10e32c8e746b07782da66f64599c7e6c8b17475f00428 SHA512 (compiler-rt-9.0.0.src.tar.xz) = a7bb0a67165d29317cee58c22ed79f0d6a9cb9279dcd355d4267f3cd6c531a7be455a28267c591d6e2c0f9c56e363d40c10a405391e07d02ab3e30f00ffef2a8 SHA512 (nrfx-3ab39a9d457bfe627473ed0e03a7f1161d9e4f27.tar.gz) = 95b5293c9b707aeb4d8ad13643619c053ba0fa9423053a12f9a65b0ed8febc2aab87cd832e6ac73e9673987b7cb73f85cce68cb85ce4ca5bd607afee1098f9e9 +SHA512 (wasi-libc-a280fead2ae71b9a230d3b48c1f95867431888e4.tar.gz) = 6202fc2c005171b3f34aaa61be242fafb8df65874df4055e84436ed35b0af40c657437a3bfc8e7a0606211bb87564f56b97c45cc41d9878285e057ff76878757 diff --git a/tinygo.spec b/tinygo.spec index 2523b6a..50da947 100644 --- a/tinygo.spec +++ b/tinygo.spec @@ -5,7 +5,7 @@ # https://github.com/tinygo-org/tinygo %global goipath github.com/tinygo-org/tinygo -Version: 0.11.0 +Version: 0.12.0 %global CMSIS_commit 9fe411cef1cef5de58e5957b89760759de44e393 %global avr_commit 6624554c02b237b23dc17d53e992bf54033fc228 @@ -13,6 +13,7 @@ Version: 0.11.0 %global cmsis_svd_commit 7d9b4167010feed9e59ac45e56519180295b3813 %global compiler_rt_version 9.0.0 %global nrfx_commit 3ab39a9d457bfe627473ed0e03a7f1161d9e4f27 +%global wasi_libc_commit a280fead2ae71b9a230d3b48c1f95867431888e4 # No longer matching regular Go's /usr/share/gocode because it also provides # pre-compiled binaries, and symlinks to arch-specific clang headers. @@ -29,7 +30,7 @@ tools. Based on LLVM.} #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: 3%{?dist} +Release: 1%{?dist} Summary: Go compiler for small places # Main files: BSD @@ -38,7 +39,8 @@ Summary: Go compiler for small places # cmsis-svd: ASL 2.0 (subsetted) # compiler-rt: NCSA or MIT # nrfx: BSD and ASL 2.0 -License: BSD and MIT and (NCSA or MIT) and ASL 2.0 +# wasi-libc: BSD and CC0 and ISC and MIT and Public Domain +License: BSD and ASL 2.0 and CC0 and ISC and MIT and (NCSA or MIT) and Public Domain URL: %{gourl} Source0: %{gosource} Source1: clean_tarballs.sh @@ -47,6 +49,7 @@ Source3: https://github.com/avr-rust/avr-mcu/archive/%{avr_commit}/avr-%{ Source4: cmsis_svd-%{cmsis_svd_commit}-clean.tar.xz Source5: https://releases.llvm.org/%{compiler_rt_version}/compiler-rt-%{compiler_rt_version}.src.tar.xz Source6: https://github.com/NordicSemiconductor/nrfx/archive/%{nrfx_commit}/nrfx-%{nrfx_commit}.tar.gz +Source7: https://github.com/WebAssembly/wasi-libc/archive/%{wasi_libc_commit}/wasi-libc-%{wasi_libc_commit}.tar.gz # Fedora-specific. Patch0001: 0001-Use-Fedora-command-names.patch # We don't have ARM glibc to build these. @@ -120,6 +123,10 @@ mv lib/nrfx-%{nrfx_commit} lib/nrfx rm lib/nrfx/.gitignore chmod -x lib/nrfx/doc/generate_html_doc.sh +tar -C lib -xf %{SOURCE7} +rmdir lib/wasi-libc +mv lib/wasi-libc-%{wasi_libc_commit} lib/wasi-libc + mkdir lib/clang ln -s %{_libdir}/clang/%{clang_version}/include lib/clang/include @@ -133,6 +140,7 @@ for target in armv6m-none-eabi armv7m-none-eabi armv7em-none-eabi; do %{gobuilddir}/bin/tinygo \ build-builtins -target=$target -o ${target}-compiler-rt.a done +%make_build wasi-libc LLVM_AR=llvm-ar LLVM_NM=llvm-nm %install @@ -154,6 +162,8 @@ install -vpm 0644 lib/compiler-rt/LICENSE.TXT %{buildroot}%{tinygoroot}/lib/comp install -vdm 0755 %{buildroot}%{tinygoroot}/lib/compiler-rt/lib cp -rp lib/compiler-rt/lib/builtins %{buildroot}%{tinygoroot}/lib/compiler-rt/lib/ 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}/pkg for target in armv6m-none-eabi armv7m-none-eabi armv7em-none-eabi; do install -vdm 0755 %{buildroot}%{tinygoroot}/pkg/${target} @@ -188,6 +198,9 @@ PATH=%{buildroot}%{_bindir}:$PATH make smoketest %changelog +* Sun Apr 19 2020 Elliott Sales de Andrade - 0.12.0-1 +- Update to latest version + * Wed Mar 04 2020 Elliott Sales de Andrade - 0.11.0-3 - Update required clang version