aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2025-04-08 14:21:35 -0400
committerKevin O'Connor <kevin@koconnor.net>2025-04-16 13:17:19 -0400
commit8087200ffe2fbbe62265dd480ce8be67db8349eb (patch)
tree17563eb1034f6074c692e6b7580fc7a7783dbdf7 /Makefile
parent61c0c8d2ef40340781835dd53fb04cc7a454e37a (diff)
downloadkutter-8087200ffe2fbbe62265dd480ce8be67db8349eb.tar.gz
kutter-8087200ffe2fbbe62265dd480ce8be67db8349eb.tar.xz
kutter-8087200ffe2fbbe62265dd480ce8be67db8349eb.zip
Makefile: Don't disable gcc's use-linker-plugin option
This option seems to be confusing ld's region usage checks (builds that could fit in small chips are being reported as not fitting). The option was disabled back in commit 4e8674d5 because it showed worse results. However, recent versions of gcc seem to produce the same results even if this option is enabled, so change the build to avoid disabling that option on newer versions of gcc (those that have the -ffat-lto-objects option - which is needed to ensure compile_time_requests sections can be extracted with objcopy). The PRU build is dependent on -fuse-linker-plugin, so enable that option explicitly in its build. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 3 insertions, 2 deletions
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 <kevin@koconnor.net>
+# Copyright (C) 2016-2025 Kevin O'Connor <kevin@koconnor.net>
#
# 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