diff --git a/Makefile.cflags b/Makefile.cflags index ba94fa89c9..eccfb6b33f 100644 --- a/Makefile.cflags +++ b/Makefile.cflags @@ -41,3 +41,9 @@ endif # Unwanted flags for c++ CXXUWFLAGS += -std=% + +ifeq ($(LTO),yes) + LTOFLAGS = -flto -ffat-lto-objects + CFLAGS += ${LTOFLAGS} + LINKFLAGS += ${LTOFLAGS} +endif diff --git a/cpu/stm32f1/startup.c b/cpu/stm32f1/startup.c index 2eea683c81..0e13583593 100644 --- a/cpu/stm32f1/startup.c +++ b/cpu/stm32f1/startup.c @@ -188,7 +188,7 @@ void isr_dma2_ch4_5(void) __attribute__ ((weak, alias("dummy_handler"))); /* interrupt vector table */ -__attribute__ ((section(".vectors"))) +__attribute__ ((section(".vectors"))) __attribute__((used)) const void *interrupt_vector[] = { /* Stack pointer */ (void*) (&_estack), /* pointer to the top of the empty stack */