Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

s390: make built-in.a not directly depend on *.o.chkbss files

When I was refactoring cmd_ar_builtin in scripts/Makefile.build,
I noticed the build breakage of s390.

Some Makefiles of s390 add extra dependencies to built-in.a;
built-in.a depends on timestamp files *.o.chkbss, but $(AR) does
not want to include them into built-in.a.

Insert a phony target 'chkbss' in between so that $(AR) can take
$(filter-out $(PHONY), $^) as input.

While I was here, I refactored Makefile.chkbss a little bit.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>

+15 -18
+2 -2
arch/s390/boot/Makefile
··· 67 67 sh -x $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \ 68 68 System.map "$(INSTALL_PATH)" 69 69 70 - chkbss := $(OBJECTS) 71 - chkbss-target := $(obj)/startup.a 70 + chkbss := $(obj-y) 71 + chkbss-target := startup.a 72 72 include $(srctree)/arch/s390/scripts/Makefile.chkbss
+2 -2
arch/s390/boot/compressed/Makefile
··· 63 63 $(obj)/piggy.o: $(obj)/vmlinux.bin$(suffix-y) FORCE 64 64 $(call if_changed,objcopy) 65 65 66 - chkbss := $(filter-out $(obj)/piggy.o $(obj)/info.o,$(OBJECTS)) 67 - chkbss-target := $(obj)/vmlinux.bin 66 + chkbss := $(filter-out piggy.o info.o, $(obj-y)) 67 + chkbss-target := vmlinux.bin 68 68 include $(srctree)/arch/s390/scripts/Makefile.chkbss
+11 -14
arch/s390/scripts/Makefile.chkbss
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 3 + chkbss-target ?= built-in.a 4 + $(obj)/$(chkbss-target): chkbss 5 + 6 + chkbss-files := $(addsuffix .chkbss, $(chkbss)) 7 + clean-files += $(chkbss-files) 8 + 9 + PHONY += chkbss 10 + chkbss: $(addprefix $(obj)/, $(chkbss-files)) 11 + 3 12 quiet_cmd_chkbss = CHKBSS $< 4 - define cmd_chkbss 5 - rm -f $@; \ 13 + cmd_chkbss = \ 6 14 if ! $(OBJDUMP) -j .bss -w -h $< | awk 'END { if ($$3) exit 1 }'; then \ 7 15 echo "error: $< .bss section is not empty" >&2; exit 1; \ 8 16 fi; \ 9 17 touch $@; 10 - endef 11 18 12 - chkbss-target ?= $(obj)/built-in.a 13 - ifneq (,$(findstring /,$(chkbss))) 14 - chkbss-files := $(patsubst %, %.chkbss, $(chkbss)) 15 - else 16 - chkbss-files := $(patsubst %, $(obj)/%.chkbss, $(chkbss)) 17 - endif 18 - 19 - $(chkbss-target): $(chkbss-files) 20 - targets += $(notdir $(chkbss-files)) 21 - 22 - %.o.chkbss: %.o 19 + $(obj)/%.o.chkbss: $(obj)/%.o 23 20 $(call cmd,chkbss)