From f0786b73cb647f2c8ef6b06ce18c5d76c06fe040 Mon Sep 17 00:00:00 2001 From: Elliott Sales de Andrade Date: Feb 10 2020 23:12:14 +0000 Subject: Merge branch 'f31' --- diff --git a/.gitignore b/.gitignore index d149836..77366fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,12 @@ -/avr-6624554c02b237b23dc17d53e992bf54033fc228.tar.gz -/cmsis-9fe411cef1cef5de58e5957b89760759de44e393-clean.tar.xz -/cmsis_svd-b6f0a65ac37760f52d6ade23dd3205424d6c91fa-clean.tar.xz -/compiler-rt-8.0.0.src.tar.xz -/nrfx-3ab39a9d457bfe627473ed0e03a7f1161d9e4f27.tar.gz +/avr-*.tar.gz +/cmsis-*.tar.gz +/cmsis-*-clean.tar.xz +/cmsis_svd-*.tar.gz +/cmsis_svd-*-clean.tar.xz +/compiler-rt-*.src.tar.xz +/nrfx-*.tar.gz /tinygo-0.6.0.tar.gz /tinygo-0.7.0.tar.gz -/cmsis_svd-5910f3d115a53ead55c8158da24a8fa8bda1eb50-clean.tar.xz +/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 new file mode 100644 index 0000000..2b9764e --- /dev/null +++ b/0001-Use-Fedora-command-names.patch @@ -0,0 +1,53 @@ +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. + +Signed-off-by: Elliott Sales de Andrade +--- + main_test.go | 2 +- + target.go | 8 ++++---- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/main_test.go b/main_test.go +index f0a574b..c65c463 100644 +--- a/main_test.go ++++ b/main_test.go +@@ -72,7 +72,7 @@ func TestCompiler(t *testing.T) { + continue // TODO: improve CGo + } + t.Run(path, func(t *testing.T) { +- runTest(path, tmpdir, "arm--linux-gnueabihf", t) ++ runTest(path, tmpdir, "arm--linux-none", t) + }) + } + +diff --git a/target.go b/target.go +index 655b5f2..e0c5e21 100644 +--- a/target.go ++++ b/target.go +@@ -195,7 +195,7 @@ func LoadTarget(target string) (*TargetSpec, error) { + } + target = llvmarch + "--" + llvmos + if goarch == "arm" { +- target += "-gnueabihf" ++ target += "-none" + } + return defaultTarget(goos, goarch, target) + } +@@ -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" { +- spec.Linker = "arm-linux-gnueabihf-gcc" +- spec.GDB = "arm-linux-gnueabihf-gdb" +- spec.Emulator = []string{"qemu-arm", "-L", "/usr/arm-linux-gnueabihf"} ++ 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" +-- +2.21.1 + diff --git a/0001-Use-system-path-for-TINYGOROOT-default.patch b/0001-Use-system-path-for-TINYGOROOT-default.patch deleted file mode 100644 index e9bf907..0000000 --- a/0001-Use-system-path-for-TINYGOROOT-default.patch +++ /dev/null @@ -1,41 +0,0 @@ -From e2bff2b9ed327434762915429e9033e81815b3ac Mon Sep 17 00:00:00 2001 -From: Elliott Sales de Andrade -Date: Fri, 7 Jun 2019 20:53:54 -0400 -Subject: [PATCH 1/4] Use system path for TINYGOROOT default. - -Signed-off-by: Elliott Sales de Andrade ---- - target.go | 17 ++--------------- - 1 file changed, 2 insertions(+), 15 deletions(-) - -diff --git a/target.go b/target.go -index 679fa19..fc4589b 100644 ---- a/target.go -+++ b/target.go -@@ -267,21 +267,8 @@ func sourceDir() string { - return root - } - -- // Find root from executable path. -- path, err := os.Executable() -- if err != nil { -- // Very unlikely. Bail out if it happens. -- panic("could not get executable path: " + err.Error()) -- } -- root = filepath.Dir(filepath.Dir(path)) -- if isSourceDir(root) { -- return root -- } -- -- // Fallback: use the original directory from where it was built -- // https://stackoverflow.com/a/32163888/559350 -- _, path, _, _ = runtime.Caller(0) -- root = filepath.Dir(path) -+ // Use system directory -+ root = "/usr/share/tinygo" - if isSourceDir(root) { - return root - } --- -2.21.0 - diff --git a/0002-Skip-ARM-Linux-tests.patch b/0002-Skip-ARM-Linux-tests.patch new file mode 100644 index 0000000..523fe22 --- /dev/null +++ b/0002-Skip-ARM-Linux-tests.patch @@ -0,0 +1,39 @@ +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. + +We don't have the C library to do this. + +Signed-off-by: Elliott Sales de Andrade +--- + main_test.go | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/main_test.go b/main_test.go +index c65c463..46bdbd1 100644 +--- a/main_test.go ++++ b/main_test.go +@@ -68,6 +68,9 @@ func TestCompiler(t *testing.T) { + if runtime.GOOS == "linux" { + t.Log("running tests for linux/arm...") + for _, path := range matches { ++ if true { ++ continue ++ } + if path == filepath.Join("testdata", "cgo")+string(filepath.Separator) { + continue // TODO: improve CGo + } +@@ -78,6 +81,9 @@ func TestCompiler(t *testing.T) { + + t.Log("running tests for linux/arm64...") + for _, path := range matches { ++ if true { ++ continue ++ } + if path == filepath.Join("testdata", "cgo")+string(filepath.Separator) { + continue // TODO: improve CGo + } +-- +2.21.1 + diff --git a/0002-Use-Fedora-command-names.patch b/0002-Use-Fedora-command-names.patch deleted file mode 100644 index cf0455b..0000000 --- a/0002-Use-Fedora-command-names.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 9c481e7c6a10829f2c0c423a83df8ba44c53d7d6 Mon Sep 17 00:00:00 2001 -From: Elliott Sales de Andrade -Date: Fri, 7 Jun 2019 20:55:25 -0400 -Subject: [PATCH 2/4] Use Fedora command names. - -Signed-off-by: Elliott Sales de Andrade ---- - main_test.go | 2 +- - target.go | 8 ++++---- - 2 files changed, 5 insertions(+), 5 deletions(-) - -diff --git a/main_test.go b/main_test.go -index fa85a82..f0d403c 100644 ---- a/main_test.go -+++ b/main_test.go -@@ -70,7 +70,7 @@ func TestCompiler(t *testing.T) { - continue // TODO: improve CGo - } - t.Run(path, func(t *testing.T) { -- runTest(path, tmpdir, "arm--linux-gnueabihf", t) -+ runTest(path, tmpdir, "arm--linux-none", t) - }) - } - -diff --git a/target.go b/target.go -index fc4589b..6c29ce8 100644 ---- a/target.go -+++ b/target.go -@@ -173,7 +173,7 @@ func LoadTarget(target string) (*TargetSpec, error) { - } - target = llvmarch + "--" + llvmos - if goarch == "arm" { -- target += "-gnueabihf" -+ target += "-none" - } - return defaultTarget(goos, goarch, target) - } -@@ -238,9 +238,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" { -- spec.Linker = "arm-linux-gnueabihf-gcc" -- spec.GDB = "arm-linux-gnueabihf-gdb" -- spec.Emulator = []string{"qemu-arm", "-L", "/usr/arm-linux-gnueabihf"} -+ 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" --- -2.21.0 - diff --git a/0003-Skip-ARM-Linux-tests.patch b/0003-Skip-ARM-Linux-tests.patch deleted file mode 100644 index f49bff3..0000000 --- a/0003-Skip-ARM-Linux-tests.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 761cf6fd8c4fc158eddd819f8eb394ff8dfd14bf Mon Sep 17 00:00:00 2001 -From: Elliott Sales de Andrade -Date: Wed, 12 Jun 2019 04:28:55 -0400 -Subject: [PATCH 3/4] Skip ARM Linux tests. - -We don't have the C library to do this. - -Signed-off-by: Elliott Sales de Andrade ---- - main_test.go | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/main_test.go b/main_test.go -index f0d403c..0f28752 100644 ---- a/main_test.go -+++ b/main_test.go -@@ -66,6 +66,9 @@ func TestCompiler(t *testing.T) { - if runtime.GOOS == "linux" { - t.Log("running tests for linux/arm...") - for _, path := range matches { -+ if true { -+ continue -+ } - if path == filepath.Join("testdata", "cgo")+string(filepath.Separator) { - continue // TODO: improve CGo - } -@@ -76,6 +79,9 @@ func TestCompiler(t *testing.T) { - - t.Log("running tests for linux/arm64...") - for _, path := range matches { -+ if true { -+ continue -+ } - if path == filepath.Join("testdata", "cgo")+string(filepath.Separator) { - continue // TODO: improve CGo - } --- -2.21.0 - diff --git a/0003-Skip-STM32-tests.patch b/0003-Skip-STM32-tests.patch new file mode 100644 index 0000000..8e85649 --- /dev/null +++ b/0003-Skip-STM32-tests.patch @@ -0,0 +1,56 @@ +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. + +We can't ship the STM32 .svd files due to their odd license. + +Signed-off-by: Elliott Sales de Andrade +--- + Makefile | 10 +--------- + 1 file changed, 1 insertion(+), 9 deletions(-) + +diff --git a/Makefile b/Makefile +index 7fc00df..73391f9 100644 +--- a/Makefile ++++ b/Makefile +@@ -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 + + +-gen-device: gen-device-avr gen-device-nrf gen-device-sam gen-device-sifive gen-device-stm32 ++gen-device: gen-device-avr gen-device-nrf gen-device-sam gen-device-sifive + + gen-device-avr: + $(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.hex -target=arduino examples/blinky1 + @$(MD5SUM) test.hex +-- +2.21.1 + diff --git a/0004-Skip-STM32-tests.patch b/0004-Skip-STM32-tests.patch deleted file mode 100644 index 8291a62..0000000 --- a/0004-Skip-STM32-tests.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 768f94cebe8f286043f6b37b77d2bc5c361a87cb Mon Sep 17 00:00:00 2001 -From: Elliott Sales de Andrade -Date: Thu, 13 Jun 2019 02:50:40 -0400 -Subject: [PATCH 4/4] Skip STM32 tests. - -We can't ship the STM32 .svd files due to their odd license. - -Signed-off-by: Elliott Sales de Andrade ---- - Makefile | 5 +---- - 1 file changed, 1 insertion(+), 4 deletions(-) - -diff --git a/Makefile b/Makefile -index 239a2df..c8ece47 100644 ---- a/Makefile -+++ b/Makefile -@@ -41,7 +41,7 @@ fmt-check: - @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-nrf gen-device-sam gen-device-sifive gen-device-stm32 -+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,8 +120,6 @@ 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 - ifneq ($(AVR), 0) - tinygo build -size short -o test.elf -target=arduino examples/blinky1 --- -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 e9f2eeb..b02afda 100644 --- a/sources +++ b/sources @@ -1,6 +1,6 @@ -SHA512 (tinygo-0.7.0.tar.gz) = 95c61c0b7c032507c398c94a831cad18a495ee377457a87ce486ee32ba82359573ded3d9db219692727e9109e8f72afaeffc5ce18e28902ec1cc5e208af00499 +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 f87e08b..5352b6f 100644 --- a/tinygo.spec +++ b/tinygo.spec @@ -5,17 +5,18 @@ # https://github.com/tinygo-org/tinygo %global goipath github.com/tinygo-org/tinygo -Version: 0.7.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 -# To match regular Go's /usr/share/gocode -%global tinygoroot %{_prefix}/share/tinygo +# No longer matching regular Go's /usr/share/gocode because it also provides +# pre-compiled binaries, and symlinks to arch-specific clang headers. +%global tinygoroot %{_libdir}/tinygo %gometa @@ -28,7 +29,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 @@ -47,19 +48,21 @@ 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 # Fedora-specific. -Patch0001: 0001-Use-system-path-for-TINYGOROOT-default.patch -Patch0002: 0002-Use-Fedora-command-names.patch +Patch0001: 0001-Use-Fedora-command-names.patch # We don't have ARM glibc to build these. -Patch0003: 0003-Skip-ARM-Linux-tests.patch +Patch0002: 0002-Skip-ARM-Linux-tests.patch # We can't include STM32 .svd files because of their weird license. -Patch0004: 0004-Skip-STM32-tests.patch +Patch0003: 0003-Skip-STM32-tests.patch +# Fix import path. +Patch0004: 0004-Use-go-mod-expected-path-for-go.bug.st-serial.patch # Not supported upstream yet. -ExcludeArch: %{ix86} armv7hl ppc64le s390x +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) @@ -113,12 +116,13 @@ rm lib/nrfx/.gitignore chmod -x lib/nrfx/doc/generate_html_doc.sh mkdir lib/clang -ln -s /usr/lib64/clang/%{clang_version}/include lib/clang/include +ln -s %{_libdir}/clang/%{clang_version}/include lib/clang/include %build +export LDFLAGS="-X main.TINYGOROOT=%{tinygoroot} " %gobuild -o %{gobuilddir}/bin/tinygo %{goipath} -GO111MODULE=off %make_build gen-device +GO111MODULE=off %make_build gen-device PYTHON=%{__python3} for target in armv6m-none-eabi armv7m-none-eabi armv7em-none-eabi; do TINYGOROOT=$PWD \ %{gobuilddir}/bin/tinygo \ @@ -181,8 +185,15 @@ PATH=%{buildroot}%{_bindir}:$PATH make smoketest AVR=0 RISCV=0 %changelog -* Fri Jan 31 2020 Fedora Release Engineering - 0.7.0-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild +* 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 + +* Sun Aug 04 2019 Elliott Sales de Andrade - 0.7.1-1 +- Update to latest version * Sat Jul 27 2019 Fedora Release Engineering - 0.7.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild