riscv: use LLVM tools instead of GNU toolchain
Now that we use LLVM 9, RISC-V support in LLVM has far fewer bugs and we can avoid the GNU toolchain. * replace GNU linker with lld * replace GCC with clang Additionally, RISC-V was promoted to stable so it can be enabled by default in CI.
Этот коммит содержится в:
родитель
06647aab24
коммит
d441f0152f
5 изменённых файлов: 11 добавлений и 12 удалений
|
@ -67,7 +67,7 @@ commands:
|
||||||
- run: go install .
|
- run: go install .
|
||||||
- run: go test -v ./cgo ./compileopts ./interp ./transform .
|
- run: go test -v ./cgo ./compileopts ./interp ./transform .
|
||||||
- run: make gen-device -j4
|
- run: make gen-device -j4
|
||||||
- run: make smoketest RISCV=0
|
- run: make smoketest
|
||||||
- save_cache:
|
- save_cache:
|
||||||
key: go-cache-v2-{{ checksum "go.mod" }}-{{ .Environment.CIRCLE_BUILD_NUM }}
|
key: go-cache-v2-{{ checksum "go.mod" }}-{{ .Environment.CIRCLE_BUILD_NUM }}
|
||||||
paths:
|
paths:
|
||||||
|
@ -139,7 +139,7 @@ commands:
|
||||||
- ~/.cache/tinygo
|
- ~/.cache/tinygo
|
||||||
- /go/pkg/mod
|
- /go/pkg/mod
|
||||||
- run: make gen-device -j4
|
- run: make gen-device -j4
|
||||||
- run: make smoketest TINYGO=build/tinygo RISCV=0
|
- run: make smoketest TINYGO=build/tinygo
|
||||||
build-linux:
|
build-linux:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
|
@ -216,11 +216,6 @@ commands:
|
||||||
tar -C ~/lib -xf /tmp/tinygo.linux-amd64.tar.gz
|
tar -C ~/lib -xf /tmp/tinygo.linux-amd64.tar.gz
|
||||||
ln -s ~/lib/tinygo/bin/tinygo /go/bin/tinygo
|
ln -s ~/lib/tinygo/bin/tinygo /go/bin/tinygo
|
||||||
tinygo version
|
tinygo version
|
||||||
- run:
|
|
||||||
name: "Download SiFive GNU toolchain"
|
|
||||||
command: |
|
|
||||||
curl -O https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.2.0-2019.05.3-x86_64-linux-ubuntu14.tar.gz
|
|
||||||
sudo tar -C /usr/local --strip-components=1 -xf riscv64-unknown-elf-gcc-8.2.0-2019.05.3-x86_64-linux-ubuntu14.tar.gz
|
|
||||||
- run: make smoketest
|
- run: make smoketest
|
||||||
build-macos:
|
build-macos:
|
||||||
steps:
|
steps:
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -243,10 +243,8 @@ ifneq ($(AVR), 0)
|
||||||
$(TINYGO) build -size short -o test.hex -target=digispark examples/blinky1
|
$(TINYGO) build -size short -o test.hex -target=digispark examples/blinky1
|
||||||
@$(MD5SUM) test.hex
|
@$(MD5SUM) test.hex
|
||||||
endif
|
endif
|
||||||
ifneq ($(RISCV), 0)
|
|
||||||
$(TINYGO) build -size short -o test.hex -target=hifive1b examples/blinky1
|
$(TINYGO) build -size short -o test.hex -target=hifive1b examples/blinky1
|
||||||
@$(MD5SUM) test.hex
|
@$(MD5SUM) test.hex
|
||||||
endif
|
|
||||||
$(TINYGO) build -o wasm.wasm -target=wasm examples/wasm/export
|
$(TINYGO) build -o wasm.wasm -target=wasm examples/wasm/export
|
||||||
$(TINYGO) build -o wasm.wasm -target=wasm examples/wasm/main
|
$(TINYGO) build -o wasm.wasm -target=wasm examples/wasm/main
|
||||||
|
|
||||||
|
|
|
@ -71,4 +71,4 @@ jobs:
|
||||||
script: |
|
script: |
|
||||||
export PATH="/c/Go1.13/bin:$PATH:./llvm-build/bin:/c/Program Files/qemu"
|
export PATH="/c/Go1.13/bin:$PATH:./llvm-build/bin:/c/Program Files/qemu"
|
||||||
unset GOROOT
|
unset GOROOT
|
||||||
make smoketest TINYGO=build/tinygo AVR=0 RISCV=0
|
make smoketest TINYGO=build/tinygo AVR=0
|
||||||
|
|
|
@ -4,9 +4,10 @@
|
||||||
"goarch": "arm",
|
"goarch": "arm",
|
||||||
"build-tags": ["tinygo.riscv", "baremetal", "linux", "arm"],
|
"build-tags": ["tinygo.riscv", "baremetal", "linux", "arm"],
|
||||||
"gc": "conservative",
|
"gc": "conservative",
|
||||||
"compiler": "riscv64-unknown-elf-gcc",
|
"compiler": "clang",
|
||||||
"linker": "riscv64-unknown-elf-ld",
|
"linker": "ld.lld",
|
||||||
"cflags": [
|
"cflags": [
|
||||||
|
"--target=riscv32--none",
|
||||||
"-march=rv32imac",
|
"-march=rv32imac",
|
||||||
"-mabi=ilp32",
|
"-mabi=ilp32",
|
||||||
"-Os",
|
"-Os",
|
||||||
|
|
|
@ -47,6 +47,11 @@ SECTIONS
|
||||||
. = ALIGN(4);
|
. = ALIGN(4);
|
||||||
_ebss = .; /* used by startup code */
|
_ebss = .; /* used by startup code */
|
||||||
} >RAM
|
} >RAM
|
||||||
|
|
||||||
|
/DISCARD/ :
|
||||||
|
{
|
||||||
|
*(.eh_frame) /* causes 'no memory region specified' error in lld */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For the memory allocator. */
|
/* For the memory allocator. */
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче