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.
Этот коммит содержится в:
Ayke van Laethem 2021-02-11 14:19:46 +01:00 коммит произвёл Ron Evans
родитель 9c8ef5c48f
коммит 801bd2a7ff
3 изменённых файлов: 16 добавлений и 2 удалений

Просмотреть файл

@ -3,7 +3,9 @@
"cpu": "attiny85",
"build-tags": ["attiny85", "attiny", "avr2", "avr25"],
"cflags": [
"-mmcu=attiny85"
"-mmcu=attiny85",
"-D__AVR_ARCH__=25",
"-Qunused-arguments"
],
"ldflags": [
"-mmcu=avr25"

Просмотреть файл

@ -2,6 +2,15 @@
; in Go.
; 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
.section .text.__vector_RESET
.global __vector_RESET

Просмотреть файл

@ -3,11 +3,14 @@
"build-tags": ["avr", "baremetal", "linux", "arm"],
"goos": "linux",
"goarch": "arm",
"compiler": "avr-gcc",
"compiler": "clang",
"gc": "conservative",
"linker": "avr-gcc",
"scheduler": "none",
"default-stack-size": 256,
"cflags": [
"--target=avr-unknown-unknown"
],
"ldflags": [
"-T", "targets/avr.ld",
"-Wl,--gc-sections"