diff options
author | Ayke van Laethem <[email protected]> | 2019-07-31 20:32:18 +0200 |
---|---|---|
committer | Ron Evans <[email protected]> | 2019-08-04 17:12:07 +0200 |
commit | 54169c714fb9e9142fed5e7a70897ff466f31d28 (patch) | |
tree | 9af262727bddfa1ffd8b330addba429895244a0b | |
parent | f76385850dd0d38585085ecf3fcba2e9e32ad731 (diff) | |
download | tinygo-54169c714fb9e9142fed5e7a70897ff466f31d28.tar.gz tinygo-54169c714fb9e9142fed5e7a70897ff466f31d28.zip |
all: use baremetal build tag
This simplifies adding more baremetal targets, like a GameBoy Advance,
or baremetal x86 for unikernels.
-rw-r--r-- | compiler/compiler.go | 2 | ||||
-rw-r--r-- | compiler/gc.go | 2 | ||||
-rw-r--r-- | src/machine/i2c.go | 2 | ||||
-rw-r--r-- | src/machine/machine_generic.go | 2 | ||||
-rw-r--r-- | src/machine/spi.go | 2 | ||||
-rw-r--r-- | src/os/file_other.go | 2 | ||||
-rw-r--r-- | src/os/file_unix.go | 2 | ||||
-rw-r--r-- | src/runtime/arch_arm.go | 2 | ||||
-rw-r--r-- | src/runtime/baremetal.go | 2 | ||||
-rw-r--r-- | src/runtime/gc_globals_conservative.go | 2 | ||||
-rw-r--r-- | src/runtime/gc_globals_precise.go | 2 | ||||
-rw-r--r-- | src/runtime/gc_stack_portable.go | 2 | ||||
-rw-r--r-- | src/runtime/gc_stack_raw.go | 2 | ||||
-rw-r--r-- | src/runtime/runtime_unix.go | 2 | ||||
-rw-r--r-- | src/syscall/syscall_baremetal.go | 2 | ||||
-rw-r--r-- | src/syscall/tables_baremetal.go | 2 | ||||
-rw-r--r-- | targets/avr.json | 2 | ||||
-rw-r--r-- | targets/cortex-m.json | 2 | ||||
-rw-r--r-- | targets/riscv.json | 2 |
19 files changed, 19 insertions, 19 deletions
diff --git a/compiler/compiler.go b/compiler/compiler.go index c68a40106..c12aec89d 100644 --- a/compiler/compiler.go +++ b/compiler/compiler.go @@ -226,7 +226,7 @@ func (c *Compiler) Compile(mainPath string) []error { return path } else if path == "syscall" { for _, tag := range c.BuildTags { - if tag == "avr" || tag == "cortexm" || tag == "darwin" || tag == "riscv" { + if tag == "baremetal" || tag == "darwin" { return path } } diff --git a/compiler/gc.go b/compiler/gc.go index e6b196141..d9679efca 100644 --- a/compiler/gc.go +++ b/compiler/gc.go @@ -18,7 +18,7 @@ func (c *Compiler) needsStackObjects() bool { return false } for _, tag := range c.BuildTags { - if tag == "cortexm" || tag == "tinygo.riscv" { + if tag == "baremetal" { return false } } diff --git a/src/machine/i2c.go b/src/machine/i2c.go index 4fe7b816b..7270d918b 100644 --- a/src/machine/i2c.go +++ b/src/machine/i2c.go @@ -1,4 +1,4 @@ -// +build !stm32f4disco,!hifive1b +// +build avr nrf sam stm32,!stm32f4disco package machine diff --git a/src/machine/machine_generic.go b/src/machine/machine_generic.go index 7bfc5d2e8..f20fd4b96 100644 --- a/src/machine/machine_generic.go +++ b/src/machine/machine_generic.go @@ -1,4 +1,4 @@ -// +build !avr,!nrf,!sam,!sifive,!stm32 +// +build !baremetal package machine diff --git a/src/machine/spi.go b/src/machine/spi.go index f79c8a242..b913f2000 100644 --- a/src/machine/spi.go +++ b/src/machine/spi.go @@ -1,4 +1,4 @@ -// +build !stm32f407,!avr,!hifive1b +// +build nrf sam stm32,!stm32f407 package machine diff --git a/src/os/file_other.go b/src/os/file_other.go index 8d168ebc4..50bfa226f 100644 --- a/src/os/file_other.go +++ b/src/os/file_other.go @@ -1,4 +1,4 @@ -// +build avr cortexm tinygo.riscv wasm +// +build baremetal wasm package os diff --git a/src/os/file_unix.go b/src/os/file_unix.go index d881f62fb..b4aaa7722 100644 --- a/src/os/file_unix.go +++ b/src/os/file_unix.go @@ -1,4 +1,4 @@ -// +build darwin linux,!avr,!cortexm,!tinygo.riscv +// +build darwin linux,!baremetal package os diff --git a/src/runtime/arch_arm.go b/src/runtime/arch_arm.go index 6f75323bb..a84ccfda9 100644 --- a/src/runtime/arch_arm.go +++ b/src/runtime/arch_arm.go @@ -1,4 +1,4 @@ -// +build arm,!avr,!cortexm,!tinygo.riscv +// +build arm,!baremetal package runtime diff --git a/src/runtime/baremetal.go b/src/runtime/baremetal.go index 90c15628b..b5acdfec3 100644 --- a/src/runtime/baremetal.go +++ b/src/runtime/baremetal.go @@ -1,4 +1,4 @@ -// +build avr cortexm tinygo.riscv +// +build baremetal package runtime diff --git a/src/runtime/gc_globals_conservative.go b/src/runtime/gc_globals_conservative.go index a09d01ae2..b4882d6ee 100644 --- a/src/runtime/gc_globals_conservative.go +++ b/src/runtime/gc_globals_conservative.go @@ -1,5 +1,5 @@ // +build gc.conservative -// +build cortexm tinygo.riscv +// +build baremetal package runtime diff --git a/src/runtime/gc_globals_precise.go b/src/runtime/gc_globals_precise.go index 464c8e037..79659b788 100644 --- a/src/runtime/gc_globals_precise.go +++ b/src/runtime/gc_globals_precise.go @@ -1,5 +1,5 @@ // +build gc.conservative -// +build !cortexm,!tinygo.riscv +// +build !baremetal package runtime diff --git a/src/runtime/gc_stack_portable.go b/src/runtime/gc_stack_portable.go index 1f1847c31..b1840bc27 100644 --- a/src/runtime/gc_stack_portable.go +++ b/src/runtime/gc_stack_portable.go @@ -1,5 +1,5 @@ // +build gc.conservative -// +build !cortexm,!tinygo.riscv +// +build !baremetal package runtime diff --git a/src/runtime/gc_stack_raw.go b/src/runtime/gc_stack_raw.go index 0c37af60d..62fff6b19 100644 --- a/src/runtime/gc_stack_raw.go +++ b/src/runtime/gc_stack_raw.go @@ -1,5 +1,5 @@ // +build gc.conservative -// +build cortexm tinygo.riscv +// +build baremetal package runtime diff --git a/src/runtime/runtime_unix.go b/src/runtime/runtime_unix.go index 61572ba7e..47c7316e7 100644 --- a/src/runtime/runtime_unix.go +++ b/src/runtime/runtime_unix.go @@ -1,4 +1,4 @@ -// +build darwin linux,!avr,!cortexm,!tinygo.riscv +// +build darwin linux,!baremetal package runtime diff --git a/src/syscall/syscall_baremetal.go b/src/syscall/syscall_baremetal.go index fe17fcabb..28fa39ba8 100644 --- a/src/syscall/syscall_baremetal.go +++ b/src/syscall/syscall_baremetal.go @@ -1,4 +1,4 @@ -// +build avr cortexm +// +build baremetal package syscall diff --git a/src/syscall/tables_baremetal.go b/src/syscall/tables_baremetal.go index c10799c0d..c081feace 100644 --- a/src/syscall/tables_baremetal.go +++ b/src/syscall/tables_baremetal.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build avr cortexm +// +build baremetal package syscall diff --git a/targets/avr.json b/targets/avr.json index a7a3773fe..474790a0d 100644 --- a/targets/avr.json +++ b/targets/avr.json @@ -1,5 +1,5 @@ { - "build-tags": ["avr", "linux", "arm"], + "build-tags": ["avr", "baremetal", "linux", "arm"], "goos": "linux", "goarch": "arm", "compiler": "avr-gcc", diff --git a/targets/cortex-m.json b/targets/cortex-m.json index 7fb1b0286..e8588e818 100644 --- a/targets/cortex-m.json +++ b/targets/cortex-m.json @@ -1,5 +1,5 @@ { - "build-tags": ["cortexm", "linux", "arm"], + "build-tags": ["cortexm", "baremetal", "linux", "arm"], "goos": "linux", "goarch": "arm", "compiler": "clang", diff --git a/targets/riscv.json b/targets/riscv.json index 581c5e8ce..33475eb24 100644 --- a/targets/riscv.json +++ b/targets/riscv.json @@ -2,7 +2,7 @@ "llvm-target": "riscv32--none", "goos": "linux", "goarch": "arm", - "build-tags": ["tinygo.riscv", "linux", "arm"], + "build-tags": ["tinygo.riscv", "baremetal", "linux", "arm"], "gc": "conservative", "compiler": "riscv64-unknown-elf-gcc", "linker": "riscv64-unknown-elf-ld", |