diff --git a/Makefile b/Makefile index 735d1863..7051fe94 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # Klipper build system # -# Copyright (C) 2016-2020 Kevin O'Connor +# Copyright (C) 2016-2025 Kevin O'Connor # # This file may be distributed under the terms of the GNU GPLv3 license. @@ -33,7 +33,8 @@ CFLAGS := -iquote $(OUT) -iquote src -iquote $(OUT)board-generic/ \ -std=gnu11 -O2 -MD -Wall \ -Wold-style-definition $(call cc-option,$(CC),-Wtype-limits,) \ -ffunction-sections -fdata-sections -fno-delete-null-pointer-checks -CFLAGS += -flto=auto -fwhole-program -fno-use-linker-plugin -ggdb3 +CFLAGS += -flto=auto -fwhole-program -ggdb3 +CFLAGS += $(call cc-option,$(CC),-ffat-lto-objects,-fno-use-linker-plugin) OBJS_klipper.elf = $(patsubst %.c, $(OUT)src/%.o,$(src-y)) OBJS_klipper.elf += $(OUT)compile_time_request.o diff --git a/src/pru/Makefile b/src/pru/Makefile index c304219e..5c85f5e3 100644 --- a/src/pru/Makefile +++ b/src/pru/Makefile @@ -8,6 +8,7 @@ dirs-y += lib/pru_rpmsg CFLAGS += -Os -minrt -mmcu=am335x.pru1 CFLAGS += -Ilib/pru_rpmsg/include -Ilib/pru_rpmsg/include/am335x +CFLAGS += -fno-use-linker-plugin CFLAGS_klipper.elf := $(filter-out -mmcu=%, $(CFLAGS)) CFLAGS_klipper.elf += -Wl,-r -nostdlib -Wl,-T,src/pru/pru.lds