From 3e3821d14316101628509ae242ab46f613b523f5 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Feb 10 2020 23:10:57 +0000 Subject: Update to latest version. --- diff --git a/.gitignore b/.gitignore index c875580..77366fb 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,4 @@ /tinygo-0.7.0.tar.gz /tinygo-0.7.1.tar.gz /tinygo-0.8.0.tar.gz +/tinygo-0.9.0.tar.gz diff --git a/0001-Use-Fedora-command-names.patch b/0001-Use-Fedora-command-names.patch index bdb100c..2b9764e 100644 --- a/0001-Use-Fedora-command-names.patch +++ b/0001-Use-Fedora-command-names.patch @@ -1,4 +1,4 @@ -From 09d3a1157e66bde46f3919142f65e409de7b447b Mon Sep 17 00:00:00 2001 +From 2b6fe327a7a57a6a0c7740d81591ae0fa207b94d 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. @@ -10,10 +10,10 @@ Signed-off-by: Elliott Sales de Andrade 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/main_test.go b/main_test.go -index 9b406d2..6a47393 100644 +index f0a574b..c65c463 100644 --- a/main_test.go +++ b/main_test.go -@@ -70,7 +70,7 @@ func TestCompiler(t *testing.T) { +@@ -72,7 +72,7 @@ func TestCompiler(t *testing.T) { continue // TODO: improve CGo } t.Run(path, func(t *testing.T) { @@ -23,10 +23,10 @@ index 9b406d2..6a47393 100644 } diff --git a/target.go b/target.go -index ad701e8..29ac6a0 100644 +index 655b5f2..e0c5e21 100644 --- a/target.go +++ b/target.go -@@ -181,7 +181,7 @@ func LoadTarget(target string) (*TargetSpec, error) { +@@ -195,7 +195,7 @@ func LoadTarget(target string) (*TargetSpec, error) { } target = llvmarch + "--" + llvmos if goarch == "arm" { @@ -35,7 +35,7 @@ index ad701e8..29ac6a0 100644 } return defaultTarget(goos, goarch, target) } -@@ -246,9 +246,9 @@ func defaultTarget(goos, goarch, triple string) (*TargetSpec, error) { +@@ -261,9 +261,9 @@ 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" { @@ -49,5 +49,5 @@ index ad701e8..29ac6a0 100644 if goarch == "arm64" && goos == "linux" { spec.Linker = "aarch64-linux-gnu-gcc" -- -2.21.0 +2.21.1 diff --git a/0002-Skip-ARM-Linux-tests.patch b/0002-Skip-ARM-Linux-tests.patch index 1ced3a0..523fe22 100644 --- a/0002-Skip-ARM-Linux-tests.patch +++ b/0002-Skip-ARM-Linux-tests.patch @@ -1,4 +1,4 @@ -From 351e01b09db90ca01a3a70817c7360c986ef7eb7 Mon Sep 17 00:00:00 2001 +From 4aef9745a245596f8f8781481f2d734318999074 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 insertions(+) diff --git a/main_test.go b/main_test.go -index 6a47393..86e7fd3 100644 +index c65c463..46bdbd1 100644 --- a/main_test.go +++ b/main_test.go -@@ -66,6 +66,9 @@ func TestCompiler(t *testing.T) { +@@ -68,6 +68,9 @@ func TestCompiler(t *testing.T) { if runtime.GOOS == "linux" { t.Log("running tests for linux/arm...") for _, path := range matches { @@ -24,7 +24,7 @@ index 6a47393..86e7fd3 100644 if path == filepath.Join("testdata", "cgo")+string(filepath.Separator) { continue // TODO: improve CGo } -@@ -76,6 +79,9 @@ func TestCompiler(t *testing.T) { +@@ -78,6 +81,9 @@ func TestCompiler(t *testing.T) { t.Log("running tests for linux/arm64...") for _, path := range matches { @@ -35,5 +35,5 @@ index 6a47393..86e7fd3 100644 continue // TODO: improve CGo } -- -2.21.0 +2.21.1 diff --git a/0003-Skip-STM32-tests.patch b/0003-Skip-STM32-tests.patch index 7f6cf5e..8e85649 100644 --- a/0003-Skip-STM32-tests.patch +++ b/0003-Skip-STM32-tests.patch @@ -1,4 +1,4 @@ -From d195702b68f8fac69fbafcabb490081834d4bb39 Mon Sep 17 00:00:00 2001 +From 6f7b79ef714cd974cf2a6758e4307fa2b45eb26b 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. @@ -7,14 +7,14 @@ We can't ship the STM32 .svd files due to their odd license. Signed-off-by: Elliott Sales de Andrade --- - Makefile | 6 +----- - 1 file changed, 1 insertion(+), 5 deletions(-) + Makefile | 10 +--------- + 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Makefile b/Makefile -index e1d9061..90c9efc 100644 +index 7fc00df..73391f9 100644 --- a/Makefile +++ b/Makefile -@@ -41,7 +41,7 @@ fmt-check: +@@ -94,7 +94,7 @@ fmt-check: @unformatted=$$(gofmt -l $(FMT_PATHS)); [ -z "$$unformatted" ] && exit 0; echo "Unformatted:"; for fn in $$unformatted; do echo " $$fn"; done; exit 1 @@ -22,28 +22,35 @@ index e1d9061..90c9efc 100644 +gen-device: gen-device-avr gen-device-nrf gen-device-sam gen-device-sifive gen-device-avr: - ./tools/gen-device-avr.py lib/avr/packs/atmega src/device/avr/ -@@ -112,7 +112,6 @@ smoketest: - tinygo build -size short -o test.elf -target=microbit examples/echo - tinygo build -size short -o test.elf -target=nrf52840-mdk examples/blinky1 - tinygo build -size short -o test.elf -target=pca10031 examples/blinky1 -- tinygo build -size short -o test.elf -target=bluepill examples/blinky1 - tinygo build -size short -o test.elf -target=reelboard examples/blinky1 - tinygo build -size short -o test.elf -target=reelboard examples/blinky2 - tinygo build -size short -o test.elf -target=pca10056 examples/blinky1 -@@ -121,12 +120,9 @@ smoketest: - tinygo build -size short -o test.elf -target=feather-m0 examples/blinky1 - tinygo build -size short -o test.elf -target=trinket-m0 examples/blinky1 - tinygo build -size short -o test.elf -target=circuitplay-express examples/blinky1 -- tinygo build -size short -o test.elf -target=stm32f4disco examples/blinky1 -- tinygo build -size short -o test.elf -target=stm32f4disco examples/blinky2 - tinygo build -size short -o test.elf -target=circuitplay-express examples/i2s - tinygo build -size short -o test.elf -target=gameboy-advance examples/gba-display - tinygo build -size short -o test.elf -target=itsybitsy-m4 examples/blinky1 -- tinygo build -size short -o test.elf -target=nucleo-f103rb examples/blinky1 + $(PYTHON) ./tools/gen-device-avr.py lib/avr/packs/atmega src/device/avr/ +@@ -181,8 +181,6 @@ smoketest: + @$(MD5SUM) test.hex + $(TINYGO) build -size short -o test.hex -target=pca10031 examples/blinky1 + @$(MD5SUM) test.hex +- $(TINYGO) build -size short -o test.hex -target=bluepill examples/blinky1 +- @$(MD5SUM) test.hex + $(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 +@@ -199,18 +197,12 @@ smoketest: + @$(MD5SUM) test.hex + $(TINYGO) build -size short -o test.hex -target=circuitplay-express examples/blinky1 + @$(MD5SUM) test.hex +- $(TINYGO) build -size short -o test.hex -target=stm32f4disco examples/blinky1 +- @$(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 + @$(MD5SUM) test.hex + $(TINYGO) build -size short -o test.gba -target=gameboy-advance examples/gba-display + @$(MD5SUM) test.gba + $(TINYGO) build -size short -o test.hex -target=itsybitsy-m4 examples/blinky1 + @$(MD5SUM) test.hex +- $(TINYGO) build -size short -o test.hex -target=nucleo-f103rb examples/blinky1 +- @$(MD5SUM) test.hex ifneq ($(AVR), 0) - tinygo build -size short -o test.elf -target=arduino examples/blinky1 - tinygo build -size short -o test.elf -target=digispark examples/blinky1 + $(TINYGO) build -size short -o test.hex -target=arduino examples/blinky1 + @$(MD5SUM) test.hex -- -2.21.0 +2.21.1 diff --git a/0004-Allow-overridding-Python-used-for-generators.patch b/0004-Allow-overridding-Python-used-for-generators.patch deleted file mode 100644 index a8cd80f..0000000 --- a/0004-Allow-overridding-Python-used-for-generators.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 6156198f2378eee7912a5e5395bd799e13f8aae9 Mon Sep 17 00:00:00 2001 -From: Elliott Sales de Andrade -Date: Tue, 24 Sep 2019 04:50:25 -0400 -Subject: [PATCH 4/4] Allow overridding Python used for generators. - -Signed-off-by: Elliott Sales de Andrade ---- - Makefile | 13 +++++++------ - 1 file changed, 7 insertions(+), 6 deletions(-) - -diff --git a/Makefile b/Makefile -index 90c9efc..65d407d 100644 ---- a/Makefile -+++ b/Makefile -@@ -3,6 +3,7 @@ - all: tinygo - tinygo: build/tinygo - -+PYTHON ?= python - # Default build and source directories, as created by `make llvm-build`. - LLVM_BUILDDIR ?= llvm-build - CLANG_SRC ?= llvm-project/clang -@@ -44,24 +45,24 @@ fmt-check: - gen-device: gen-device-avr gen-device-nrf gen-device-sam gen-device-sifive - - gen-device-avr: -- ./tools/gen-device-avr.py lib/avr/packs/atmega src/device/avr/ -- ./tools/gen-device-avr.py lib/avr/packs/tiny src/device/avr/ -+ $(PYTHON) ./tools/gen-device-avr.py lib/avr/packs/atmega src/device/avr/ -+ $(PYTHON) ./tools/gen-device-avr.py lib/avr/packs/tiny src/device/avr/ - go fmt ./src/device/avr - - gen-device-nrf: -- ./tools/gen-device-svd.py lib/nrfx/mdk/ src/device/nrf/ --source=https://github.com/NordicSemiconductor/nrfx/tree/master/mdk -+ $(PYTHON) ./tools/gen-device-svd.py lib/nrfx/mdk/ src/device/nrf/ --source=https://github.com/NordicSemiconductor/nrfx/tree/master/mdk - go fmt ./src/device/nrf - - gen-device-sam: -- ./tools/gen-device-svd.py lib/cmsis-svd/data/Atmel/ src/device/sam/ --source=https://github.com/posborne/cmsis-svd/tree/master/data/Atmel -+ $(PYTHON) ./tools/gen-device-svd.py lib/cmsis-svd/data/Atmel/ src/device/sam/ --source=https://github.com/posborne/cmsis-svd/tree/master/data/Atmel - go fmt ./src/device/sam - - gen-device-sifive: -- ./tools/gen-device-svd.py lib/cmsis-svd/data/SiFive-Community/ src/device/sifive/ --source=https://github.com/AdaCore/svd2ada/tree/master/CMSIS-SVD/SiFive-Community -+ $(PYTHON) ./tools/gen-device-svd.py lib/cmsis-svd/data/SiFive-Community/ src/device/sifive/ --source=https://github.com/AdaCore/svd2ada/tree/master/CMSIS-SVD/SiFive-Community - go fmt ./src/device/sifive - - gen-device-stm32: -- ./tools/gen-device-svd.py lib/cmsis-svd/data/STMicro/ src/device/stm32/ --source=https://github.com/posborne/cmsis-svd/tree/master/data/STMicro -+ $(PYTHON) ./tools/gen-device-svd.py lib/cmsis-svd/data/STMicro/ src/device/stm32/ --source=https://github.com/posborne/cmsis-svd/tree/master/data/STMicro - go fmt ./src/device/stm32 - - --- -2.21.0 - 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 new file mode 100644 index 0000000..50e8ca8 --- /dev/null +++ b/0004-Use-go-mod-expected-path-for-go.bug.st-serial.patch @@ -0,0 +1,56 @@ +From 74f009b22143b731af1d4262e82e902ad9c5c2a0 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. + +Signed-off-by: Elliott Sales de Andrade +--- + go.mod | 2 +- + go.sum | 4 ++-- + main.go | 2 +- + 3 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/go.mod b/go.mod +index 64668f6..cf33dd7 100644 +--- a/go.mod ++++ b/go.mod +@@ -6,7 +6,7 @@ require ( + github.com/blakesmith/ar v0.0.0-20150311145944-8bd4349a67f2 + github.com/creack/goselect v0.1.0 // indirect + github.com/marcinbor85/gohex v0.0.0-20180128172054-7a43cd876e46 +- go.bug.st/serial.v1 v0.0.0-20180827123349-5f7892a7bb45 ++ 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-20190818154551-95bc4ffe1add +diff --git a/go.sum b/go.sum +index 341c3e5..0aaf2cd 100644 +--- a/go.sum ++++ b/go.sum +@@ -5,8 +5,8 @@ github.com/creack/goselect v0.1.0/go.mod h1:gHrIcH/9UZDn2qgeTUeW5K9eZsVYCH6/60J/ + github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= + github.com/marcinbor85/gohex v0.0.0-20180128172054-7a43cd876e46 h1:wXG2bA8fO7Vv7lLk2PihFMTqmbT173Tje39oKzQ50Mo= + github.com/marcinbor85/gohex v0.0.0-20180128172054-7a43cd876e46/go.mod h1:Pb6XcsXyropB9LNHhnqaknG/vEwYztLkQzVCHv8sQ3M= +-go.bug.st/serial.v1 v0.0.0-20180827123349-5f7892a7bb45 h1:mACY1anK6HNCZtm/DK2Rf2ZPHggVqeB0+7rY9Gl6wyI= +-go.bug.st/serial.v1 v0.0.0-20180827123349-5f7892a7bb45/go.mod h1:dRSl/CVCTf56CkXgJMDOdSwNfo2g1orOGE/gBGdvjZw= ++go.bug.st/serial v0.0.0-20180827123349-5f7892a7bb45 h1:mACY1anK6HNCZtm/DK2Rf2ZPHggVqeB0+7rY9Gl6wyI= ++go.bug.st/serial v0.0.0-20180827123349-5f7892a7bb45/go.mod h1:dRSl/CVCTf56CkXgJMDOdSwNfo2g1orOGE/gBGdvjZw= + golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= + 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 b35f63b..571959c 100644 +--- a/main.go ++++ b/main.go +@@ -22,7 +22,7 @@ import ( + "github.com/tinygo-org/tinygo/interp" + "github.com/tinygo-org/tinygo/loader" + +- serial "go.bug.st/serial.v1" ++ "go.bug.st/serial" + ) + + // commandError is an error type to wrap os/exec.Command errors. This provides +-- +2.21.1 + diff --git a/clean_tarballs.sh b/clean_tarballs.sh index 53dc185..962f8f8 100755 --- a/clean_tarballs.sh +++ b/clean_tarballs.sh @@ -1,7 +1,7 @@ #!/bin/bash -e CMSIS_VERSION=9fe411cef1cef5de58e5957b89760759de44e393 -CMSIS_SVD_VERSION=5910f3d115a53ead55c8158da24a8fa8bda1eb50 +CMSIS_SVD_VERSION=7d9b4167010feed9e59ac45e56519180295b3813 if [ -e "cmsis-${CMSIS_VERSION}-clean.tar.xz" ]; then echo "Not downloading cmsis-${CMSIS_VERSION}-clean.tar.xz again!" diff --git a/sources b/sources index 28719c2..b02afda 100644 --- a/sources +++ b/sources @@ -1,6 +1,6 @@ -SHA512 (tinygo-0.8.0.tar.gz) = 0f3750c3d216033342efc77fc419d9299202880bb9979f6db6c9e7f4c3f7b3792e5d407a0a9543b07c1ed8c08d16d062465e22cf392e5f71227d09afdf7275ea +SHA512 (tinygo-0.9.0.tar.gz) = 864e7ab0ddf98d77e6b88da6412bed606cde55c3fa82607f79bcb75270d7449980ab6d8f7137c0617122b09bcde81baf96cdc662717033a1c8e78800dc99ce09 SHA512 (avr-6624554c02b237b23dc17d53e992bf54033fc228.tar.gz) = 1aa157bd761db38f8680614fa1cf47d7009508f65291b7eaaa5aba1ae76d35103f68a42947b7269a170d2f1cf8fb09941a5d74070fe6d204b68dd15a9ad2ed29 SHA512 (cmsis-9fe411cef1cef5de58e5957b89760759de44e393-clean.tar.xz) = f131fc241f61982c49f334eb502c2f13da61eb7bdaa641ee84a8de30c4d576b735b8aadeafd7d75351473a2df6a42de6a236ecc5dcc616ee6cfcc07af29446f9 -SHA512 (cmsis_svd-5910f3d115a53ead55c8158da24a8fa8bda1eb50-clean.tar.xz) = 7187cade0e78bbd6e65a8f38109aa95783e71cc3fad445fc51ac8fca796845b8ad4b9b84335ef3aa725b9abb0c3ed72c768c0f7da5ecc7b14a505a328b625b47 +SHA512 (cmsis_svd-7d9b4167010feed9e59ac45e56519180295b3813-clean.tar.xz) = 013a5991a0fc170bd86e8c3cafe41b722061d9c631a51ecca762e00ea61ab2d14cb794a78a4ff8f449b10e32c8e746b07782da66f64599c7e6c8b17475f00428 SHA512 (compiler-rt-8.0.0.src.tar.xz) = fe9f69fe2269fa3d560ae97fdacd462f855fb0b7a5f647f5b8595206ff7febca6496725adc953de411a827c761e2b3ca11a2149f25707d6c62af0722b68ba913 SHA512 (nrfx-3ab39a9d457bfe627473ed0e03a7f1161d9e4f27.tar.gz) = 95b5293c9b707aeb4d8ad13643619c053ba0fa9423053a12f9a65b0ed8febc2aab87cd832e6ac73e9673987b7cb73f85cce68cb85ce4ca5bd607afee1098f9e9 diff --git a/tinygo.spec b/tinygo.spec index f98242b..5352b6f 100644 --- a/tinygo.spec +++ b/tinygo.spec @@ -5,12 +5,12 @@ # https://github.com/tinygo-org/tinygo %global goipath github.com/tinygo-org/tinygo -Version: 0.8.0 +Version: 0.9.0 %global CMSIS_commit 9fe411cef1cef5de58e5957b89760759de44e393 %global avr_commit 6624554c02b237b23dc17d53e992bf54033fc228 %global clang_version 8.0.0 -%global cmsis_svd_commit 5910f3d115a53ead55c8158da24a8fa8bda1eb50 +%global cmsis_svd_commit 7d9b4167010feed9e59ac45e56519180295b3813 %global compiler_rt_version 8.0.0 %global nrfx_commit 3ab39a9d457bfe627473ed0e03a7f1161d9e4f27 @@ -53,8 +53,8 @@ Patch0001: 0001-Use-Fedora-command-names.patch Patch0002: 0002-Skip-ARM-Linux-tests.patch # We can't include STM32 .svd files because of their weird license. Patch0003: 0003-Skip-STM32-tests.patch -# https://github.com/tinygo-org/tinygo/pull/590 -Patch0004: 0004-Allow-overridding-Python-used-for-generators.patch +# Fix import path. +Patch0004: 0004-Use-go-mod-expected-path-for-go.bug.st-serial.patch # Not supported upstream yet. ExcludeArch: armv7hl ppc64le s390x @@ -62,6 +62,7 @@ ExcludeArch: armv7hl ppc64le s390x BuildRequires: clang-devel = %{clang_version} BuildRequires: golang(github.com/blakesmith/ar) BuildRequires: golang(github.com/marcinbor85/gohex) +BuildRequires: golang(go.bug.st/serial) BuildRequires: golang(golang.org/x/tools/go/ast/astutil) BuildRequires: golang(golang.org/x/tools/go/ssa) BuildRequires: golang(tinygo.org/x/go-llvm) @@ -184,6 +185,9 @@ PATH=%{buildroot}%{_bindir}:$PATH make smoketest AVR=0 RISCV=0 %changelog +* Mon Feb 10 2020 Elliott Sales de Andrade - 0.9.0-1 +- Update to latest version + * Tue Sep 24 2019 Elliott Sales de Andrade - 0.8.0-1 - Update to latest version - Enable x86 build