all: use baremetal build tag
This simplifies adding more baremetal targets, like a GameBoy Advance, or baremetal x86 for unikernels.
Этот коммит содержится в:
родитель
f76385850d
коммит
54169c714f
19 изменённых файлов: 19 добавлений и 19 удалений
|
@ -226,7 +226,7 @@ func (c *Compiler) Compile(mainPath string) []error {
|
||||||
return path
|
return path
|
||||||
} else if path == "syscall" {
|
} else if path == "syscall" {
|
||||||
for _, tag := range c.BuildTags {
|
for _, tag := range c.BuildTags {
|
||||||
if tag == "avr" || tag == "cortexm" || tag == "darwin" || tag == "riscv" {
|
if tag == "baremetal" || tag == "darwin" {
|
||||||
return path
|
return path
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ func (c *Compiler) needsStackObjects() bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
for _, tag := range c.BuildTags {
|
for _, tag := range c.BuildTags {
|
||||||
if tag == "cortexm" || tag == "tinygo.riscv" {
|
if tag == "baremetal" {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build !stm32f4disco,!hifive1b
|
// +build avr nrf sam stm32,!stm32f4disco
|
||||||
|
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build !avr,!nrf,!sam,!sifive,!stm32
|
// +build !baremetal
|
||||||
|
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build !stm32f407,!avr,!hifive1b
|
// +build nrf sam stm32,!stm32f407
|
||||||
|
|
||||||
package machine
|
package machine
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build avr cortexm tinygo.riscv wasm
|
// +build baremetal wasm
|
||||||
|
|
||||||
package os
|
package os
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build darwin linux,!avr,!cortexm,!tinygo.riscv
|
// +build darwin linux,!baremetal
|
||||||
|
|
||||||
package os
|
package os
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build arm,!avr,!cortexm,!tinygo.riscv
|
// +build arm,!baremetal
|
||||||
|
|
||||||
package runtime
|
package runtime
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build avr cortexm tinygo.riscv
|
// +build baremetal
|
||||||
|
|
||||||
package runtime
|
package runtime
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// +build gc.conservative
|
// +build gc.conservative
|
||||||
// +build cortexm tinygo.riscv
|
// +build baremetal
|
||||||
|
|
||||||
package runtime
|
package runtime
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// +build gc.conservative
|
// +build gc.conservative
|
||||||
// +build !cortexm,!tinygo.riscv
|
// +build !baremetal
|
||||||
|
|
||||||
package runtime
|
package runtime
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// +build gc.conservative
|
// +build gc.conservative
|
||||||
// +build !cortexm,!tinygo.riscv
|
// +build !baremetal
|
||||||
|
|
||||||
package runtime
|
package runtime
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// +build gc.conservative
|
// +build gc.conservative
|
||||||
// +build cortexm tinygo.riscv
|
// +build baremetal
|
||||||
|
|
||||||
package runtime
|
package runtime
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build darwin linux,!avr,!cortexm,!tinygo.riscv
|
// +build darwin linux,!baremetal
|
||||||
|
|
||||||
package runtime
|
package runtime
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// +build avr cortexm
|
// +build baremetal
|
||||||
|
|
||||||
package syscall
|
package syscall
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// Use of this source code is governed by a BSD-style
|
// Use of this source code is governed by a BSD-style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
// +build avr cortexm
|
// +build baremetal
|
||||||
|
|
||||||
package syscall
|
package syscall
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"build-tags": ["avr", "linux", "arm"],
|
"build-tags": ["avr", "baremetal", "linux", "arm"],
|
||||||
"goos": "linux",
|
"goos": "linux",
|
||||||
"goarch": "arm",
|
"goarch": "arm",
|
||||||
"compiler": "avr-gcc",
|
"compiler": "avr-gcc",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"build-tags": ["cortexm", "linux", "arm"],
|
"build-tags": ["cortexm", "baremetal", "linux", "arm"],
|
||||||
"goos": "linux",
|
"goos": "linux",
|
||||||
"goarch": "arm",
|
"goarch": "arm",
|
||||||
"compiler": "clang",
|
"compiler": "clang",
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
"llvm-target": "riscv32--none",
|
"llvm-target": "riscv32--none",
|
||||||
"goos": "linux",
|
"goos": "linux",
|
||||||
"goarch": "arm",
|
"goarch": "arm",
|
||||||
"build-tags": ["tinygo.riscv", "linux", "arm"],
|
"build-tags": ["tinygo.riscv", "baremetal", "linux", "arm"],
|
||||||
"gc": "conservative",
|
"gc": "conservative",
|
||||||
"compiler": "riscv64-unknown-elf-gcc",
|
"compiler": "riscv64-unknown-elf-gcc",
|
||||||
"linker": "riscv64-unknown-elf-ld",
|
"linker": "riscv64-unknown-elf-ld",
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче