diff --git a/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/Makefile b/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/Makefile index 1e889cbc4a..a89e3891cd 100644 --- a/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/Makefile +++ b/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/Makefile @@ -44,13 +44,10 @@ DEPDIR = $(BUILDDIR)/dep DEF += -DNDEBUG -DCHIP_LPC11CXX -DCORE_M0 -DTHUMB_NO_INTERWORKING -U__STRICT_ANSI__ -FLAGS = -mthumb -mcpu=cortex-m0 -mno-thumb-interwork +FLAGS = -mthumb -mcpu=cortex-m0 -mno-thumb-interwork -flto -Os -g3 -Wall -Wextra -Werror -ffunction-sections \ + -fdata-sections -fno-common -fno-exceptions -fno-unwind-tables -fno-stack-protector -fomit-frame-pointer -C_CPP_FLAGS = $(FLAGS) -Os -g3 -Wall -Wextra -Werror -ffunction-sections -fdata-sections \ - -fno-common -fno-exceptions -fno-unwind-tables -fno-stack-protector -fomit-frame-pointer - -# Dependencies -C_CPP_FLAGS += -MD -MP -MF $(DEPDIR)/$(@F).d +C_CPP_FLAGS = $(FLAGS) -MD -MP -MF $(DEPDIR)/$(@F).d CFLAGS = $(C_CPP_FLAGS) -std=c99 diff --git a/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/sys/crt0.c b/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/sys/crt0.c index 361e2f18b9..49f478619f 100644 --- a/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/sys/crt0.c +++ b/libuavcan_drivers/lpc11c24/test_olimex_lpc_p11c24/src/sys/crt0.c @@ -135,8 +135,9 @@ extern void __stack_end(void); /** * Vector table for LPC11Cxx + * Must be explicitly defined 'used', otherwise LTO optimizer will discard it. */ -__attribute__ ((section("vectors"))) +__attribute__ ((used, section("vectors"))) void (* const VectorTable[64])(void) = { __stack_end, // The initial stack pointer