all: compile and link using clang, where possible

This commit is contained in:
Ayke van Laethem
2018-11-22 13:24:13 +01:00
parent 4a8ced590b
commit 62d74d8329
15 changed files with 133 additions and 100 deletions
+7 -6
View File
@@ -2,14 +2,15 @@
"inherits": ["avr"],
"llvm-target": "avr-atmel-none",
"build-tags": ["arduino", "atmega328p", "atmega", "avr5"],
"pre-link-args": [
"-nostartfiles",
"-mmcu=avr5",
"cflags": [
"-mmcu=atmega328p"
],
"ldflags": [
"-Wl,--defsym=_bootloader_size=512",
"-Wl,--defsym=_stack_size=512",
"-T", "src/device/avr/atmega328p.ld",
"-T", "targets/avr.ld",
"-Wl,--gc-sections",
"-T", "src/device/avr/atmega328p.ld"
],
"extra-files": [
"targets/avr.S",
"src/device/avr/atmega328p.s"
],
+3
View File
@@ -1,4 +1,7 @@
/* Unused, but here to silence a linker warning. */
ENTRY(Reset_Handler)
/* define output sections */
SECTIONS
{
+6 -1
View File
@@ -1,5 +1,10 @@
{
"build-tags": ["avr", "js", "wasm"],
"compiler": "avr-gcc",
"linker": "avr-gcc",
"objcopy": "avr-objcopy"
"objcopy": "avr-objcopy",
"ldflags": [
"-T", "targets/avr.ld",
"-Wl,--gc-sections"
]
}
+8 -10
View File
@@ -2,16 +2,14 @@
"inherits": ["cortex-m"],
"llvm-target": "armv7m-none-eabi",
"build-tags": ["bluepill", "stm32f103xx", "stm32"],
"pre-link-args": [
"-nostdlib",
"-nostartfiles",
"-mcpu=cortex-m3",
"-mthumb",
"-T", "targets/stm32.ld",
"-Wl,--gc-sections",
"-fno-exceptions", "-fno-unwind-tables",
"-ffunction-sections", "-fdata-sections",
"-Os",
"cflags": [
"--target=armv7m-none-eabi",
"-Qunused-arguments"
],
"ldflags": [
"-T", "targets/stm32.ld"
],
"extra-files": [
"src/device/stm32/stm32f103xx.s"
],
"flash": "openocd -f interface/stlink-v2.cfg -f target/stm32f1x.cfg -c 'program {hex} reset exit'"
+12 -1
View File
@@ -1,7 +1,18 @@
{
"build-tags": ["tinygo.arm", "js", "wasm"],
"linker": "arm-none-eabi-gcc",
"compiler": "clang-7",
"linker": "arm-none-eabi-ld",
"rtlib": "compiler-rt",
"cflags": [
"-Oz",
"-mthumb",
"-fshort-enums",
"-fno-exceptions", "-fno-unwind-tables",
"-ffunction-sections", "-fdata-sections"
],
"ldflags": [
"--gc-sections"
],
"objcopy": "arm-none-eabi-objcopy",
"gdb": "arm-none-eabi-gdb"
}
+1 -1
View File
@@ -26,7 +26,7 @@ Default_Handler:
.set \handler, Default_Handler
.endm
.section .isr_vector
.section .isr_vector, "a", %progbits
.global __isr_vector
// Interrupt vector as defined by Cortex-M, starting with the stack top.
// On reset, SP is initialized with *0x0 and PC is loaded with *0x4, loading
+7 -6
View File
@@ -2,14 +2,15 @@
"inherits": ["avr"],
"llvm-target": "avr-atmel-none",
"build-tags": ["digispark", "attiny85", "attiny", "avr2", "avr25"],
"pre-link-args": [
"-nostartfiles",
"-mmcu=attiny85",
"cflags": [
"-mmcu=attiny85"
],
"ldflags": [
"-Wl,--defsym=_bootloader_size=2180",
"-Wl,--defsym=_stack_size=128",
"-T", "src/device/avr/attiny85.ld",
"-T", "targets/avr.ld",
"-Wl,--gc-sections",
"-T", "src/device/avr/attiny85.ld"
],
"extra-files": [
"targets/avr.S",
"src/device/avr/attiny85.s"
],
+9 -11
View File
@@ -2,18 +2,16 @@
"inherits": ["cortex-m"],
"llvm-target": "armv6m-none-eabi",
"build-tags": ["nrf51822", "nrf51", "nrf"],
"pre-link-args": [
"-nostdlib",
"-nostartfiles",
"-mcpu=cortex-m0",
"-mthumb",
"-T", "targets/nrf51.ld",
"-Wl,--gc-sections",
"-fno-exceptions", "-fno-unwind-tables",
"-ffunction-sections", "-fdata-sections",
"-Os",
"cflags": [
"--target=armv6m-none-eabi",
"-Qunused-arguments",
"-DNRF51",
"-Ilib/CMSIS/CMSIS/Include",
"-Ilib/CMSIS/CMSIS/Include"
],
"ldflags": [
"-T", "targets/nrf51.ld"
],
"extra-files": [
"lib/nrfx/mdk/system_nrf51.c",
"src/device/nrf/nrf51.s"
]
+9 -11
View File
@@ -2,18 +2,16 @@
"inherits": ["cortex-m"],
"llvm-target": "armv7em-none-eabi",
"build-tags": ["nrf52", "nrf"],
"pre-link-args": [
"-nostdlib",
"-nostartfiles",
"-mcpu=cortex-m4",
"-mthumb",
"-T", "targets/nrf52.ld",
"-Wl,--gc-sections",
"-fno-exceptions", "-fno-unwind-tables",
"-ffunction-sections", "-fdata-sections",
"-Os",
"cflags": [
"--target=armv7em-none-eabi",
"-Qunused-arguments",
"-DNRF52832_XXAA",
"-Ilib/CMSIS/CMSIS/Include",
"-Ilib/CMSIS/CMSIS/Include"
],
"ldflags": [
"-T", "targets/nrf52.ld"
],
"extra-files": [
"lib/nrfx/mdk/system_nrf52.c",
"src/device/nrf/nrf52.s"
]
+9 -11
View File
@@ -2,18 +2,16 @@
"inherits": ["cortex-m"],
"llvm-target": "armv7em-none-eabi",
"build-tags": ["nrf52840", "nrf"],
"pre-link-args": [
"-nostdlib",
"-nostartfiles",
"-mcpu=cortex-m4",
"-mthumb",
"-T", "targets/nrf52840.ld",
"-Wl,--gc-sections",
"-fno-exceptions", "-fno-unwind-tables",
"-ffunction-sections", "-fdata-sections",
"-Os",
"cflags": [
"--target=armv7em-none-eabi",
"-Qunused-arguments",
"-DNRF52840_XXAA",
"-Ilib/CMSIS/CMSIS/Include",
"-Ilib/CMSIS/CMSIS/Include"
],
"ldflags": [
"-T", "targets/nrf52840.ld"
],
"extra-files": [
"lib/nrfx/mdk/system_nrf52840.c",
"src/device/nrf/nrf52840.s"
]
+8 -10
View File
@@ -2,16 +2,14 @@
"inherits": ["cortex-m"],
"llvm-target": "armv7m-none-eabi",
"build-tags": ["qemu", "lm3s6965"],
"pre-link-args": [
"-nostdlib",
"-nostartfiles",
"-mcpu=cortex-m0",
"-mthumb",
"-T", "targets/lm3s6965.ld",
"-Wl,--gc-sections",
"-fno-exceptions", "-fno-unwind-tables",
"-ffunction-sections", "-fdata-sections",
"-Os",
"cflags": [
"--target=armv7m-none-eabi",
"-Qunused-arguments"
],
"ldflags": [
"-T", "targets/lm3s6965.ld"
],
"extra-files": [
"targets/cortex-m.s"
],
"emulator": ["qemu-system-arm", "-machine", "lm3s6965evb", "-semihosting", "-nographic", "-kernel"]