avr: use Clang for compiling C and assembly files
This is one step towards an avr-gcc free TinyGo toolchain, something that will make it easier to use AVR targets in TinyGo.
Этот коммит содержится в:
родитель
9c8ef5c48f
коммит
801bd2a7ff
3 изменённых файлов: 16 добавлений и 2 удалений
|
@ -3,7 +3,9 @@
|
||||||
"cpu": "attiny85",
|
"cpu": "attiny85",
|
||||||
"build-tags": ["attiny85", "attiny", "avr2", "avr25"],
|
"build-tags": ["attiny85", "attiny", "avr2", "avr25"],
|
||||||
"cflags": [
|
"cflags": [
|
||||||
"-mmcu=attiny85"
|
"-mmcu=attiny85",
|
||||||
|
"-D__AVR_ARCH__=25",
|
||||||
|
"-Qunused-arguments"
|
||||||
],
|
],
|
||||||
"ldflags": [
|
"ldflags": [
|
||||||
"-mmcu=avr25"
|
"-mmcu=avr25"
|
||||||
|
|
|
@ -2,6 +2,15 @@
|
||||||
; in Go.
|
; in Go.
|
||||||
; The reset vector is device-specific and is generated by tools/gen-device-avr.py.
|
; The reset vector is device-specific and is generated by tools/gen-device-avr.py.
|
||||||
|
|
||||||
|
; These definitions are necessary because LLVM does not yet know these register
|
||||||
|
; aliases. See: https://reviews.llvm.org/D96492
|
||||||
|
#define xl r26
|
||||||
|
#define xh r27
|
||||||
|
#define yl r28
|
||||||
|
#define yh r29
|
||||||
|
#define zl r30
|
||||||
|
#define zh r31
|
||||||
|
|
||||||
; Startup code
|
; Startup code
|
||||||
.section .text.__vector_RESET
|
.section .text.__vector_RESET
|
||||||
.global __vector_RESET
|
.global __vector_RESET
|
||||||
|
|
|
@ -3,11 +3,14 @@
|
||||||
"build-tags": ["avr", "baremetal", "linux", "arm"],
|
"build-tags": ["avr", "baremetal", "linux", "arm"],
|
||||||
"goos": "linux",
|
"goos": "linux",
|
||||||
"goarch": "arm",
|
"goarch": "arm",
|
||||||
"compiler": "avr-gcc",
|
"compiler": "clang",
|
||||||
"gc": "conservative",
|
"gc": "conservative",
|
||||||
"linker": "avr-gcc",
|
"linker": "avr-gcc",
|
||||||
"scheduler": "none",
|
"scheduler": "none",
|
||||||
"default-stack-size": 256,
|
"default-stack-size": 256,
|
||||||
|
"cflags": [
|
||||||
|
"--target=avr-unknown-unknown"
|
||||||
|
],
|
||||||
"ldflags": [
|
"ldflags": [
|
||||||
"-T", "targets/avr.ld",
|
"-T", "targets/avr.ld",
|
||||||
"-Wl,--gc-sections"
|
"-Wl,--gc-sections"
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче