From: Ian Rogers Date: Tue, 11 Mar 2025 21:36:23 +0000 (-0700) Subject: tools/build: Don't pass test log files to linker X-Git-Tag: v6.6.93~382 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ec59dfbc1ba2fd6e0fa9fd603348af786f17e207;p=thirdparty%2Fkernel%2Fstable.git tools/build: Don't pass test log files to linker [ Upstream commit 935e7cb5bb80106ff4f2fe39640f430134ef8cd8 ] Separate test log files from object files. Depend on test log output but don't pass to the linker. Reviewed-by: James Clark Signed-off-by: Ian Rogers Link: https://lore.kernel.org/r/20250311213628.569562-2-irogers@google.com Signed-off-by: Namhyung Kim Signed-off-by: Sasha Levin --- diff --git a/tools/build/Makefile.build b/tools/build/Makefile.build index fac42486a8cf0..27f4ee9cb4db4 100644 --- a/tools/build/Makefile.build +++ b/tools/build/Makefile.build @@ -141,6 +141,10 @@ objprefix := $(subst ./,,$(OUTPUT)$(dir)/) obj-y := $(addprefix $(objprefix),$(obj-y)) subdir-obj-y := $(addprefix $(objprefix),$(subdir-obj-y)) +# Separate out test log files from real build objects. +test-y := $(filter %_log, $(obj-y)) +obj-y := $(filter-out %_log, $(obj-y)) + # Final '$(obj)-in.o' object in-target := $(objprefix)$(obj)-in.o @@ -151,7 +155,7 @@ $(subdir-y): $(sort $(subdir-obj-y)): $(subdir-y) ; -$(in-target): $(obj-y) FORCE +$(in-target): $(obj-y) $(test-y) FORCE $(call rule_mkdir) $(call if_changed,$(host)ld_multi)