From 6d90267d40f2cef60414ee31136e16f3dcebac55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Fri, 10 Jul 2015 11:57:43 +0200 Subject: [PATCH 01/18] cpu/cortexm_common: Use gcc-ar when building with LTO gcc-ar is a wrapper supplied by gcc for properly handling thin LTO objects. --- cpu/Makefile.include.gnu | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpu/Makefile.include.gnu b/cpu/Makefile.include.gnu index a2e5764c5..d3418ea04 100644 --- a/cpu/Makefile.include.gnu +++ b/cpu/Makefile.include.gnu @@ -1,7 +1,11 @@ export GDBPREFIX ?= $(PREFIX) export CC = $(PREFIX)gcc export CXX = $(PREFIX)g++ +ifeq ($(LTO),1) +export AR = $(PREFIX)gcc-ar +else export AR = $(PREFIX)ar +endif export AS = $(PREFIX)as export LINK = $(PREFIX)gcc export SIZE = $(PREFIX)size From 0e5522950a452e4f0fc5ee4f171622afb4a7cccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Tue, 14 Jul 2015 09:34:58 +0200 Subject: [PATCH 02/18] boards/native: Use gcc-ar when building with LTO --- boards/native/Makefile.include | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/boards/native/Makefile.include b/boards/native/Makefile.include index 7a4a472d0..a7c12bcdc 100644 --- a/boards/native/Makefile.include +++ b/boards/native/Makefile.include @@ -14,7 +14,11 @@ USEMODULE += native-drivers export PREFIX = export CC ?= $(PREFIX)gcc export CXX ?= $(PREFIX)g++ -export AR ?= $(PREFIX)ar +ifeq ($(LTO),1) +export AR = $(PREFIX)gcc-ar +else +export AR = $(PREFIX)ar +endif export AS ?= $(PREFIX)as export LINK ?= $(PREFIX)gcc export SIZE ?= $(PREFIX)size From efedaa1a4342e46e81e6e817efca62c871a73777 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Tue, 14 Jul 2015 10:00:01 +0200 Subject: [PATCH 03/18] boards/x86-multiboot-common: Use gcc-ar when building with LTO --- boards/x86-multiboot-common/Makefile.include | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/boards/x86-multiboot-common/Makefile.include b/boards/x86-multiboot-common/Makefile.include index 91f95e813..2f0d20648 100644 --- a/boards/x86-multiboot-common/Makefile.include +++ b/boards/x86-multiboot-common/Makefile.include @@ -32,7 +32,11 @@ export CPU = x86 # toolchain config export CC ?= $(PREFIX)gcc -export AR ?= $(PREFIX)ar +ifeq ($(LTO),1) +export AR = $(PREFIX)gcc-ar +else +export AR = $(PREFIX)ar +endif export AS ?= $(PREFIX)as export RANLIB ?= $(PREFIX)ranlib export LINK ?= $(RIOTBASE)/boards/x86-multiboot-common/dist/link $(PREFIX)gcc From 5fcb09f6b9a15f834b11970e8d39e4d971f9d64a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Tue, 14 Jul 2015 13:13:13 +0200 Subject: [PATCH 04/18] boards/native/Makefile.include: Add -Wl,--gc-sections to linker options --- boards/native/Makefile.include | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/boards/native/Makefile.include b/boards/native/Makefile.include index a7c12bcdc..7f7c4e8b4 100644 --- a/boards/native/Makefile.include +++ b/boards/native/Makefile.include @@ -45,7 +45,6 @@ export GPROF ?= gprof # basic cflags: export CFLAGS += -Wall -Wextra -pedantic -export CFLAGS += -ffunction-sections -fdata-sections ifeq ($(shell uname -m),x86_64) export CFLAGS += -m32 endif @@ -77,6 +76,10 @@ else export LINKFLAGS += -ldl endif +# clean up unused functions +export CFLAGS += -ffunction-sections -fdata-sections +export LINKFLAGS += -Wl,--gc-sections + # set the tap interface for term/valgrind ifneq (,$(filter netdev2_tap,$(USEMODULE))) export PORT ?= tap0 From 37eece1961f29525fe74f02551a00de1fc4ff65d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Tue, 14 Jul 2015 14:16:35 +0200 Subject: [PATCH 05/18] cpu/atmega2560/startup.c: Add __attribute__((used)) to init functions --- cpu/atmega2560/startup.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/cpu/atmega2560/startup.c b/cpu/atmega2560/startup.c index 2cf66ca27..b53d18f2d 100644 --- a/cpu/atmega2560/startup.c +++ b/cpu/atmega2560/startup.c @@ -43,19 +43,20 @@ extern void __libc_init_array(void); * which should never be reached but just in case jumps to exit. * This way there should be no way to call main directly. */ -void init7_ovr(void) __attribute__((naked)) __attribute__((section(".init7"))); -void init8_ovr(void) __attribute__((naked)) __attribute__((section(".init8"))); +void init7_ovr(void) __attribute__((section(".init7"))); +void init8_ovr(void) __attribute__((section(".init8"))); -void init7_ovr(void) +__attribute__((used,naked)) void init7_ovr(void) { __asm__("call reset_handler"); } -void init8_ovr(void) +__attribute__((used,naked)) void init8_ovr(void) { __asm__("jmp exit"); } + /** * @brief This function is the entry point after a system reset * @@ -63,7 +64,7 @@ void init8_ovr(void) * 1. initialize the board (sync clock, setup std-IO) * 2. initialize and start RIOTs kernel */ -void reset_handler(void) +__attribute__((used)) void reset_handler(void) { /* initialize the board and startup the kernel */ board_init(); From db5574044712323c3529d58cf03903deb9d37d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Tue, 14 Jul 2015 14:17:13 +0200 Subject: [PATCH 06/18] boards/arduino-mega2560: Add -Wno-error if building with LTO --- boards/arduino-mega2560/Makefile.include | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/boards/arduino-mega2560/Makefile.include b/boards/arduino-mega2560/Makefile.include index c9f6ad573..22c75b56d 100644 --- a/boards/arduino-mega2560/Makefile.include +++ b/boards/arduino-mega2560/Makefile.include @@ -44,3 +44,10 @@ export ASFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG) export LINKFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG) $(CFLAGS_OPT) -Wl,--gc-sections -static -lgcc -e reset_handler export OFLAGS += -j .text -j .data -O ihex export FFLAGS += -p m2560 -c $(PROGRAMMER) $(PROGRAMMER_FLAGS) -F -D -U flash:w:bin/$(BOARD)/$(PROJECT)$(APPLICATION).hex + +ifeq ($(LTO),1) + # avr-gcc <4.8.3 has a bug when using LTO which causes a warning to be printed always: + # '_vector_25' appears to be a misspelled signal handler [enabled by default] + # See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59396 + export LINKFLAGS += -Wno-error +endif From 16469543db0406a9b01a49891b7fe219be2386f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Tue, 14 Jul 2015 15:02:54 +0200 Subject: [PATCH 07/18] cpu/x86/x86_interrupts.c: Add __attribute__((used)) to isr functions --- cpu/x86/x86_interrupts.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpu/x86/x86_interrupts.c b/cpu/x86/x86_interrupts.c index cb2da0adf..86991e8a2 100644 --- a/cpu/x86/x86_interrupts.c +++ b/cpu/x86/x86_interrupts.c @@ -169,7 +169,7 @@ static void continue_after_intr(void) } static unsigned in_intr_handler = 0, old_intr; -void x86_int_handler(void) +__attribute__((used)) void x86_int_handler(void) { switch (in_intr_handler++) { case 0: @@ -213,7 +213,7 @@ void x86_int_handler(void) __builtin_unreachable(); } -void ASM_FUN_ATTRIBUTES NORETURN x86_int_entry(void) +__attribute__((used)) void ASM_FUN_ATTRIBUTES NORETURN x86_int_entry(void) { __asm__ volatile ("mov %eax, (4*0 + x86_interrupted_ctx)"); __asm__ volatile ("mov %ecx, (4*1 + x86_interrupted_ctx)"); @@ -239,7 +239,7 @@ void ASM_FUN_ATTRIBUTES NORETURN x86_int_entry(void) __builtin_unreachable(); } -void ASM_FUN_ATTRIBUTES NORETURN x86_int_exit(void) +__attribute__((used)) void ASM_FUN_ATTRIBUTES NORETURN x86_int_exit(void) { __asm__ volatile ("mov (4*0 + x86_interrupted_ctx), %eax"); __asm__ volatile ("mov (4*1 + x86_interrupted_ctx), %ecx"); From 4d95f8a0ba96a40bd38ddf07dea382f39a8e32b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Tue, 14 Jul 2015 13:13:29 +0200 Subject: [PATCH 08/18] boards/x86-multiboot-common/Makefile.include: Add -Wl,--gc-sections to linker options --- boards/x86-multiboot-common/Makefile.include | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/boards/x86-multiboot-common/Makefile.include b/boards/x86-multiboot-common/Makefile.include index 2f0d20648..f10ff1c74 100644 --- a/boards/x86-multiboot-common/Makefile.include +++ b/boards/x86-multiboot-common/Makefile.include @@ -50,6 +50,11 @@ LINKFLAGS += -m32 -nostdlib -nostdinc -nostartfiles -nodefaultlibs \ --prefix=$(NEWLIB_BASE) \ -Wl,-rpath,$(NEWLIB_BASE)/lib \ -T$(RIOTBASE)/boards/x86-multiboot-common/linker.ld + +# clean up unused functions +export CFLAGS += -ffunction-sections -fdata-sections +export LINKFLAGS += -Wl,--gc-sections + UNDEF += $(BINDIR)x86-multiboot-common/startup.o BASELIBS += $(NEWLIB_BASE)/lib/libc.a \ From 5f313898bf3014e6995a60cd7d9b2af673e49f3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Tue, 14 Jul 2015 09:17:58 +0200 Subject: [PATCH 09/18] cpu/lpc1768: Add __attribute__((used)) to interrupt vector --- cpu/lpc1768/vectors.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/lpc1768/vectors.c b/cpu/lpc1768/vectors.c index b0ee65a9e..60566cc5c 100644 --- a/cpu/lpc1768/vectors.c +++ b/cpu/lpc1768/vectors.c @@ -70,7 +70,7 @@ WEAK_DEFAULT void isr_qei(void); WEAK_DEFAULT void isr_pll1(void); /* interrupt vector table */ -__attribute__ ((section(".vectors"))) +__attribute__ ((used,section(".vectors"))) const void *interrupt_vector[] = { /* Exception stack pointer */ (void*) (&_estack), /* pointer to the top of the stack */ From 0ff7652bd6d6975a1db847f1122125343b77082f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Mon, 8 Feb 2016 16:07:22 +0100 Subject: [PATCH 10/18] Makefile.cflags: Make LTO a warning instead of info (fixes problems with info-boards-supported etc) --- Makefile.cflags | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile.cflags b/Makefile.cflags index 4e079d0cc..bef46ca72 100644 --- a/Makefile.cflags +++ b/Makefile.cflags @@ -42,10 +42,9 @@ endif # Unwanted flags for c++ CXXUWFLAGS += -std=% -ifeq ($(LTO),yes) - $(info Building with Link-Time-Optimizations is currently an experimental feature. Expect broken binaries.) - LTOFLAGS = -flto -ffat-lto-objects - CFLAGS += ${LTOFLAGS} +ifeq ($(LTO),1) + $(warning Building with Link-Time-Optimizations is currently an experimental feature. Expect broken binaries.) + LTOFLAGS = -flto LINKFLAGS += ${LTOFLAGS} endif From afb6cb45079b9d6517ef7ce624887e73b7c87fd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Nohlg=C3=A5rd?= Date: Mon, 8 Feb 2016 16:34:55 +0100 Subject: [PATCH 11/18] sys/newlib: Add __attribute__((used)) to _fini No ROM cost, only fixes a linker error with non-nano newlib and LTO enabled. --- sys/newlib/syscalls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/newlib/syscalls.c b/sys/newlib/syscalls.c index e5384188d..56667e401 100644 --- a/sys/newlib/syscalls.c +++ b/sys/newlib/syscalls.c @@ -66,7 +66,8 @@ void _init(void) /** * @brief Free resources on NewLib de-initialization, not used for RIOT */ -void _fini(void) +/* __attribute__((used)) fixes linker errors when building with LTO, but without nano.specs */ +__attribute__((used)) void _fini(void) { /* nothing to do here */ } From 1f9a87972b4f9184a6488426bc3c12ae43528bfd Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Wed, 10 Aug 2016 16:03:53 +0200 Subject: [PATCH 12/18] make: allow per-file conditional LTO compile --- Makefile.base | 14 +++++++++----- Makefile.vars | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile.base b/Makefile.base index 98f75964a..04bfec914 100644 --- a/Makefile.base +++ b/Makefile.base @@ -23,7 +23,7 @@ ${DIRS:%=CLEAN--%}: "$(MAKE)" -C ${@:CLEAN--%=%} clean ifeq ($(strip $(SRC)),) - SRC := $(wildcard *.c) + SRC := $(filter-out $(SRC_NOLTO), $(wildcard *.c)) endif ifeq ($(strip $(SRCXX)),) SRCXX := $(wildcard *.cpp) @@ -35,10 +35,12 @@ ifeq ($(strip $(ASSMSRC)),) ASSMSRC := $(wildcard *.S) endif -OBJC := $(SRC:%.c=$(BINDIR)$(MODULE)/%.o) -OBJCXX := $(SRCXX:%.cpp=$(BINDIR)$(MODULE)/%.o) -ASMOBJ := $(ASMSRC:%.s=$(BINDIR)$(MODULE)/%.o) -ASSMOBJ := $(ASSMSRC:%.S=$(BINDIR)$(MODULE)/%.o) +OBJC_LTO := $(SRC:%.c=$(BINDIR)$(MODULE)/%.o) +OBJC_NOLTO := $(SRC_NOLTO:%.c=$(BINDIR)$(MODULE)/%.o) +OBJC := $(OBJC_NOLTO) $(OBJC_LTO) +OBJCXX := $(SRCXX:%.cpp=$(BINDIR)$(MODULE)/%.o) +ASMOBJ := $(ASMSRC:%.s=$(BINDIR)$(MODULE)/%.o) +ASSMOBJ := $(ASSMSRC:%.S=$(BINDIR)$(MODULE)/%.o) OBJ := $(OBJC) $(OBJCXX) $(ASMOBJ) $(ASSMOBJ) DEP := $(OBJC:.o=.d) $(OBJCXX:.o=.d) $(ASSMOBJ:.o=.d) @@ -56,6 +58,8 @@ CXXFLAGS = $(filter-out $(CXXUWFLAGS), $(CFLAGS)) $(CXXEXFLAGS) # compile and generate dependency info +$(OBJC_LTO): CFLAGS+=$(LTOFLAGS) + $(OBJC): $(BINDIR)$(MODULE)/%.o: %.c $(RIOTBUILD_CONFIG_HEADER_C) $(AD)$(CCACHE) $(CC) \ -DRIOT_FILE_RELATIVE=\"$(patsubst $(RIOTBASE)/%,%,$(abspath $<))\" \ diff --git a/Makefile.vars b/Makefile.vars index b7ee2f776..09d6ef720 100644 --- a/Makefile.vars +++ b/Makefile.vars @@ -35,6 +35,7 @@ export AS # The assembler. export ASFLAGS # Flags for the assembler. export LINK # The command used to link the files. Must take the same parameters as GCC, i.e. "ld" won't work. export LINKFLAGS # Flags to supply in the linking step. +export LTOFLAGS # extra CFLAGS for compiling with link time optimization export OBJCOPY # The command used to create the HEXFILE. export OFLAGS # The parameter for OBJCOPY, e.g. to strip the debug information. export OBJDUMP # The command used to create the assembly listing. From 25a6ef527365ad2127db117dc3b82358662ba6dd Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Wed, 10 Aug 2016 16:04:30 +0200 Subject: [PATCH 13/18] core: sched: mark sched_run() as used --- core/sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/sched.c b/core/sched.c index f34615248..30f5fb3c4 100644 --- a/core/sched.c +++ b/core/sched.c @@ -58,7 +58,7 @@ static void (*sched_cb) (uint32_t timestamp, uint32_t value) = NULL; schedstat sched_pidlist[KERNEL_PID_LAST + 1]; #endif -int sched_run(void) +int __attribute__((used)) sched_run(void) { sched_context_switch_request = 0; From 0bd2805b0c71cd64bdea77a4b6ee964528dee4a3 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Wed, 10 Aug 2016 16:04:56 +0200 Subject: [PATCH 14/18] cpu: cortexm_common: explicitly define isr_pendsv and isr_svc --- cpu/cortexm_common/thread_arch.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/cpu/cortexm_common/thread_arch.c b/cpu/cortexm_common/thread_arch.c index e37e48fbe..07d3b86c2 100644 --- a/cpu/cortexm_common/thread_arch.c +++ b/cpu/cortexm_common/thread_arch.c @@ -296,17 +296,12 @@ void thread_arch_yield(void) SCB->ICSR |= SCB_ICSR_PENDSVSET_Msk; } -__attribute__((naked)) void arch_context_switch(void) -{ +void __attribute__((naked)) __attribute__((used)) isr_pendsv(void) { __asm__ volatile ( /* PendSV handler entry point */ - ".global isr_pendsv \n" - ".thumb_func \n" - "isr_pendsv: \n" /* save context by pushing unsaved registers to the stack */ /* {r0-r3,r12,LR,PC,xPSR} are saved automatically on exception entry */ ".thumb_func \n" - "context_save:" "mrs r0, psp \n" /* get stack pointer from user mode */ #if defined(CPU_ARCH_CORTEX_M0) || defined(CPU_ARCH_CORTEX_M0PLUS) "mov r12, sp \n" /* remember the exception SP */ @@ -332,11 +327,15 @@ __attribute__((naked)) void arch_context_switch(void) "ldr r1, =sched_active_thread \n" /* load address of current tcb */ "ldr r1, [r1] \n" /* dereference pdc */ "str r0, [r1] \n" /* write r0 to pdc->sp */ + "bl isr_svc \n" /* continue with svc */ + ); +} + +void __attribute__((naked)) __attribute__((used)) isr_svc(void) { + __asm__ volatile ( /* SVC handler entry point */ - /* PendSV will continue from above and through this part as well */ - ".global isr_svc \n" + /* PendSV will continue here as well (via jump) */ ".thumb_func \n" - "isr_svc: \n" /* perform scheduling */ "bl sched_run \n" /* restore context and return from exception */ From 5a03f08f91c8439b70053cea39e268fb3fc079fb Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Wed, 10 Aug 2016 16:06:12 +0200 Subject: [PATCH 15/18] cpu: cortexm_common: compile thread_arch.c without LTO --- cpu/cortexm_common/Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cpu/cortexm_common/Makefile b/cpu/cortexm_common/Makefile index 48422e909..6b348c14e 100644 --- a/cpu/cortexm_common/Makefile +++ b/cpu/cortexm_common/Makefile @@ -1 +1,5 @@ +# thread_arch.c's inline assembler breaks when compiling with link time +# optimization. see #5774. +SRC_NOLTO += thread_arch.c + include $(RIOTBASE)/Makefile.base From 5ab97fe38b310eddf52a97dd0ae411d41db1d84f Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Wed, 10 Aug 2016 16:15:09 +0200 Subject: [PATCH 16/18] cpu: build cortexm vectors.c without LTO --- cpu/cc2538/Makefile | 3 +++ cpu/cc26x0/Makefile | 3 +++ cpu/ezr32wg/Makefile | 3 +++ cpu/k64f/Makefile | 3 +++ cpu/lm4f120/Makefile | 3 +++ cpu/lpc11u34/Makefile | 3 +++ cpu/lpc1768/Makefile | 3 +++ cpu/nrf51/Makefile | 3 +++ cpu/nrf52/Makefile | 3 +++ cpu/sam3/Makefile | 3 +++ cpu/samd21/Makefile | 3 +++ cpu/saml21/Makefile | 3 +++ cpu/stm32f0/Makefile | 3 +++ cpu/stm32f1/Makefile | 3 +++ cpu/stm32f3/Makefile | 3 +++ cpu/stm32f4/Makefile | 3 +++ cpu/stm32l1/Makefile | 3 +++ 17 files changed, 51 insertions(+) diff --git a/cpu/cc2538/Makefile b/cpu/cc2538/Makefile index 849491f76..5d00c79fa 100644 --- a/cpu/cc2538/Makefile +++ b/cpu/cc2538/Makefile @@ -9,4 +9,7 @@ ifneq (,$(filter cc2538_rf,$(USEMODULE))) DIRS += radio endif +# (file triggers compiler bug. see #5775) +SRC_NOLTO += vectors.c + include $(RIOTBASE)/Makefile.base diff --git a/cpu/cc26x0/Makefile b/cpu/cc26x0/Makefile index 67506e130..40dc0d8f0 100644 --- a/cpu/cc26x0/Makefile +++ b/cpu/cc26x0/Makefile @@ -4,4 +4,7 @@ MODULE = cpu # Add a list of subdirectories, that should also be built: DIRS = periph $(RIOTCPU)/cortexm_common +# (file triggers compiler bug. see #5775) +SRC_NOLTO += vectors.c + include $(RIOTBASE)/Makefile.base diff --git a/cpu/ezr32wg/Makefile b/cpu/ezr32wg/Makefile index 21f0d1871..edc9a57a6 100644 --- a/cpu/ezr32wg/Makefile +++ b/cpu/ezr32wg/Makefile @@ -4,4 +4,7 @@ MODULE = cpu # add a list of subdirectories, that should also be build DIRS = periph $(RIOTCPU)/cortexm_common +# (file triggers compiler bug. see #5775) +SRC_NOLTO += vectors.c + include $(RIOTBASE)/Makefile.base diff --git a/cpu/k64f/Makefile b/cpu/k64f/Makefile index 12ba41f9c..68605a469 100644 --- a/cpu/k64f/Makefile +++ b/cpu/k64f/Makefile @@ -4,4 +4,7 @@ MODULE = cpu # add a list of subdirectories, that should also be build DIRS = periph $(RIOTCPU)/cortexm_common $(KINETIS_COMMON) +# (file triggers compiler bug. see #5775) +SRC_NOLTO += vectors.c + include $(RIOTBASE)/Makefile.base diff --git a/cpu/lm4f120/Makefile b/cpu/lm4f120/Makefile index 21f0d1871..edc9a57a6 100644 --- a/cpu/lm4f120/Makefile +++ b/cpu/lm4f120/Makefile @@ -4,4 +4,7 @@ MODULE = cpu # add a list of subdirectories, that should also be build DIRS = periph $(RIOTCPU)/cortexm_common +# (file triggers compiler bug. see #5775) +SRC_NOLTO += vectors.c + include $(RIOTBASE)/Makefile.base diff --git a/cpu/lpc11u34/Makefile b/cpu/lpc11u34/Makefile index 21f0d1871..edc9a57a6 100644 --- a/cpu/lpc11u34/Makefile +++ b/cpu/lpc11u34/Makefile @@ -4,4 +4,7 @@ MODULE = cpu # add a list of subdirectories, that should also be build DIRS = periph $(RIOTCPU)/cortexm_common +# (file triggers compiler bug. see #5775) +SRC_NOLTO += vectors.c + include $(RIOTBASE)/Makefile.base diff --git a/cpu/lpc1768/Makefile b/cpu/lpc1768/Makefile index 21f0d1871..edc9a57a6 100644 --- a/cpu/lpc1768/Makefile +++ b/cpu/lpc1768/Makefile @@ -4,4 +4,7 @@ MODULE = cpu # add a list of subdirectories, that should also be build DIRS = periph $(RIOTCPU)/cortexm_common +# (file triggers compiler bug. see #5775) +SRC_NOLTO += vectors.c + include $(RIOTBASE)/Makefile.base diff --git a/cpu/nrf51/Makefile b/cpu/nrf51/Makefile index e4e81ca5d..f16a1bd3f 100644 --- a/cpu/nrf51/Makefile +++ b/cpu/nrf51/Makefile @@ -9,4 +9,7 @@ ifneq (,$(filter radio_nrfmin,$(USEMODULE))) DIRS += radio/nrfmin endif +# (file triggers compiler bug. see #5775) +SRC_NOLTO += vectors.c + include $(RIOTBASE)/Makefile.base diff --git a/cpu/nrf52/Makefile b/cpu/nrf52/Makefile index f6c26f69b..7600b5893 100644 --- a/cpu/nrf52/Makefile +++ b/cpu/nrf52/Makefile @@ -4,4 +4,7 @@ MODULE = cpu # add a list of subdirectories, that should also be build DIRS = periph $(RIOTCPU)/cortexm_common $(RIOTCPU)/nrf5x_common +# (file triggers compiler bug. see #5775) +SRC_NOLTO += vectors.c + include $(RIOTBASE)/Makefile.base diff --git a/cpu/sam3/Makefile b/cpu/sam3/Makefile index 21f0d1871..edc9a57a6 100644 --- a/cpu/sam3/Makefile +++ b/cpu/sam3/Makefile @@ -4,4 +4,7 @@ MODULE = cpu # add a list of subdirectories, that should also be build DIRS = periph $(RIOTCPU)/cortexm_common +# (file triggers compiler bug. see #5775) +SRC_NOLTO += vectors.c + include $(RIOTBASE)/Makefile.base diff --git a/cpu/samd21/Makefile b/cpu/samd21/Makefile index 6f9d9482c..f042e7599 100644 --- a/cpu/samd21/Makefile +++ b/cpu/samd21/Makefile @@ -4,4 +4,7 @@ MODULE = cpu # add a list of subdirectories, that should also be build DIRS = periph $(RIOTCPU)/cortexm_common $(RIOTCPU)/sam21_common +# (file triggers compiler bug. see #5775) +SRC_NOLTO += vectors.c + include $(RIOTBASE)/Makefile.base diff --git a/cpu/saml21/Makefile b/cpu/saml21/Makefile index 6f9d9482c..f042e7599 100644 --- a/cpu/saml21/Makefile +++ b/cpu/saml21/Makefile @@ -4,4 +4,7 @@ MODULE = cpu # add a list of subdirectories, that should also be build DIRS = periph $(RIOTCPU)/cortexm_common $(RIOTCPU)/sam21_common +# (file triggers compiler bug. see #5775) +SRC_NOLTO += vectors.c + include $(RIOTBASE)/Makefile.base diff --git a/cpu/stm32f0/Makefile b/cpu/stm32f0/Makefile index 9836e38e6..9ee4ce4e3 100644 --- a/cpu/stm32f0/Makefile +++ b/cpu/stm32f0/Makefile @@ -4,4 +4,7 @@ MODULE = cpu # add a list of subdirectories, that should also be build DIRS = periph $(RIOTCPU)/cortexm_common $(RIOTCPU)/stm32_common +# (file triggers compiler bug. see #5775) +SRC_NOLTO += vectors.c + include $(RIOTBASE)/Makefile.base diff --git a/cpu/stm32f1/Makefile b/cpu/stm32f1/Makefile index 957260e9b..7610bbb5e 100644 --- a/cpu/stm32f1/Makefile +++ b/cpu/stm32f1/Makefile @@ -4,4 +4,7 @@ MODULE = cpu # add a list of subdirectories, that should also be build DIRS += periph $(RIOTCPU)/cortexm_common $(RIOTCPU)/stm32_common +# (file triggers compiler bug. see #5775) +SRC_NOLTO += vectors.c + include $(RIOTBASE)/Makefile.base diff --git a/cpu/stm32f3/Makefile b/cpu/stm32f3/Makefile index 9836e38e6..9ee4ce4e3 100644 --- a/cpu/stm32f3/Makefile +++ b/cpu/stm32f3/Makefile @@ -4,4 +4,7 @@ MODULE = cpu # add a list of subdirectories, that should also be build DIRS = periph $(RIOTCPU)/cortexm_common $(RIOTCPU)/stm32_common +# (file triggers compiler bug. see #5775) +SRC_NOLTO += vectors.c + include $(RIOTBASE)/Makefile.base diff --git a/cpu/stm32f4/Makefile b/cpu/stm32f4/Makefile index 9836e38e6..9ee4ce4e3 100644 --- a/cpu/stm32f4/Makefile +++ b/cpu/stm32f4/Makefile @@ -4,4 +4,7 @@ MODULE = cpu # add a list of subdirectories, that should also be build DIRS = periph $(RIOTCPU)/cortexm_common $(RIOTCPU)/stm32_common +# (file triggers compiler bug. see #5775) +SRC_NOLTO += vectors.c + include $(RIOTBASE)/Makefile.base diff --git a/cpu/stm32l1/Makefile b/cpu/stm32l1/Makefile index 957260e9b..7610bbb5e 100644 --- a/cpu/stm32l1/Makefile +++ b/cpu/stm32l1/Makefile @@ -4,4 +4,7 @@ MODULE = cpu # add a list of subdirectories, that should also be build DIRS += periph $(RIOTCPU)/cortexm_common $(RIOTCPU)/stm32_common +# (file triggers compiler bug. see #5775) +SRC_NOLTO += vectors.c + include $(RIOTBASE)/Makefile.base From 76fc7a56c94f631273e42a0038d3ece1840c2c0c Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Mon, 29 Aug 2016 17:24:02 +0200 Subject: [PATCH 17/18] cpu: kw2x: rename vector.c -> vectors.c, add to SRC_NOLTO --- cpu/kw2x/Makefile | 3 +++ cpu/kw2x/Makefile.include | 2 +- cpu/kw2x/{vector.c => vectors.c} | 0 3 files changed, 4 insertions(+), 1 deletion(-) rename cpu/kw2x/{vector.c => vectors.c} (100%) diff --git a/cpu/kw2x/Makefile b/cpu/kw2x/Makefile index 12ba41f9c..68605a469 100644 --- a/cpu/kw2x/Makefile +++ b/cpu/kw2x/Makefile @@ -4,4 +4,7 @@ MODULE = cpu # add a list of subdirectories, that should also be build DIRS = periph $(RIOTCPU)/cortexm_common $(KINETIS_COMMON) +# (file triggers compiler bug. see #5775) +SRC_NOLTO += vectors.c + include $(RIOTBASE)/Makefile.base diff --git a/cpu/kw2x/Makefile.include b/cpu/kw2x/Makefile.include index 9d48993ba..14bbd8edf 100644 --- a/cpu/kw2x/Makefile.include +++ b/cpu/kw2x/Makefile.include @@ -19,6 +19,6 @@ export CFLAGS += -DCPU_ARCH_$(ARCH) export COMMON_STARTUP = $(KINETIS_COMMON) # add the CPU specific system calls implementations for the linker -export UNDEF += $(BINDIR)cpu/vector.o +export UNDEF += $(BINDIR)cpu/vectors.o include $(RIOTCPU)/Makefile.include.cortexm_common diff --git a/cpu/kw2x/vector.c b/cpu/kw2x/vectors.c similarity index 100% rename from cpu/kw2x/vector.c rename to cpu/kw2x/vectors.c From d1198b489dc4c169ea62929b60cdca86f75017ac Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Mon, 29 Aug 2016 17:25:20 +0200 Subject: [PATCH 18/18] cpu: k60: rename vector.c -> vectors.c, add to SRC_NOLTO --- cpu/k60/Makefile | 3 +++ cpu/k60/Makefile.include | 2 +- cpu/k60/{vector.c => vectors.c} | 0 3 files changed, 4 insertions(+), 1 deletion(-) rename cpu/k60/{vector.c => vectors.c} (100%) diff --git a/cpu/k60/Makefile b/cpu/k60/Makefile index 12ba41f9c..68605a469 100644 --- a/cpu/k60/Makefile +++ b/cpu/k60/Makefile @@ -4,4 +4,7 @@ MODULE = cpu # add a list of subdirectories, that should also be build DIRS = periph $(RIOTCPU)/cortexm_common $(KINETIS_COMMON) +# (file triggers compiler bug. see #5775) +SRC_NOLTO += vectors.c + include $(RIOTBASE)/Makefile.base diff --git a/cpu/k60/Makefile.include b/cpu/k60/Makefile.include index f6f2bac00..a76b56d46 100644 --- a/cpu/k60/Makefile.include +++ b/cpu/k60/Makefile.include @@ -19,7 +19,7 @@ export CFLAGS += -DCPU_ARCH_$(ARCH) export COMMON_STARTUP = $(KINETIS_COMMON) # add the CPU specific system calls implementations for the linker -export UNDEF += $(BINDIR)cpu/vector.o +export UNDEF += $(BINDIR)cpu/vectors.o export UNDEF += $(BINDIR)cpu/ssp.o include $(RIOTCPU)/Makefile.include.cortexm_common diff --git a/cpu/k60/vector.c b/cpu/k60/vectors.c similarity index 100% rename from cpu/k60/vector.c rename to cpu/k60/vectors.c