Граф коммитов

1921 коммит

Автор SHA1 Сообщение Дата
Ayke van Laethem
c60c36f0a8 all: use ExitCode() call to get exit code of exited process
This is an addition that landed in Go 1.12 but we couldn't use before
because we were supporting Go back until Go 1.11. It simplifies the code
around processes a bit.
2021-03-09 18:15:49 +01:00
Ayke van Laethem
e3aa13c2a6 all: replace strings.Replace with strings.ReplaceAll
This was an addition to Go 1.13 and results in slightly easier to read
code.
2021-03-09 18:15:49 +01:00
Ayke van Laethem
b0366743cd all: remove support for Go 1.11 and 1.12
Go 1.13 has some important improvements that we would like to use, such
as the new integer literals and `errors.Is` which both arrived in Go
1.13.
2021-03-09 18:15:49 +01:00
Ayke van Laethem
c54bdf8b51 runtime: add dummy debug package
This package does not implement any methods, which is of course not
useful. However, by creating this package in advance it's possible to
see the next issue that's preventing something from building in TinyGo.

Motivated by: https://github.com/tinygo-org/tinygo/issues/1634
2021-03-09 16:09:51 +01:00
sago35
1fd4669bee docs: add QT Py and Teensy 4.0 2021-03-09 16:07:50 +01:00
sago35
e36dfe58ac version: update TinyGo version to 0.18.0-dev 2021-03-07 08:53:48 +09:00
Ayke van Laethem
138befd8a2 all: release v0.17.0 2021-03-05 17:41:06 +01:00
Ayke van Laethem
3d13f9cfe1 transform: show better error message in coroutines lowering
A common error is when someone tries to export a blocking function. This
is not possible with the coroutines scheduler. Previously, it resulted
in an error like this:

    panic: trying to make exported function async: messageHandler

With this change, the error is much better and shows where it comes from
exactly:

    /home/ayke/tmp/export-async.go:8: blocking operation in exported function: messageHandler

    traceback:
    messageHandler
            /home/ayke/tmp/export-async.go:9:5
    main.foo
            /home/ayke/tmp/export-async.go:15:2
    runtime.chanSend
            /home/ayke/src/github.com/tinygo-org/tinygo/src/runtime/chan.go:494:12

This should make it easier to identify and fix the problem. And it
avoids a compiler panic, which is a really bad way of showing
diagnostics.
2021-03-05 14:42:43 +01:00
sago35
c4191da2a5 gdb: support -ocd-output on windows 2021-03-05 13:02:01 +01:00
sago35
3fdd1a9249 gdb: kill openocd if it does not exit 2021-03-05 11:16:42 +01:00
Ayke van Laethem
869baca117 wasi: specify wasi-libc in a different way
This way is more consistent with how picolibc is specified and allows
generating a helpful error message. This error message should never be
generated for TinyGo binary releases, only when doing local development.
2021-03-04 17:25:22 +01:00
Ayke van Laethem
9c3e479432 all: remove support for LLVM 9
This LLVM version breaks CI and is now relatively rather old anyway, so
remove support for it.

This also reverts a workaround for LLVM 9, see a9568932b ("maixbit:
workaround to avoid medium code model").
2021-03-04 15:46:05 +01:00
sago35
6e480e189d gdb: support daemonization on windows 2021-03-04 14:46:10 +01:00
Aaron Turner
dcff8b6478
Namespaced Wasm Imports so they don't conflict across modules, or reserved LLVM IR (#1661)
wasm: namespaced all of the wasm import functions
2021-03-03 07:55:53 +01:00
deadprogram
6862942c99 docs: update license for 2021
Signed-off-by: deadprogram <ron@hybridgroup.com>
2021-03-01 23:31:34 +01:00
deadprogram
abc478c294 Revert "Allow interrupts in stm32f103xx (#1466)" as discussed in #1608
This reverts commit 3bb994da9f.
2021-02-27 20:53:16 +01:00
Kenneth Bell
66f76833ad stm32: fix i2c and add stm32f407 i2c 2021-02-27 20:35:16 +01:00
deadprogram
24976a6974 machine/nrf52840+nxpmk66f18: rename files to match naming format for all other boards/machines
Signed-off-by: deadprogram <ron@hybridgroup.com>
2021-02-26 00:32:33 +01:00
sago35
e76729c6f3 fix 2021-02-25 13:39:33 +01:00
sago35
35c8707867 nrf52840: improve USBCDC 2021-02-25 13:39:33 +01:00
deadprogram
16e30c97d8 docs: update README for all boards added since last release
Signed-off-by: deadprogram <ron@hybridgroup.com>
2021-02-25 00:48:22 +01:00
Takeshi Yoneda
9841ac4acd WASI & darwin: support env variables based on libc
Signed-off-by: Takeshi Yoneda <takeshi@tetrate.io>
2021-02-24 14:22:17 +01:00
Ramon
c299386906
Add nrf52840-mdk-usb-dongle target (#1654)
machine/nrf52840: add support for nrf52840-mdk-usb-dongle target
2021-02-24 10:25:38 +01:00
deadprogram
afcc9d6608 build: add apt update that seems needed for when dependencies update or packages are removed
Signed-off-by: deadprogram <ron@hybridgroup.com>
2021-02-23 15:15:12 +01:00
Yongbin Kim
9f06798cb9 Fix typo in wasm_exec.js, syscall/js.valueLoadString() 2021-02-21 09:18:44 +01:00
Olaf Flebbe
ce407ddf1b fix/no-libxml2 2021-02-21 09:02:30 +01:00
Elliott Sales de Andrade
b689f14bb2 Add support for Go 1.16. 2021-02-19 23:46:55 +01:00
Tobias Kohlbau
4141a9f431 bump go.bug.st/serial to version 1.1.2
Bump version to 1.1.2 in order to support darwin/arm64 within tinygo.
See bugst/go-serial#96 for more information.

Signed-off-by: Tobias Kohlbau <tobias@kohlbau.de>
2021-02-19 21:49:42 +01:00
sago35
52a20cf3bb atsamd2x: avoid infinite loop when USBCDC is disconnected 2021-02-19 17:21:05 +01:00
sago35
1aac8a0cb1 atsamd5x: avoid infinite loop when USBCDC is disconnected 2021-02-19 17:20:15 +01:00
sago35
ba634c4cc7 atsamd2x: improve USBCDC 2021-02-16 14:52:05 +01:00
ardnew
681be2d4e3
STM32 I2C: replace addressable interface with simpler type (#1609)
machine/stm32: replace STM32 I2C addressable interface with simpler type
2021-02-16 13:03:29 +01:00
sago35
01b917fb11 atsamd5x: improve USBCDC 2021-02-16 12:48:52 +01:00
Kenneth Bell
d274e299ac stm32: update stm32-svd lib 2021-02-16 12:48:52 +01:00
Kenneth Bell
fcdaa83368 stm32-l5: corrected alt function and other review comments 2021-02-16 12:48:52 +01:00
Kenneth Bell
289e1aa197 stm32: Harmonization of UART logic 2021-02-16 12:48:52 +01:00
Kenneth Bell
af02c09b56 nucleol552ze: implementation with CLOCK, LED, and UART 2021-02-16 12:48:52 +01:00
Ayke van Laethem
801bd2a7ff avr: use Clang for compiling C and assembly files
This is one step towards an avr-gcc free TinyGo toolchain, something
that will make it easier to use AVR targets in TinyGo.
2021-02-12 01:10:06 +01:00
Ayke van Laethem
9c8ef5c48f digispark: split off attiny85 target
This split is similar to the atmega328p/arduino split and may be helpful
for adding other attiny85 boards or using the attiny85 without a board.
2021-02-12 01:10:06 +01:00
Ayke van Laethem
ab41c79de7 builder: wait for running jobs to finish
This avoids external commands from finishing after the TinyGo command
exits. For example, when testing out compiler-rt on AVR, I got the
following error:

    $ go install; and tinygo run -target=atmega1284p ./testdata/calls.go
    [... Clang error removed ...]
    error: failed to build /home/ayke/src/github.com/tinygo-org/tinygo/lib/compiler-rt/lib/builtins/extendsfdf2.c: exit status 1
    error: unable to open output file '/tmp/tinygo361380649/build-lib-compiler-rt/ffsdi2.c.o': 'No such file or directory'
    1 error generated.

That last error ("unable to open output file") is a spurious error
because the temporary directory has already been removed. This commit
waits until all running jobs have finished before returning, so that
these errors won't happen.
2021-02-11 19:43:46 +01:00
Ayke van Laethem
d3d4acaadf esp: add picolibc
With this change, it is possible to fully use CGo on ESP32/ESP8266
chips. The following will work:

    tinygo flash -target=d1mini       -port=/dev/ttyUSB0 ./testdata/cgo/
    tinygo flash -target=esp32-mini32 -port=/dev/ttyUSB0 ./testdata/cgo/

Previously it would produce output like the following:

    /tmp/tinygo905539688/main.o:(.literal.runtime.run$1$gowrapper+0x150): undefined reference to `strcpy'
    /tmp/tinygo905539688/main.o:(.literal.runtime.run$1$gowrapper+0x154): undefined reference to `strlen'
2021-02-11 10:50:29 +01:00
Ayke van Laethem
676a78776a esp8266: add compiler-rt library
With this change, it is possible to compile ./testdata/float.go for the
ESP8266 and run it successfully. Previously it would result in many
linker error like this:

    /tmp/tinygo494494333/main.o:(.literal.runtime.printfloat64+0x0): undefined reference to `__unorddf2'
    /tmp/tinygo494494333/main.o:(.literal.runtime.printfloat64+0x4): undefined reference to `__gtdf2'
    /tmp/tinygo494494333/main.o:(.literal.runtime.printfloat64+0xc): undefined reference to `__nedf2'
    /tmp/tinygo494494333/main.o:(.literal.runtime.printfloat64+0x10): undefined reference to `__ltdf2'
    /tmp/tinygo494494333/main.o:(.literal.runtime.printfloat64+0x1c): undefined reference to `__gedf2'

I have verified that the output on the serial console matches
./testdata/float.txt when run on the ESP8266.
2021-02-11 10:50:29 +01:00
Ayke van Laethem
8a54615a09 builder: add -mcpu flag while building libraries
This flag is important for the Xtensa backend because by default a more
powerful backend (ESP32) is assumed. Therefore, compiling for the
ESP8266 won't work by default and needs the -mcpu flag.
2021-02-11 10:50:29 +01:00
Ayke van Laethem
74fe213b15 builder: remove unused cacheKey parameter
This key was intended as some sort of cache key (as the name indicates)
but that never happened. Let's remove it to avoid clutter. The cacheLoad
and cacheStore functions are only used for C libraries (libc,
compiler-rt) so their caching behavior is a bit different from other
things worth caching.
2021-02-11 10:50:29 +01:00
Ayke van Laethem
2e9c3a1d8d cgo: add support for variadic functions
This doesn't yet add support for actually making use of variadic
functions, but at least allows (unintended) variadic functions like the
following to work:

    void foo();
2021-02-11 09:51:15 +01:00
Ayke van Laethem
5502182642 ci: remove bad symlink workaround on Windows
This workaround is no longer needed as the symlink in the LLVM source
tree has been removed.
2021-02-11 09:05:05 +01:00
Weston Schmidt
f4b4dd8d62 Add SPI support for Atmega based chips.
This is based on @Nerzal's #1398 PR, but is a bit of a refactor and
expansion to support all the Atmega based chips present in tinygo.
2021-02-10 12:56:48 +01:00
Ayke van Laethem
9f5bd2c460 ci: only build the necessary LLVM libraries and tools
This should improve rebuild time, but perhaps more importantly massively
reduces cache size which then reduces incremental build time.
2021-02-09 08:03:54 +01:00
Ayke van Laethem
d6cdf8ca28 machine: make I2C.Configure signature consistent
It's better to always return an error value (even if it is nil) for
consistency.
2021-02-07 14:06:49 +01:00
Ayke van Laethem
6c5409bd17 all: update go-llvm to use LLVM 11 on macOS 2021-02-07 10:09:09 +01:00