From 121d5d80137f270e4828f457f717e9ab365f303b Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Mon, 4 Nov 2019 13:07:53 +0100 Subject: [PATCH] zipl: Fix dependency generation in zipl/boot MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When adding new header from zipl/include to a .c file within zipl/boot a compiler error appears stage3.c:16:10: fatal error: zipl.h: No such file or directory #include "zipl.h" ^~~~~~~~ compilation terminated. CC zipl/boot/stage3.o This is because the rule to generate dependencies (*.o.d) does not use the CFLAGS_BOOT. Thus it cannot find the header and fails. Note this only applies to the dependency generation, the actual build succeeds. To fix this rename the CFLAGS_BOOT to ALL_CFLAGS. Using ALL_CFLAGS instead of e.g. ALL_CPPFLAGS is important to also overwrite flags given on the commandline via OPT_FLAGS, e.g. make V=1 OPT_FLAGS="-D__FOO__" While at it also remove the unused and wrong '-D__ASSEMBLY__'. Fixes: 5a6605fe ("zipl: Ensure that boot loader CFLAGS are not overwritten") Fixes: aa913b1e ("build process: Add automatic dependency generation") Signed-off-by: Philipp Rudo Reviewed-by: Stefan Haberland Signed-off-by: Jan Höppner --- zipl/boot/Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zipl/boot/Makefile b/zipl/boot/Makefile index 225a1110..d0ae01a1 100644 --- a/zipl/boot/Makefile +++ b/zipl/boot/Makefile @@ -1,7 +1,7 @@ # Common definitions include ../../common.mak -CFLAGS_BOOT = $(NO_PIE_CFLAGS) -Os -g -I../include -D__ASSEMBLY__ \ +ALL_CFLAGS = $(NO_PIE_CFLAGS) -Os -g -I $(rootdir)/zipl/include \ -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \ -fno-builtin -ffreestanding -fno-asynchronous-unwind-tables \ -fno-delete-null-pointer-checks \ @@ -21,10 +21,10 @@ all: data.o data.h tape0.bin stage3.bin %: %.S %.o: %.S - $(CC) $(CFLAGS_BOOT) -c -o $@ $< + $(CC) $(ALL_CFLAGS) -c -o $@ $< %.o: %.c - $(CC) $(CFLAGS_BOOT) -c -o $@ $< + $(CC) $(ALL_CFLAGS) -c -o $@ $< eckd2dump_sv.exec: \ head.o stage2dump.o cio.o eckd2dump.o eckd2dump_sv.o \