aboutsummaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2024-11-18runtime: heapptr only needs to be initialized onceAyke van Laethem
There is no need to initialize it twice.
2024-11-18ci: run at least some tests on older Go/LLVM versionsAyke van Laethem
These should make sure basic functionality is still working. Using the `-short` flag to avoid taking too long to run all tests (and to install all the necessary emulators), and because some targets might not work in older Go/LLVM versions (such as WASI). This does _not_ run tests and checks against expected IR, because LLVM IR changes a lot across versions.
2024-11-18linux: add runtime.fcntl functionleongross
This is needed for the internal/syscall/unix package. Signed-off-by: leongross <[email protected]>
2024-11-15builder: whitelist temporary directory env var for Clang invocationAyke van Laethem
It looks like this breaks on Windows: https://github.com/tinygo-org/tinygo/issues/4557 I haven't confirmed this is indeed the problem, but it would make sense. And passing through the temporary directory seems like a good idea regardless, there's not much that could break due to that.
2024-11-15compiler, runtime: move constants into shared packageAyke van Laethem
Use a single package for certain constants that must be the same between the compiler and the runtime. While just using the same values in both places works, this is much more obvious and harder to mess up. It also avoids the need for comments pointing to the other location the constant is defined. And having it in code makes it possible for IDEs to analyze the source. In the future, more such constants and maybe algorithms can be added.
2024-11-15support to parse devl versionsivchari
Signed-off-by: sivchari <[email protected]>
2024-11-14wasm: tidy up wasm_exec.js a bitAyke van Laethem
2024-11-14ci: use TinyGo version in artifact filesAyke van Laethem
This avoids needing to rename them ourselves (which is kinda annoying) and also avoids mistakes in the process.
2024-11-14runtime: optimize findHeadAyke van Laethem
This is similar to https://github.com/tinygo-org/tinygo/pull/3899, but smaller and hopefully just as efficient. Thanks to @HattoriHanzo031 for starting this work, benchmarking, and for improving the performance of the code even further.
2024-11-14targets/wasm_exec: call process.exit() when go.run() returnsDamian Gryski
2024-11-13reflect: fix Copy of non-pointer array with size > 64bitsBen Krieger
2024-11-13reflect: add Value.Clear; support anytype->interface{}, Slice->(*)Array in ↵Ben Krieger
Value.Convert
2024-11-10goenv: read git hash embedded in the binaryAyke van Laethem
The git hash that's part of `tinygo version` is now read from the binary itself instead of embedding it with a `-ldflags` flag. This means it is also present when building TinyGo using `go build` or `go install`.
2024-11-08wasm: correctly return from run() in wasm_exec.jsAyke van Laethem
Instead of hanging forever, it should return the exit code from os.Exit.
2024-11-08wasm: support `//go:wasmexport` functions after a call to `time.Sleep`Ayke van Laethem
This fixes a bug where `//go:wasmexport` functions would not be allowed anymore after a call to `time.Sleep` (when using `-buildmode=default`).
2024-11-07runtime: remove unnecessary check for negative sleepTicks durationAyke van Laethem
This is now fixed for every target in the previous commit. Also see: https://github.com/tinygo-org/tinygo/pull/4239
2024-11-07runtime: don't call sleepTicks with a negative durationAyke van Laethem
There are rare cases where this can happen, see for example https://github.com/tinygo-org/tinygo/issues/4568
2024-11-07os: implement StartProcessleongross
Signed-off-by: leongross <[email protected]>
2024-11-04internal/wasm-tools, syscall: update to [email protected] (#4577)Randy Reddig
* internal/wasm-tools, internal/cm: update wasm-tools-go to v0.3.1 and regenerate bindings * syscall: use new (cm.Result).Result() method instead of OK() and Err()
2024-11-01goenv: update to new v0.35.0 development versionsago35
2024-11-01runtime/trace: stub all public methodsJoonas Bergius
Signed-off-by: Joonas Bergius <[email protected]>
2024-11-01compiler: allow deferred panicAyke van Laethem
This is rare, but apparently some programs do this: defer panic("...") This is emitted in the IR as a builtin function.
2024-11-01main: parse extldflags early so we can report the error messageAyke van Laethem
This avoids some weird behavior when the -extldflags flag cannot be parsed by TinyGo.
2024-11-01interrupt: fix bug in interrupt loweringAyke van Laethem
The alignment wasn't set, so defaulted to 4 (for a 32-bit int). LLVM saw this, and therefore assumed that a ptrtoint of the pointer would have had the lowest bits unset. That's an entirely valid optimization, except that we are using these globals for arbitrary values (and aren't actually using these globals). Fixed by setting alignment to 1. It works, though long-term we should maybe find a different solution for this.
2024-11-01test: show output even when a test binary didn't exit cleanlyAyke van Laethem
This was a problem on wasm, where node would exit with a non-zero exit code when there was a panic.
2024-11-01test: run TestWasmExportJS tests in parallelAyke van Laethem
2024-10-28tinygo: revise and simplify wasmtime argument handling (#4555)Randy Reddig
2024-10-28sync: don't use `volatile` in MutexAyke van Laethem
Volatile loads/stors are only useful for communication with interrupts or for memory-mapped I/O. They do not provide any sort of safety for sync.Mutex, while making it *appear* as if it is more safe. * `sync.Mutex` cannot be used safely inside interrupts, because any blocking calls (including `Lock`) will cause a runtime panic. * For multithreading, `volatile` is also the wrong choice. Atomic operations should be used instead, and the current code would not work for multithreaded programs anyway.
2024-10-28ci: remove 'shell: bash' lines from MacOS buildAyke van Laethem
Unlike Windows, we can just use the default shell here.
2024-10-25all: version v0.34.0v0.34.0Ayke van Laethem
2024-10-25GNUmakefile: do not use the -v flag in `go test`Ayke van Laethem
This makes it easier to find what actually went wrong in CI. This flag was added in #4431, I think it was unintentional.
2024-10-25runtime: bump markStackSizeDamian Gryski
Every time we overflow the stack, we have to do a full rescan of the heap. Making this larger means fewer overflows and thus fewer secondary+ heap scans.
2024-10-25machine/usb/adc/midi: fix PitchBendsago35
2024-10-25machine/usb/adc/midi: clarify operator precedencesago35
2024-10-24runtime: add gc layout info for some basic typesDamian Gryski
2024-10-23runtime: add support for os/signalAyke van Laethem
This adds support for enabling and listening to signals on Linux and MacOS.
2024-10-23wasm: use precise GC for WebAssembly (including WASI)Ayke van Laethem
With a few small modifications, all the problems with `-gc=precise` in WebAssembly seem to have been fixed. I didn't do any performance measurements, but this is supposed to improve GC performance.
2024-10-22compiler: conform to latest iteration of wasm types proposal (#4501)Randy Reddig
compiler: align with current wasm types proposal https://github.com/golang/go/issues/66984 - Remove int and uint as allowed types in params, results, pointers, or struct fields - Only allow small integers in pointers, arrays, or struct fields - enforce structs.HostLayout usage per wasm types proposal https://github.com/golang/go/issues/66984 - require go1.23 for structs.HostLayout - use an interface to check if GoVersion() exists This permits TinyGo to compile with Go 1.21. - use goenv.Compare instead of WantGoVersion - testdata/wasmexport: use int32 instead of int - compiler/testdata: add structs.HostLayout - compiler/testdata: improve tests for structs.HostLayout
2024-10-22Add sponsor button to key repositoriesDaniel Esteban
2024-10-22targets: add WaveShare ESP-C3-32S-KitAyke van Laethem
I've had this board for a while now, but never added proper TinyGo support. So here is a PR to do just that.
2024-10-22esp32c3: add smoke tests for a few boardsAyke van Laethem
These boards probably haven't been working since the addition of I2C, because they were missing some constants in the machine package.
2024-10-21fe310: support GPIO PinInputAyke van Laethem
This is needed to support switching between input and output.
2024-10-21goenv: parse patch version, add func Compare to compare two Go version ↵Randy Reddig
strings (#4536) goenv: parse patch version, add func Compare to compare two Go version strings * Parse tests * add Compare function to compare two Go version strings * goenv, builder: parse patch version in Go version string
2024-10-19runtime: use unsafe.Slice for leveldb codeDamian Gryski
2024-10-19runtime: use unsafe.Slice in tsip codeDamian Gryski
2024-10-19runtime: remove minSched hack for wasmAyke van Laethem
I am not entirely sure what it's doing (it seems related to js.FuncOf), but tests still seem to pass when this code is removed. So let's remove it.
2024-10-19wasm: add test for js.FuncOfAyke van Laethem
While there are some browser tests, Node.js is just a lot better for testing this kind of stuff because it's much faster and we don't need a browser for this.
2024-10-19ci: use macos-13 instead of macos-12 for amd64 buildsAyke van Laethem
The macos-12 runner is being deprecated, so we have to switch to a new runner: https://github.com/actions/runner-images/issues/10721 The next one is macos-13, which is still amd64.
2024-10-19compiler: mark stringFromRunes as nocapture/readonlyDamian Gryski
2024-10-19compiler: mark stringFromBytes as nocapture/readonly to help escape analysisDamian Gryski
Fixes #4525