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

2784 коммитов

Автор SHA1 Сообщение Дата
deadprogram
f308d7d28c machine/badger2040: support for Badger 2040
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-05-24 15:02:23 +02:00
Ayke van Laethem
7729a36782 windows: use ThinLTO
Switch Windows builds to use ThinLTO. This gets us closer to using
ThinLTO everywhere.
2022-05-23 21:24:14 +02:00
Ayke van Laethem
5404c81ffd windows: scan globals conservatively
Scan globals conservatively by reading writable sections from the PE
header.

I'd like to get rid of needing to precisely scan globals eventually, and
this brings us one step closer. It also avoids a bug with ThinLTO on
Windows.
2022-05-23 21:24:14 +02:00
Dylan Arbour
b52310fed2 ci: Add arm64 build 2022-05-23 08:50:38 +02:00
Ayke van Laethem
046070074d darwin: add support for ThinLTO 2022-05-22 23:29:30 +02:00
Ayke van Laethem
c23a5b65ef darwin: support -size= flag
This is just basic support. It doesn't add support for reading DWARF,
because that's a bit complicated on MacOS (it isn't stored in the file
itself but separately in the object files). But at least this change
makes it possible to easily print executable sizes by section type like
for other operating systems.
2022-05-22 18:07:57 +02:00
Ayke van Laethem
b8e433821a interp: fix some buggy localValue handling
Bug:

 1. fn.locals[v.value] returns 0 (the default value) if v.value is not
    part of the fn.locals map.
 2. locals[fn.locals[v.value]] then returns the first local value, which
    is usually non-nil
 3. This incorrect value is then used as the operand value.

The manifestation of this convoluted bug was
https://github.com/tinygo-org/tinygo/issues/2842. It didn't occur more
often probably because it only seems to happen in practice with inline
assembly.

Fixes https://github.com/tinygo-org/tinygo/issues/2842
2022-05-22 15:08:17 +02:00
Ayke van Laethem
dd1a836903 interp: do not try to interpret past task.Pause()
For context, see:
https://github.com/tinygo-org/tinygo/pull/2863#issuecomment-1133875237

Basically, testdata/goroutine.go was doing `time.Sleep()` inside an init
function which broke because doing that from a non-goroutine is not
allowed. However, we never hit this bug because of
https://github.com/tinygo-org/tinygo/issues/2842 (I didn't investigate
exactly why).
2022-05-22 15:08:17 +02:00
Dan Kegel
4ed0936c0e darwin: adjust syscall suffix for arm64 2022-05-20 18:47:30 +02:00
Ayke van Laethem
7a5d4c9537 darwin: add support for arm64 GOARCH (aka Apple Silicon)
This patch adds support for generating GOOS=darwin GOARCH=arm64
binaries. This means that it will become possible to run `go test` on
recent Macs, for example.
2022-05-20 08:35:18 +02:00
Dylan Arbour
af6bbaf532 Use release built tinygo in Makefile
Closes #2795
2022-05-19 23:10:48 +02:00
Steven Kabbes
4c7449efe5 compiler: alignof [0]func() = 1
In the go protobuf code, a pattern is used to statically prevent
comparable structs by embedding:

```
type DoNotCompare [0]func()

type message struct {
  DoNotCompare
  data *uint32
}
```

Previously, sizezof(message{}) is 2 words large, but it only needs to be
1 byte.  Making it be 1 byte allows protobufs to compile slightly more
(though not all the way).
2022-05-19 08:02:32 +02:00
Ayke van Laethem
995e815b63 avr: enable testdata/map.go
The test needs a few changes to support low-memory devices but other
than that, it works fine.
2022-05-18 15:20:09 +02:00
Ayke van Laethem
109b5298c4 avr: use compiler-rt
This change adds support for compiler-rt, which supports float64 (unlike
libgcc for AVR). This gets a number of tests to pass that require
float64 support.

We're still using libgcc with this change, but libgcc will probably be
removed eventually once AVR support in compiler-rt is a bit more mature.

I've also pushed a fix for a small regression in our
xtensa_release_14.0.0-patched LLVM branch that has also been merged
upstream. Without it, a floating point comparison against zero always
returns true which is certainly a bug. It is necessary to correctly
print floating point values.
2022-05-18 15:20:09 +02:00
Ayke van Laethem
a94e03eff2 avr: get go test -target=simavr to work
This patch changes two things:

 1. It changes the default stack size. Without this change, the
    goroutine.go test doesn't pass (apparently there's some memory
    corruption).
 2. It moves the excluded tests so that they are skipped with a regular
    `-target=simavr`, not just when running all tests (without
    `-target`).
2022-05-18 15:20:09 +02:00
Damian Gryski
eb3d6261b4 builder: remove extra formatting verb from error message 2022-05-18 09:06:03 +02:00
deadprogram
15724848f9 build: install scoop without update to avoid bug ScoopInstaller/Scoop #4917
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-05-18 07:42:56 +02:00
Kenneth Bell
8f40b107d9 rp2040: replace sleep 'busy loop' with timer alarm 2022-05-17 12:41:24 +02:00
Ayke van Laethem
fa673f0827 Makefile: fix forced rebuild of LLVM
This is a small change that makes sure not to force a rebuild of LLVM
every time.

For example, I might run:

    make llvm-source
    make llvm-build ASSERT=1

And then I might make some temporary changes to LLVM to test out a patch
for example. So I run:

    make llvm-build

...and my whole build cache gets destroyed.

This commit addresses this issue by not forcing a re-run of CMake with
every `make llvm-build` invocation.
2022-05-10 16:40:39 +02:00
Elliott Sales de Andrade
e3fe6d8f37 Skip slice-copy test for LLVM < 14
Fixes #2836
2022-05-08 03:32:04 +02:00
Ayke van Laethem
5c23f6fb6c all: remove support for LLVM 11 and LLVM 12
This removes a lot of backwards compatibility cruft and makes it
possible to start using features that need LLVM 13 or newer.
For example:

  * https://github.com/tinygo-org/tinygo/pull/2637
  * https://github.com/tinygo-org/tinygo/pull/2830
2022-05-07 17:15:35 +02:00
Ayke van Laethem
5afb63df60 cgo: refactor
This is a large refactor of the cgo package. It should fix a number of
smaller problems and be a bit more strict (like upstream CGo): it for
example requires every Go file in a package to include the header files
it needs instead of piggybacking on imports in earlier files.

The main benefit is that it should be a bit more maintainable and easier
to add new features in the future (like static functions).

This breaks the tinygo.org/x/bluetooth package, which should be updated
before this change lands.
2022-05-06 17:22:22 +02:00
Dan Kegel
1d2c39c3b9 os: skip TestDirFSPathsValid on WASI to work around #2828 on windows 2022-05-03 05:36:55 +02:00
Dan Kegel
270a2f51fd os: skip TestDirFS on wasi until #2827 is fixed 2022-05-03 05:36:55 +02:00
Dan Kegel
e87cd23e87 os: Drop support for go 1.15
1.15 specific files deleted.
1.16 specific files folded carefully into generic files, with goal of reducing diff with upstream.
Follows upstream 1.16 in making PathError etc. be aliases for the same errors in io/fs.

This fixes #2817 and lets us add io/ioutil to "make test-tinygo" on linux and mac.
2022-05-03 05:36:55 +02:00
deadprogram
db389ba443 all: update version for next development iteration
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-05-03 04:57:08 +02:00
Ayke van Laethem
d1dfa1155c ci: fix Go version in ARM build 2022-05-02 08:27:13 +02:00
Ayke van Laethem
cf0b7edc78 all: release v0.23.0 2022-04-28 17:51:09 +02:00
Damian Gryski
a32cda7a4c testdata: move map growth test to map.go 2022-04-28 09:14:45 +02:00
Damian Gryski
b251ce7b33 src/runtime: return a nil pointer for compiler bugs in hashmap code
We'll still panic if there's a compiler bug, but at least we'll have smaller
code in all the cases where we don't.
2022-04-28 09:14:45 +02:00
Damian Gryski
1abe1203a3 src/runtime: make hashmap calculations more uintptr-size independent 2022-04-28 09:14:45 +02:00
Damian Gryski
8b360ec911 src/runtime: remove extra if check in hashmap set logic 2022-04-28 09:14:45 +02:00
Damian Gryski
93654544b3 src/runtime: prevent overflow when calculating hashmap growth limits 2022-04-28 09:14:45 +02:00
Damian Gryski
050d516264 testdata: add test for mapgrowth logic 2022-04-28 09:14:45 +02:00
Damian Gryski
9a8328fcb7 src/runtime/hashmap: comments for iterator structure 2022-04-28 09:14:45 +02:00
Damian Gryski
6812a4dc04 src/runtime: first darft of map growth code
Fixes #1553
2022-04-28 09:14:45 +02:00
Ayke van Laethem
8568d4f625 esp32: add support for running and debuggin using qemu-esp32 2022-04-28 07:50:03 +02:00
Ayke van Laethem
bd56636d58 all: make emulator command a string instead of a []string
This matches the flash-command and is generally a bit easier to work
with.
This commit also prepares for allowing multiple formats to be used in
the emulator command, which is necessary for the esp32.
2022-04-28 07:50:03 +02:00
Ayke van Laethem
4fe3a379a5 ci: add ARM build, cross compiled on an amd64 host
I'm making this so I don't have to build all the releases on my
Raspberry Pi at home, and to make the process more reproducible.
2022-04-27 22:47:53 +02:00
deadprogram
fce42fc7fa machine/thingplus: rename to the singular thing as that it the correct name
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-04-26 21:13:17 +02:00
Ayke van Laethem
5d177d1328 runtime: be able to deal with a very small heap
See the comment in the source for details.

Also see the discussion in
https://github.com/tinygo-org/tinygo/pull/2755, which originally
triggered this bug.

Somewhat surprising, this results in a slight code size decrease for ARM
targets of a few bytes.
2022-04-26 17:47:21 +02:00
lincolngill
9eb4a6268a
Pico adc input ch support (#2737)
machine/rp2040: ADC changes, including
* Add rp2040 ADC mux channel support. Internal temp sensor reading and fix for incorrect setting of CS.AINSEL reg bits
* Reset ADC ref voltage in InitADC
2022-04-26 11:49:38 +02:00
deadprogram
11a402de95 docs: update list of currently supported boards
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-04-26 07:47:34 +02:00
Dan Kegel
cdd9198888 github: also do tinygo-test-wasi-fast on windows 2022-04-25 17:59:39 +02:00
Dan Kegel
6055e6eb23 Makefile: compress/lzw fails on windows wasi, see #2800, not plain windows. 2022-04-25 17:59:39 +02:00
Dan Kegel
9239c61edb TestChdir: avoid cd .., as wasi does not really support it yet. Tiptoes around #2799. 2022-04-25 17:59:39 +02:00
deadprogram
008b373df4 build: use latest Windows hosted runner version
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-04-25 17:15:59 +02:00
deadprogram
c387a09f54 build: use Go 1.18.1 for all builds
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-04-25 17:15:59 +02:00
deadprogram
5bb3ca2618 machine/circuitplay-bluefruit: move pin mappings so board can be compiled for WASM use in Playground
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-04-25 11:17:42 +02:00
Yurii Soldak
a4ea85b303 xiao-ble: initial support 2022-04-24 14:50:02 +02:00