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

3490 коммитов

Автор SHA1 Сообщение Дата
Damian Gryski
069c397975 reflect: fix off-by-one in Zero sizing
Without this, pointers wouldn't be set to nil.  Add some tests.
2023-03-14 09:42:51 -07:00
Damian Gryski
e0aee1f23c reflect: Type.AssignableTo(): you can assign anything to interface{} 2023-03-14 17:07:23 +01:00
Damian Gryski
ad9f790dfc reflect: set Index field in Field() 2023-03-14 17:04:24 +01:00
Damian Gryski
f42d8b3056 debug: stub SetGCPercent() 2023-03-14 16:54:44 +01:00
Damian Gryski
04412cba0e reflect: add stub for StructOf() 2023-03-14 16:54:44 +01:00
Damian Gryski
3b2763896f reflect: add stubs for Method(), CanConvert(), ArrayOf() 2023-03-14 16:54:44 +01:00
Damian Gryski
fb394c7685 reflect: add UnsafeAddr() 2023-03-14 16:53:57 +01:00
Damian Gryski
a52cad3825 reflect: fix Addr() indirect value/flags and add tests. 2023-03-14 16:49:05 +01:00
Ayke van Laethem
0e94553b26 builder: add test to check for changes in binary size
This test only applies when using the built-in LLVM version. This way,
we have a stable LLVM version to test against. Distribution versions of
LLVM (especially Debian) tend to be patched in a way that affect the
results.
2023-03-13 22:57:02 +01:00
deadprogram
e6580bfff4 machine/rp2040: correct Flash implementation
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-03-12 23:53:59 +01:00
deadprogram
5db83f11df machine/flash: refactor to keep use of pure offset relative to start
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-03-12 23:53:59 +01:00
deadprogram
60366adfa8 machine/rp2040: implement Flash interface
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-03-12 23:53:59 +01:00
Kenneth Bell
faa449a9e1 arm: enable functions in RAM for go & cgo 2023-03-12 23:53:59 +01:00
sago35
08cf2b25c5 machine/rp2040: change uart to allow for a single pin 2023-03-12 13:41:29 +01:00
sago35
d6103222f7 wioterminal: fix pin definition of BCM13 2023-03-12 10:52:15 +01:00
Damian Gryski
69e5c5088d reflect: add support for remaining map types 2023-03-10 16:28:22 -08:00
Damian Gryski
a6084767b3 syscall: remove misleading comment about Stat_t fields 2023-03-10 15:01:48 -08:00
Damian Gryski
cf4a6d3253 syscall: add Timespec.Unix() for wasi.
This allows archive/tar to build (but not yet pass).
2023-03-10 15:01:48 -08:00
Damian Gryski
4716298044 os,syscall: Stat_t timespec fields are Atimespec on darwin
This allows archive/tar to build and pass.
2023-03-10 15:01:48 -08:00
Justin A. Wilson
7706c41bf6 Added missing TCPAddr and UDPAddr implementations to the net package 2023-03-10 10:11:32 -08:00
deadprogram
0bc19735f3 machine/samd51: disable/restore Flash cache on write/erase
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-03-09 06:42:41 +01:00
deadprogram
51c1579c3d machine/samd51: implement Flash interface
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-03-09 06:42:41 +01:00
Damian Gryski
6a45b73fcb compiler, reflect: replace package and name length with null-byte termination 2023-03-08 09:38:49 -08:00
Damian Gryski
2de64d3f4e compiler, reflect: add Type.PkgPath 2023-03-08 09:38:49 -08:00
Damian Gryski
c192c7376e targets: bump cortex-m-qemu default stack size 2023-03-08 09:38:49 -08:00
Damian Gryski
2a821d2a66 reflect: improve Value.String() 2023-03-08 09:38:49 -08:00
Damian Gryski
90af41d089 reflect: add Type.String() 2023-03-08 09:38:49 -08:00
Damian Gryski
7654d86d2c compiler, reflect: add support for named types 2023-03-08 09:38:49 -08:00
sago35
45f119de34 machine/atsamd51: remove extra BK0RDY clear 2023-03-08 09:40:01 +01:00
Ayke van Laethem
71be24e4f9 transform: add debug information to internal/task.stackSize
This has two benefits:
 1. It attributes these bytes to the internal/task package (in
    -size=full), instead of (unknown).
 2. It makes it possible to print the stack sizes variable in GDB.

This is what it might look like in GDB:

    (gdb) p 'internal/task.stackSizes'
    $13 = {344, 120, 80, 2048, 360, 112, 80, 120, 2048, 2048}
2023-03-08 07:09:46 +01:00
Ayke van Laethem
3701e6eac1 compiler: account for alignment with -size=full 2023-03-08 07:09:46 +01:00
Ayke van Laethem
0463d34887 compiler: emit correct alignment in debug info for global variables
Previously we were using a really weird calculation to determine the
alignment in bits - written by me (no idea what I was thinking at the
time, it's obviously incorrect). Just replace it with the much more
obviously correct multiplication by 8 to get bits from bytes.

Found while working on properly dealing with alignment in `-size=full`.
2023-03-08 07:09:46 +01:00
Ayke van Laethem
0b47b99448 builder: improve reading of DWARF variables
The compiler now uses DW_OP_plus_uconst in the address attribute of
DWARF variables. To be able to understand these addresses, we need to be
able to parse this opcode.

This commit should also improve the reliability of address parsing a
bit.
2023-03-08 07:09:46 +01:00
Ayke van Laethem
ea97c60959 builder: sizes: list interrupt vector as a pseudo-package for -size=full
This is another bit of memory that is now correctly accounted for in
`-size=full`.
2023-03-08 07:09:46 +01:00
Ayke van Laethem
de281191e0 builder: detect compiler-rt size usage
Previously the code size of the compiler-rt library might be displayed
like this:

```
   1050       0       0       0 |    1050       0 | /home/ayke/src/tinygo/tinygo/llvm-project/compiler-rt/lib/builtins
    146       0       0       0 |     146       0 | /home/ayke/src/tinygo/tinygo/llvm-project/compiler-rt/lib/builtins/arm
```

With this change, it is displayed nicely like this:

```
   1196       0       0       0 |    1196       0 | C compiler-rt
```
2023-03-08 07:09:46 +01:00
Ron Evans
fc28f513c7
machine/samd21: implement Flash interface (#3496)
machine/samd21: implement Flash interface
2023-03-08 06:06:49 +01:00
Ayke van Laethem
34ba0c1be1 ci: build LLVM with thread support on Windows
This should fix a number of concurrency/threading issues.

I had to force-disable concurrency in the linker using a hack. I'm not
entirely sure what the cause is, possibly the MinGW version (version 12
appears to work for me, while version 11 as used on the GitHub runner
image seems to be broken).
There are a few ways to fix this in a better way:
  * Fix the underlying cause (possibly by upgrading to MinGW-w64 12).
  * Add the `--threads` flag to the LLD MinGW linker, so we can use a
    regular parameter instead of this hack.
2023-03-07 22:38:14 +01:00
sago35
7ca45d61fc machine/rp2040: correct issue with spi pin validation 2023-03-07 21:11:57 +09:00
deadprogram
871cd66b98 build/linux: switch to ubuntu-20.04 for arm builds since ubuntu-18.04 is deprecated for GH actions runner
Signed-off-by: deadprogram <ron@hybridgroup.com>
2023-03-07 07:25:08 +01:00
Ayke van Laethem
192a55970f windows: disable parallelism on Windows
This is an attempt to figure out why the Windows CI keeps crashing. It
should be removed before the next release, by which point we should know
whether this has helped or not.
2023-03-06 18:48:55 +01:00
Ayke van Laethem
8babc47638 compiler: fix a race condition
There was a mostly benign race condition in the compiler. The issue was
that there is a check for type aliases (which can alias types in another
function), but this check was _after_ accessing a property of the
function that might not have been completed.

I don't think this can have any serious effects, as the function is
skipped anyway, but such bugs should certainly be fixed.
2023-03-06 09:30:11 +01:00
Ayke van Laethem
1cb702ac4c compiler: try harder to find source locations for constants
If there is no source location, at least use the file (but not line) for
debug information.

This attributes almost 1kB of string data for ./testdata/stdlib.go when
compiling for WASI.
2023-03-05 17:13:16 -08:00
Ayke van Laethem
c6ac1cc969 compiler: add debug location to string values
This is helpful for WebAssembly: it makes it possible to attribute many
more data to locations in the source code, which makes `-size=full` more
useful.
2023-03-05 17:13:16 -08:00
Ayke van Laethem
0ce539ad42 compiler; add position information to createConstant
Non-functional change. The position information will be used later to
emit debug info locations to string constants.
2023-03-05 17:13:16 -08:00
Christian Stewart
930255ff46 os: add IsTimeout function
Fixes build error: undefined: os.IsTimeout

Signed-off-by: Christian Stewart <christian@paral.in>
2023-03-05 22:24:36 +01:00
Damian Gryski
57ecf1acdc testdata: add brandondube/pctl to corpus 2023-03-05 10:08:36 -08:00
Justin A. Wilson
313c9e31dd Refactor EnableInterrupts and DisableInterrupts
Removes usage of AsmFull which required an optimization pass to remove the map parameter passed into it. This caused issues when compiling with -opt=0 where memory for the map was being allocated as an unintended side-effect of using AsmFull with no optimizations enabled.
2023-03-05 17:34:48 +01:00
Ayke van Laethem
d87e3ce330 compiler: add debug information to []embed.file slice global 2023-03-05 07:50:42 -08:00
Ayke van Laethem
11a6c84ea5 compiler: add debug information to //go:embed slice data 2023-03-05 07:50:42 -08:00
Ayke van Laethem
1d86b3f425 compiler: add debug info to []embed.files backing array 2023-03-05 07:50:42 -08:00