mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 05:53:39 +00:00
avr: use compiler-rt
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
"inherits": ["atmega328p"],
|
||||
"build-tags": ["arduino"],
|
||||
"ldflags": [
|
||||
"-Wl,--defsym=_bootloader_size=512",
|
||||
"-Wl,--defsym=_stack_size=512"
|
||||
"--defsym=_bootloader_size=512",
|
||||
"--defsym=_stack_size=512"
|
||||
],
|
||||
"flash-command": "avrdude -c arduino -p atmega328p -P {port} -U flash:w:{hex}:i"
|
||||
}
|
||||
|
||||
@@ -7,9 +7,8 @@
|
||||
"-mmcu=atmega1284p"
|
||||
],
|
||||
"ldflags": [
|
||||
"-mmcu=avr51",
|
||||
"-Wl,--defsym=_bootloader_size=0",
|
||||
"-Wl,--defsym=_stack_size=512"
|
||||
"--defsym=_bootloader_size=0",
|
||||
"--defsym=_stack_size=512"
|
||||
],
|
||||
"linkerscript": "src/device/avr/atmega1284p.ld",
|
||||
"extra-files": [
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"-mmcu=atmega328p"
|
||||
],
|
||||
"ldflags": [
|
||||
"-mmcu=avr5"
|
||||
"-mavr5"
|
||||
],
|
||||
"linkerscript": "src/device/avr/atmega328p.ld",
|
||||
"extra-files": [
|
||||
|
||||
@@ -2,6 +2,30 @@
|
||||
; in Go.
|
||||
; The reset vector is device-specific and is generated by tools/gen-device-avr.py.
|
||||
|
||||
#ifndef xl
|
||||
#define xl r26
|
||||
#endif
|
||||
|
||||
#ifndef xh
|
||||
#define xh r27
|
||||
#endif
|
||||
|
||||
#ifndef yl
|
||||
#define yl r28
|
||||
#endif
|
||||
|
||||
#ifndef yh
|
||||
#define yh r29
|
||||
#endif
|
||||
|
||||
#ifndef zl
|
||||
#define zl r30
|
||||
#endif
|
||||
|
||||
#ifndef zh
|
||||
#define zh r31
|
||||
#endif
|
||||
|
||||
; Startup code
|
||||
.section .text.__vector_RESET
|
||||
.global __vector_RESET
|
||||
|
||||
+9
-4
@@ -2,16 +2,21 @@
|
||||
"build-tags": ["avr", "baremetal", "linux", "arm"],
|
||||
"goos": "linux",
|
||||
"goarch": "arm",
|
||||
"compiler": "avr-gcc",
|
||||
"compiler": "clang",
|
||||
"gc": "conservative",
|
||||
"linker": "avr-gcc",
|
||||
"linker": "llvm-build.master/bin/ld.lld",
|
||||
"scheduler": "none",
|
||||
"rtlib": "compiler-rt",
|
||||
"libc": "picolibc",
|
||||
"cflags": [
|
||||
"-gdwarf-4"
|
||||
"--target=avr-atmel-none",
|
||||
"-g",
|
||||
"-Werror",
|
||||
"-Qunused-arguments"
|
||||
],
|
||||
"ldflags": [
|
||||
"-T", "targets/avr.ld",
|
||||
"-Wl,--gc-sections"
|
||||
"--gc-sections"
|
||||
],
|
||||
"extra-files": [
|
||||
"src/runtime/scheduler_avr.S"
|
||||
|
||||
+9
-4
@@ -5,17 +5,22 @@ MEMORY
|
||||
RAM (xrw) : ORIGIN = 0x800000 + __ram_start, LENGTH = __ram_size
|
||||
}
|
||||
|
||||
ENTRY(main)
|
||||
|
||||
SECTIONS
|
||||
{
|
||||
.text :
|
||||
.text : ALIGN(2)
|
||||
{
|
||||
KEEP(*(.vectors))
|
||||
KEEP(*(.text.__vector_RESET))
|
||||
KEEP(*(.text.main)) /* main must follow the reset handler */
|
||||
*(.text)
|
||||
*(.text.*)
|
||||
*(.rodata)
|
||||
*(.rodata.*)
|
||||
}
|
||||
*(.progmem.data)
|
||||
. = ALIGN(16); /* required because of lld (not sure why) */
|
||||
} > FLASH_TEXT
|
||||
|
||||
.stack (NOLOAD) :
|
||||
{
|
||||
@@ -29,7 +34,7 @@ SECTIONS
|
||||
{
|
||||
_sdata = .; /* used by startup code */
|
||||
*(.data)
|
||||
*(.data*)
|
||||
*(.data.*)
|
||||
_edata = .; /* used by startup code */
|
||||
} >RAM AT>FLASH_TEXT
|
||||
|
||||
@@ -37,7 +42,7 @@ SECTIONS
|
||||
{
|
||||
_sbss = .; /* used by startup code */
|
||||
*(.bss)
|
||||
*(.bss*)
|
||||
*(.bss.*)
|
||||
*(COMMON)
|
||||
_ebss = .; /* used by startup code */
|
||||
} >RAM
|
||||
|
||||
Reference in New Issue
Block a user