Skip to content

Commit 5d68005

Browse files
committed
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>
1 parent ecbd10d commit 5d68005

File tree

3 files changed

+15
-18
lines changed

3 files changed

+15
-18
lines changed

arch/s390/boot/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,6 @@ install: $(CONFIGURE) $(obj)/bzImage
6767
sh -x $(srctree)/$(obj)/install.sh $(KERNELRELEASE) $(obj)/bzImage \
6868
System.map "$(INSTALL_PATH)"
6969

70-
chkbss := $(OBJECTS)
71-
chkbss-target := $(obj)/startup.a
70+
chkbss := $(obj-y)
71+
chkbss-target := startup.a
7272
include $(srctree)/arch/s390/scripts/Makefile.chkbss

arch/s390/boot/compressed/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,6 @@ OBJCOPYFLAGS_piggy.o := -I binary -O elf64-s390 -B s390:64-bit --rename-section
6363
$(obj)/piggy.o: $(obj)/vmlinux.bin$(suffix-y) FORCE
6464
$(call if_changed,objcopy)
6565

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
6868
include $(srctree)/arch/s390/scripts/Makefile.chkbss

arch/s390/scripts/Makefile.chkbss

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
# SPDX-License-Identifier: GPL-2.0
22

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+
312
quiet_cmd_chkbss = CHKBSS $<
4-
define cmd_chkbss
5-
rm -f $@; \
13+
cmd_chkbss = \
614
if ! $(OBJDUMP) -j .bss -w -h $< | awk 'END { if ($$3) exit 1 }'; then \
715
echo "error: $< .bss section is not empty" >&2; exit 1; \
816
fi; \
917
touch $@;
10-
endef
11-
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))
2118

22-
%.o.chkbss: %.o
19+
$(obj)/%.o.chkbss: $(obj)/%.o
2320
$(call cmd,chkbss)

0 commit comments

Comments
 (0)