aboutsummaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2024-07-26Revert "Getting DeepEqual to work with maps whose key is an interface (#4360)"revert-MapIndex-changeAyke van Laethem
This reverts commit 1fd75ffbda1ff021289f2feb6a062434df68d8b7. The change is not correct and allows code to continue while it should panic. For details, see: https://github.com/tinygo-org/tinygo/pull/4360#issuecomment-2252943012
2024-07-24Getting DeepEqual to work with maps whose key is an interface (#4360)Laurent Demailly
reflect: Getting DeepEqual to work with maps whose key is an interface
2024-07-23Add missing T.DeadlineLaurent Demailly
2024-07-23add Fork and Exec libc hooksleongross
Signed-off-by: leongross <[email protected]>
2024-07-22all: add linux/mipsle supportAyke van Laethem
This adds linux/mipsle (little endian Mips) support to TinyGo. It also adds experimental linux/mips (big-endian) support. It doesn't quite work yet, some parts of the standard library (like the reflect package) currently seem to assume a little-endian system.
2024-07-21build: add package ID to compiler and optimization error messagesAyke van Laethem
This improves error reporting slightly.
2024-07-21os/Chown (#4213)leongross
src/os, src/syscall: add os.Chown
2024-07-21net: update to latest net packagedeadprogram
Signed-off-by: deadprogram <[email protected]>
2024-07-20Add enough tls.ConnectionState and tls.CipherSuiteName() to compile ↵Laurent Demailly
fortio/log (#4345) src/crypt: add enough tls.ConnectionState and tls.CipherSuiteName() to compile fortio/log
2024-07-20rewrite Reply() to fix sending long replies in I2C Target ModeMatthew Hiles
2024-07-20Allows compilation of code using debug.BuildInfo and show correct tinygo ↵Laurent Demailly
version (#4343) debug: Allows compilation of code using debug.BuildInfo and show correct tinygo version
2024-07-20diagnostics: sort package diagnostics by positionAyke van Laethem
Previously, the error messages could be shown out of order. With this patch, the errors are sorted before being shown to the user. This makes it easier to read the error messages, and matches what the `go` toolchain does.
2024-07-20diagnostics: move diagnostic printing to a new packageAyke van Laethem
This is a refactor, which should (in theory) not change the behavior of the compiler. But since this is a pretty large change, there is a chance there will be some regressions. For that reason, the previous commits added a bunch of tests to make sure most error messages will not be changed due to this refactor.
2024-07-20main: add test for error coming from the optimizerAyke van Laethem
This is just one optimizer pass that's easy to test for. There are others, but I'm ignoring them for now. The one other that would be reasonable to test is when starting a goroutine with -gc=none, but I'm leaving that one for another time.
2024-07-20main: add error tests for the compilerAyke van Laethem
The compiler can in fact return errors, but these weren't tested yet.
2024-07-20main: add interp testsAyke van Laethem
This one needed more advanced checking of the error messages, because we don't want to hardcode things like `!dbg !10` in the output.
2024-07-20main: refactor error messages to use FileCheck-like patternsAyke van Laethem
Match the error messages in testdata/errors/*.go like LLVM FileCheck, which includes regular expressions. I believe this is much more flexible, and LLVM uses it in nearly all of their tests so it must work quite well for compilers.
2024-07-20fix: set ubuntu version to 24.04 to try to address #4347deadprogram
Signed-off-by: deadprogram <[email protected]>
2024-07-18syscall: remove some dead codeAyke van Laethem
Not sure why it's here but it's not referenced anywhere.
2024-07-17all: simplify wasm-tools-go dependencyRandy Reddig
- add internal/wasm-tools/go.mod file to depend on wasm-tools-go - copy package cm into src/internal/cm - remove wasm-tools-go "vendor" submodule internal/tools: fix typo go.{mod,sum}, internal/tools: add wit-bindgen-go to tools GNUmakefile: use go run for wit-bindgen-go GNUmakefile: add tools target to go:generate tools binaries in internal/tools GNUmakefile: add .PHONY for lint and spell GNUmakefile, internal/cm: vendor package cm into internal/cm go.{mod,sum}: update wasm-tools-go to v0.1.4 internal/wasi: use internal/cm package remove submodule src/vendor/github.com/ydnar/wasm-tools-go GNUmakefile: add comment documenting what wasi-cm target does go.{mod,sum}: remove toolchain; go mod tidy go.mod: revert to Go 1.19 go.mod: go 1.19 go.{mod,sum}, internal/{tools,wasm-tools}: revert root go.mod file to go1.19 Create a wasm-tools specific module that can require go1.22 for wasm-tools-go.
2024-07-15add chromeos 9p supportTai Groot
2024-07-14Do not stop compilation on compiler warningsAnatol Pomozov
Compilers like GCC keep adding new checks that produce new warnings. Sometimes it can be false positives. Do not treat such warnings in binaryen library as errors. tinygo won't be able to provide zero warnings in its dependencies. Closes #4332
2024-07-13loader: handle `go list` errors inside TinyGoAyke van Laethem
Instead of exiting with an error, handle these errors internally. This will enable a few improvements in the future.
2024-07-13libclang: do not make error locations relativeAyke van Laethem
This is done at a later time anyway, so doesn't need to be done in the cgo package. In fact, _not_ doing it there makes it easier to print correct relative packages.
2024-07-13all: add testing for compiler error messagesAyke van Laethem
This is needed for some improvements I'm going to make next. This commit also refactors error handling slightly to make it more easily testable, this should hopefully not result in any actual changes in behavior.
2024-07-13builder: remove workaround for generics race conditionAyke van Laethem
This commit reverts commit 13a8eae0d. It appars that the race has been fixed by https://github.com/golang/tools/commit/db513b091504, which we now use because it fixes another race condition as well. See: https://github.com/tinygo-org/tinygo/issues/4206
2024-07-13cgo: support preprocessor macros passed on the command lineAyke van Laethem
Go code might sometimes want to use preprocessor macros that were passed on the command line. This wasn't working before and resulted in the following error: internal error: could not find file where macro is defined This is now supported, though location information isn't available (which makes sense: the command line is not a file). I had to use the `clang_tokenize` API for this and reconstruct the original source location. Apparently this is the only way to do it: https://stackoverflow.com/a/19074846/559350 In the future we could consider replacing our own tokenization with the tokenizer that's built into Clang directly. This should reduce the possibility of bugs a bit.
2024-07-09fix: remove message after test binary builtDmitry Shemin
2024-07-08main_test: Diff expected and actual results when tests fail (#4288)L. Pereira
Uses a vendored "internal/diff" from Big Go to show the differences between the expected and actual outputs when tests fail. Signed-off-by: L. Pereira <[email protected]>
2024-07-08gc_leaking: Don't zero out new allocations in some targets (#4302)L. Pereira
Wasm linear memory is always initialized to zero by definition, so there's no need to waste time zeroing out this allocation. This is the case for freshly-obtained memory from mmap(). Signed-off-by: L. Pereira <[email protected]>
2024-07-08internal/wasi: update to [email protected] (#4326)Randy Reddig
* internal/wasi: update to [email protected] See https://github.com/ydnar/wasm-tools-go/releases/tag/v0.1.1 for additional information. * internal/wasi: update to [email protected] * internal/wasi: regenerate with [email protected]
2024-07-08runtime: implement dummy getAuxv to satisfy golang.org/x/sys/cpu (#4325)Elias Naur
Fixes the program package main import _ "golang.org/x/sys/cpu" func main() { }
2024-07-03transform: fix incorrect alignment of heap-to-stack transformAyke van Laethem
It assumed the maximum alignment was equal to sizeof(void*), which is definitely not the case. So this only worked more or less by accident previously. It now uses the alignment as specified by the frontend, or else `unsafe.Alignof(complex128)` which is typically the maximum alignment of a given platform (though this shouldn't really happen in practice: the optimizer should keep the 'align' attribute in place).
2024-07-03compiler: add 'align' attribute to runtime.alloc callsAyke van Laethem
This adds something like 'align 4' to the runtime.alloc calls, so that the compiler knows the alignment of the allocation and can optimize accordingly. The optimization is very small, only 0.01% in my small test. However, my plan is to read the value in the heap-to-stack transform pass to make it more correct and let it produce slightly more optimal code.
2024-07-02wasi preview 2 support (#4027)Damian Gryski
* all: wasip2 support Co-authored-by: Randy Reddig <[email protected]>
2024-06-28test: support GOOS/GOARCH pairs in the -target flagAyke van Laethem
This means it's possible to test just a particular OS/arch with a command like this: go test -run=Build -target=linux/arm I found it useful while working on MIPS support.
2024-06-27add support for unix.{RawSyscall,RawSyscallNoError}leongross
2024-06-27add support for unix.Syscall* invocationsleongross
Signed-off-by: leongross <[email protected]>
2024-06-27wasm-unknown: make sure the os package can be importedAyke van Laethem
See: https://github.com/tinygo-org/tinygo/issues/4314 The os package isn't particularly useful on wasm-unknown, but just like on baremetal systems it's imported by a lot of packages so it should at least be possible to import this package.
2024-06-25version: update to 0.33.0-devdeadprogram
Signed-off-by: deadprogram <[email protected]>
2024-06-25compiler: remove old atomics workaround for AVRAyke van Laethem
The bug should have been fixed in any LLVM version that we currently support.
2024-06-24machine: use new internal/binary packageAyke van Laethem
The encoding/binary package in Go 1.23 imports the slices package, which results in circular import when imported from the machine package. Therefore, encoding/binary cannot be used in the machine package. This commit fixes that by introducing a new internal/binary package that is just plain Go code without dependencies. It can be safely used anywhere (including the runtime if needed).
2024-06-23all: use latest version of x/toolsAyke van Laethem
We previously picked a work-in-progress patch, but this is the proper fix for this race condition. I think we should use that instead of relying on the previous work-in-progress patch.
2024-06-23remove unused registers for x86_64 linux syscallsleongross
Signed-off-by: leongross <[email protected]>
2024-06-16Release 0.32.0v0.32.0Ayke van Laethem
2024-06-15add SetReadDeadline stubleongross
2024-06-14Add smoke tests for machine packageAyke van Laethem
The machine package wasn't tested for every board. Therefore, add a new serial-like test that also tries to import the machine package. This should highlight potential issues in the future.
2024-06-12compiler: fix race condition by applying a proposed patchAyke van Laethem
This commit switches to v0.22.0 of golang.org/x/tools and then applies https://go-review.googlesource.com/c/tools/+/590815 to fix the race condition. In my testing, it seems to fix these issues.
2024-06-12all: drop support for Go 1.18Ayke van Laethem
Go 1.18 has been unsupported for quite a while now (the oldest supported version is Go 1.21). But more importantly, the golang.org/x/tools module now requires Go 1.19 or later. So we'll drop this older version.
2024-06-11targets: add cyw43439 tag to badger2040-w and also add new pico-w target for ↵deadprogram
wireless support Signed-off-by: deadprogram <[email protected]>