summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRahul Pathak <[email protected]>2025-11-10 22:13:52 +0530
committerAnup Patel <[email protected]>2025-12-01 11:27:50 +0530
commitd28e2fa9cc7a43d60beb0d9b48e25726c9311d51 (patch)
tree6002fcc07c8839862e20dd81c74708e75c2e2a07
parentc9f856e23f61e7ccbd7d8414bb98c45a5f4f04f4 (diff)
Makefile: Only enable --print-gc-section for verbose (V=1) build
Earlier this option was enabled during debug build which only prints the linker logs of removing the unused sections. Instead enable this for V=1 and keep the debug build clean. Signed-off-by: Rahul Pathak <[email protected]> Reviewed-by: Anup Patel <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Anup Patel <[email protected]>
-rw-r--r--Makefile5
1 files changed, 4 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 398eabe8..da7976d5 100644
--- a/Makefile
+++ b/Makefile
@@ -444,11 +444,14 @@ DTSCPPFLAGS = $(CPPFLAGS) -nostdinc -nostdlib -fno-builtin -D__DTS__ -x assemble
ifneq ($(DEBUG),)
CFLAGS += -O0
-ELFFLAGS += -Wl,--print-gc-sections
else
CFLAGS += -O2
endif
+ifeq ($(V), 1)
+ELFFLAGS += -Wl,--print-gc-sections
+endif
+
# Setup functions for compilation
define dynamic_flags
-I$(shell dirname $(2)) -D__OBJNAME__=$(subst -,_,$(shell basename $(1) .o))