diff --git a/ports/stm32/Makefile b/ports/stm32/Makefile index abca3a05f8..66c2171658 100644 --- a/ports/stm32/Makefile +++ b/ports/stm32/Makefile @@ -169,7 +169,7 @@ ifeq ($(LTO),1) CFLAGS += -flto=auto # LTO requires passing compiler flags to the linker as it will run the assembler. # To avoid risk of missing something relevant, pass all flags except for preprocessor args -LDFLAGS += $(filter-out -I%,$(filter-out -D%,$(CFLAGS))) +LDFLAGS += $(filter-out -fplugin%, $(filter-out -I%,$(filter-out -D%,$(CFLAGS)))) $(BUILD)/stm32_it.o $(BUILD)/pendsv.o: CFLAGS += -fno-lto endif