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

58 коммитов

Автор SHA1 Сообщение Дата
Ayke van Laethem
709a296150 os: add basic OS functionality 2019-02-05 17:37:55 +01:00
Ayke van Laethem
25cd982263
main: optionally build with LLD
When building statically against LLVM, LLD is also included now. When
included, the built in wasm-ld will automatically be used instead of the
external command.

There is also support for linking ELF files but because lld does not
fully support armv6m this is not yet enabled (it produces a warning).
2019-02-01 13:26:32 +01:00
Ayke van Laethem
9bbb233cf0
main: include prebuilt compiler-rt libraries in release tarball
This avoids depending on clang-7 to build compiler-rt for the most
common ARM microcontrollers.
2019-02-01 13:26:32 +01:00
Ayke van Laethem
05d2c14600
all: add static and release Makefile targets 2019-02-01 13:26:32 +01:00
Ayke van Laethem
8aed8d8c56
Makefile: rename tgo to tinygo 2019-02-01 13:26:32 +01:00
Ron Evans
8d1284cfe7
generator: generate device wrappers for Atmel SAM family
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-01-13 18:59:56 +01:00
Ron Evans
8734732d0c
build: Makefile needs to look at changes in all needed sub-directories to decide if rebuild is required
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2018-12-11 12:55:03 +01:00
Ayke van Laethem
e10d05c74f
loader: switch to custom program loader 2018-12-10 15:36:23 +01:00
Ron Evans
8325f2a53d
reelboard: support Reel Board (nrf52840 dev board)
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2018-12-01 18:25:36 +01:00
Ayke van Laethem
9392ef900d
avr: add support for the digispark
Blinking the on-board LED works. Nothing else has been tested yet.
2018-11-20 18:50:24 +01:00
Ayke van Laethem
bb3d05169d
interp: add new compile-time package initialization interpreter
This interpreter currently complements the Go SSA level interpreter. It
may stay complementary or may be the only interpreter in the future.

This interpreter is experimental and not yet finished (there are known
bugs!) so it is disabled by default. It can be enabled by passing the
-initinterp flag.

The goal is to be able to run all initializations at compile time except
for the ones having side effects. This mostly works except perhaps for a
few edge cases.

In the future, this interpeter may be used to actually run regular Go
code, perhaps in a shell.
2018-11-04 18:40:51 +01:00
Ayke van Laethem
a63af97e86
all: add emulation support for Cortex-M3 with QEMU 2018-10-08 17:07:19 +02:00
Ron Evans
269bef5494
microbit: add Makefile entries for target=microbit
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2018-10-07 19:06:00 +02:00
Ayke van Laethem
bdcac9ae42
Makefile: add gen-device-stm32 to gen-device target 2018-10-02 13:30:49 +02:00
Ayke van Laethem
eac81e5232
Makefile: run verbose 'make test' 2018-09-30 18:01:14 +02:00
Ayke van Laethem
d190bfccf6
Makefile: add 'make test' that runs go test 2018-09-25 13:49:03 +02:00
Ayke van Laethem
dc88948f55
Makefile: go fmt testdata/*.go 2018-09-25 13:45:50 +02:00
Ayke van Laethem
a86739d235
Makefile: add new packages to tgo dependencies 2018-09-23 01:17:46 +02:00
Ayke van Laethem
b2cbfa78ca
compiler: refactor compiler into separate package 2018-09-22 20:32:28 +02:00
Ayke van Laethem
b75a02e66d
compiler: refactor IR parts into separate package 2018-09-22 20:32:07 +02:00
Ayke van Laethem
c8587c7d1e
Makefile: go fmt more packages 2018-09-22 17:44:42 +02:00
Ayke van Laethem
dd5b5a381c
stm32: initial support 2018-09-22 01:51:44 +02:00
Ayke van Laethem
7c16f6c904
tools/gen-device-svd: make source URL configurable 2018-09-22 01:20:34 +02:00
Ayke van Laethem
87963d3d5b
compiler: add -size flag to replace size utility
The size flag has two modes:
  -size=short: prints data basically equivalent to the `size` program.
  -size=full:  tries to determine sizes per package (not entirely
               accurate).
2018-09-18 00:04:21 +02:00
Ayke van Laethem
13633133a5
Makefile: simplify make fmt
There is no C source file anymore `go fmt` will complain about.
2018-09-14 20:57:21 +02:00
Ayke van Laethem
e389d38dec
Makefile: improve gen-device* commands 2018-09-13 00:55:49 +02:00
Ayke van Laethem
18b3e8d156
gen-device: move to new tools directory 2018-09-13 00:55:18 +02:00
Ayke van Laethem
5e9e3bd1a0
Makefile: use the compiler driver directly 2018-09-12 23:55:13 +02:00
Ayke van Laethem
8ce139284a
all: remove last traces of the C runtime
This increases code size on the nrf, but it is a fixed increase and can
hopefully be reduced in the future.
The Makefile gets a lot smaller with this which is a huge advantage
(less build time complexity).
2018-09-12 23:26:30 +02:00
Ayke van Laethem
f7f7d4cbbc
runtime/nrf: translate nrf sleep function from C to Go
This is the last critical part of the C runtime.

Code size is reduced by 4 bytes for examples/blinky2 (probably due to
inlining) and is unchanged for examples/test.
2018-09-12 22:24:17 +02:00
Ayke van Laethem
0779ee6088
compiler: improve command line argument parsing
To get more compatibility with the go command, implement a similar
command line interface (with "tinygo build <package>" etc.).
Other than that, an all-round cleanup of command parsing.
2018-09-12 17:23:36 +02:00
Ayke van Laethem
9101ea11bf
examples: clean up examples and add blinky1 for Arduino
Arduino has trouble supporting anything that's not extremely simple, so
add a simple blinky example for it. Also, it may be useful anyway.
2018-09-05 16:40:46 +02:00
Ayke van Laethem
17b5b6ec5b
all: use less magic in memory-mapped IO
Don't store addresses in the values of registers, this leads to problems
with char arrays (among others). Instead, do it like it's done in C with
raw addresses cast to struct pointers.

This commit also splits gen-device.py, as AVR and ARM have very
different ideas of what a register is. It's easier to just keep them
separate.
2018-09-05 12:18:21 +02:00
Ayke van Laethem
93248c93ed
avr: remove device files, use them from a subrepository
These files don't really belong in this repository. It's better to
generate them automatically from a source, like the one provided by the
avr-rust project. So a new command `make gen-device-avr` has been
provided for this purpose.
2018-09-05 12:13:33 +02:00
Ayke van Laethem
92877f8371
Makefile: some cleanups
Remove $(GCC) and $(LLC) which were not used anymore, and display binary
size even when building for the host.
2018-09-04 21:32:56 +02:00
Ayke van Laethem
0746d61639
compiler: move optimizer into the binary 2018-09-04 19:20:49 +02:00
Ayke van Laethem
d4f5700625
Remove use of CGo in the runtime
CGo depends on syscall, which (in the standard library) depends on sync,
which depends on the runtime. There are also other import cycles. To be
able to use the syscall package from upstream, stop using CGo.
2018-08-29 20:01:33 +02:00
Ayke van Laethem
5f28b07f75
Enable aggressive code size optimizations: -Oz 2018-08-24 03:35:39 +02:00
Ayke van Laethem
ab3358e5a3
Add make fmt 2018-08-24 02:59:18 +02:00
Ayke van Laethem
a30ffa5c1e
Revert "Move coroutine passes from Makefile to compiler itself"
This reverts commit d9ca5f97fb.

There is a problem with coroutines that I haven't solved yet. Reverting
makes it work, for now.

Also, use a better coroutines flag for the LLVM opt tool.
2018-08-20 20:24:54 +02:00
Ayke van Laethem
d9ca5f97fb
Move coroutine passes from Makefile to compiler itself
This is much more convenient.
2018-08-20 04:31:01 +02:00
Ayke van Laethem
90fb0ee4eb
Add AVR support
This requires support in LLVM, as AVR support is still experimental. For
example, in bindings/go/build.sh, add
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=AVR to cmake_flags.
2018-06-07 18:35:54 +02:00
Ayke van Laethem
0d1b7239c1
Assorted allocator fixes 2018-06-07 18:24:31 +02:00
Ayke van Laethem
b8260ba554
Makefile: use -Os instead of -O1
This was left over from debugging.
2018-06-07 18:22:28 +02:00
Ayke van Laethem
0168bf7797
Add goroutines and function pointers 2018-06-07 14:48:24 +02:00
Ayke van Laethem
8df220a53b
Move to my own fork of LLVM 2018-06-07 13:20:09 +02:00
Ayke van Laethem
588910792d
Translate bootstrapping main from C to LLVM IR
This avoids needing a C compiler for every platform.
2018-06-03 17:38:16 +02:00
Ayke van Laethem
2fca772431 Makefile: Autodetect LLVM bin dir 2018-05-28 09:01:35 +02:00
Ayke van Laethem
8c426b406d Automatically convert .svd files to Go source files 2018-05-05 19:02:43 +02:00
Ayke van Laethem
5bbd41e9fb compiler: Implement -ffunction-sections work 2018-04-27 01:28:14 +02:00