* [PATCH] build: fix recurse-all target
@ 2020-08-31 12:56 Paolo Bonzini
2020-08-31 13:50 ` Miroslav Rezanina
2020-08-31 13:51 ` Thomas Huth
0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2020-08-31 12:56 UTC (permalink / raw)
To: qemu-devel; +Cc: thuth, Miroslav Rezanina
The missing "/all" suffix prevents the pc-bios/ parts of the build
from running.
In the meanwhile, -Wall has moved from QEMU_CFLAGS to CFLAGS. Simplify
everything by not passing down CFLAGS, and add -Wall in the recursive
Makefiles.
Reported-by: Miroslav Rezanina <mrezanin@redhat.com>
Fixes: 5e6d1573b4 ("remove Makefile.target", 2020-08-21)
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
Makefile | 4 ++--
pc-bios/optionrom/Makefile | 8 ++------
pc-bios/s390-ccw/Makefile | 3 ++-
3 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/Makefile b/Makefile
index 27bf8156ec..7230f0f1f3 100644
--- a/Makefile
+++ b/Makefile
@@ -186,10 +186,10 @@ ROM_DIRS_RULES=$(foreach t, all clean, $(addsuffix /$(t), $(ROM_DIRS)))
# Only keep -O and -g cflags
.PHONY: $(ROM_DIRS_RULES)
$(ROM_DIRS_RULES):
- $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" CFLAGS="$(filter -O% -g%,$(CFLAGS))" $(notdir $@),)
+ $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),)
.PHONY: recurse-all recurse-clean
-recurse-all: $(ROM_DIRS)
+recurse-all: $(addsuffix /all, $(ROM_DIRS))
recurse-clean: $(addsuffix /clean, $(ROM_DIRS))
######################################################################
diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
index 51cb6ca9d8..6495802d9f 100644
--- a/pc-bios/optionrom/Makefile
+++ b/pc-bios/optionrom/Makefile
@@ -8,15 +8,12 @@ all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin
@true
include ../../config-host.mak
+CFLAGS = -O2 -g
quiet-command = $(if $(V),$1,$(if $(2),@printf " %-7s %s\n" $2 $3 && $1, @$1))
cc-option = $(if $(shell $(CC) $1 -S -o /dev/null -xc /dev/null >/dev/null 2>&1 && echo OK), $1, $2)
-# Compiling with no optimization creates ROMs that are too large
-ifeq ($(lastword $(filter -O%, -O0 $(CFLAGS))),-O0)
-override CFLAGS += -O2
-endif
-override CFLAGS += -march=i486
+override CFLAGS += -march=i486 -Wall
# Flags for dependency generation
override CPPFLAGS += -MMD -MP -MT $@ -MF $(@D)/$(*F).d
@@ -42,7 +39,6 @@ Wa = -Wa,
override ASFLAGS += -32
override CFLAGS += $(call cc-option, $(Wa)-32)
-
LD_I386_EMULATION ?= elf_i386
override LDFLAGS = -m $(LD_I386_EMULATION) -T $(SRC_DIR)/flat.lds
override LDFLAGS += $(LDFLAGS_NOPIE)
diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile
index cc0f77baa6..3eb785048a 100644
--- a/pc-bios/s390-ccw/Makefile
+++ b/pc-bios/s390-ccw/Makefile
@@ -3,6 +3,7 @@ all: build-all
@true
include ../../config-host.mak
+CFLAGS = -O2 -g
quiet-command = $(if $(V),$1,$(if $(2),@printf " %-7s %s\n" $2 $3 && $1, @$1))
cc-option = $(if $(shell $(CC) $1 -S -o /dev/null -xc /dev/null > /dev/null \
@@ -28,7 +29,7 @@ QEMU_DGFLAGS = -MMD -MP -MT $@ -MF $(@D)/$(*F).d
OBJECTS = start.o main.o bootmap.o jump2ipl.o sclp.o menu.o \
virtio.o virtio-scsi.o virtio-blkdev.o libc.o cio.o dasd-ipl.o
-QEMU_CFLAGS := $(filter -W%, $(QEMU_CFLAGS))
+QEMU_CFLAGS := -Wall $(filter -W%, $(QEMU_CFLAGS))
QEMU_CFLAGS += -ffreestanding -fno-delete-null-pointer-checks -msoft-float
QEMU_CFLAGS += -march=z900 -fPIE -fno-strict-aliasing
QEMU_CFLAGS += -fno-asynchronous-unwind-tables
--
2.26.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] build: fix recurse-all target
2020-08-31 12:56 [PATCH] build: fix recurse-all target Paolo Bonzini
@ 2020-08-31 13:50 ` Miroslav Rezanina
2020-08-31 13:51 ` Thomas Huth
1 sibling, 0 replies; 3+ messages in thread
From: Miroslav Rezanina @ 2020-08-31 13:50 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: thuth, qemu-devel
----- Original Message -----
> From: "Paolo Bonzini" <pbonzini@redhat.com>
> To: qemu-devel@nongnu.org
> Cc: thuth@redhat.com, "Miroslav Rezanina" <mrezanin@redhat.com>
> Sent: Monday, August 31, 2020 2:56:45 PM
> Subject: [PATCH] build: fix recurse-all target
>
> The missing "/all" suffix prevents the pc-bios/ parts of the build
> from running.
>
> In the meanwhile, -Wall has moved from QEMU_CFLAGS to CFLAGS. Simplify
> everything by not passing down CFLAGS, and add -Wall in the recursive
> Makefiles.
>
> Reported-by: Miroslav Rezanina <mrezanin@redhat.com>
> Fixes: 5e6d1573b4 ("remove Makefile.target", 2020-08-21)
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> Makefile | 4 ++--
> pc-bios/optionrom/Makefile | 8 ++------
> pc-bios/s390-ccw/Makefile | 3 ++-
> 3 files changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 27bf8156ec..7230f0f1f3 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -186,10 +186,10 @@ ROM_DIRS_RULES=$(foreach t, all clean, $(addsuffix
> /$(t), $(ROM_DIRS)))
> # Only keep -O and -g cflags
> .PHONY: $(ROM_DIRS_RULES)
> $(ROM_DIRS_RULES):
> - $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)"
> TARGET_DIR="$(dir $@)" CFLAGS="$(filter -O% -g%,$(CFLAGS))" $(notdir $@),)
> + $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)"
> TARGET_DIR="$(dir $@)" $(notdir $@),)
>
> .PHONY: recurse-all recurse-clean
> -recurse-all: $(ROM_DIRS)
> +recurse-all: $(addsuffix /all, $(ROM_DIRS))
> recurse-clean: $(addsuffix /clean, $(ROM_DIRS))
>
> ######################################################################
> diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
> index 51cb6ca9d8..6495802d9f 100644
> --- a/pc-bios/optionrom/Makefile
> +++ b/pc-bios/optionrom/Makefile
> @@ -8,15 +8,12 @@ all: multiboot.bin linuxboot.bin linuxboot_dma.bin
> kvmvapic.bin pvh.bin
> @true
>
> include ../../config-host.mak
> +CFLAGS = -O2 -g
>
> quiet-command = $(if $(V),$1,$(if $(2),@printf " %-7s %s\n" $2 $3 && $1,
> @$1))
> cc-option = $(if $(shell $(CC) $1 -S -o /dev/null -xc /dev/null >/dev/null
> 2>&1 && echo OK), $1, $2)
>
> -# Compiling with no optimization creates ROMs that are too large
> -ifeq ($(lastword $(filter -O%, -O0 $(CFLAGS))),-O0)
> -override CFLAGS += -O2
> -endif
> -override CFLAGS += -march=i486
> +override CFLAGS += -march=i486 -Wall
>
> # Flags for dependency generation
> override CPPFLAGS += -MMD -MP -MT $@ -MF $(@D)/$(*F).d
> @@ -42,7 +39,6 @@ Wa = -Wa,
> override ASFLAGS += -32
> override CFLAGS += $(call cc-option, $(Wa)-32)
>
> -
> LD_I386_EMULATION ?= elf_i386
> override LDFLAGS = -m $(LD_I386_EMULATION) -T $(SRC_DIR)/flat.lds
> override LDFLAGS += $(LDFLAGS_NOPIE)
> diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile
> index cc0f77baa6..3eb785048a 100644
> --- a/pc-bios/s390-ccw/Makefile
> +++ b/pc-bios/s390-ccw/Makefile
> @@ -3,6 +3,7 @@ all: build-all
> @true
>
> include ../../config-host.mak
> +CFLAGS = -O2 -g
>
> quiet-command = $(if $(V),$1,$(if $(2),@printf " %-7s %s\n" $2 $3 && $1,
> @$1))
> cc-option = $(if $(shell $(CC) $1 -S -o /dev/null -xc /dev/null > /dev/null
> \
> @@ -28,7 +29,7 @@ QEMU_DGFLAGS = -MMD -MP -MT $@ -MF $(@D)/$(*F).d
> OBJECTS = start.o main.o bootmap.o jump2ipl.o sclp.o menu.o \
> virtio.o virtio-scsi.o virtio-blkdev.o libc.o cio.o dasd-ipl.o
>
> -QEMU_CFLAGS := $(filter -W%, $(QEMU_CFLAGS))
> +QEMU_CFLAGS := -Wall $(filter -W%, $(QEMU_CFLAGS))
> QEMU_CFLAGS += -ffreestanding -fno-delete-null-pointer-checks -msoft-float
> QEMU_CFLAGS += -march=z900 -fPIE -fno-strict-aliasing
> QEMU_CFLAGS += -fno-asynchronous-unwind-tables
> --
> 2.26.2
>
>
Missing roms built with the fix.
Reviewed-by: Miroslav Rezanina <mrezanin@redhat.com>
--
Miroslav Rezanina
Software Engineer - Virtualization Team Maintainer
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] build: fix recurse-all target
2020-08-31 12:56 [PATCH] build: fix recurse-all target Paolo Bonzini
2020-08-31 13:50 ` Miroslav Rezanina
@ 2020-08-31 13:51 ` Thomas Huth
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Huth @ 2020-08-31 13:51 UTC (permalink / raw)
To: Paolo Bonzini, qemu-devel; +Cc: Miroslav Rezanina, Janosch Frank
On 31/08/2020 14.56, Paolo Bonzini wrote:
> The missing "/all" suffix prevents the pc-bios/ parts of the build
> from running.
>
> In the meanwhile, -Wall has moved from QEMU_CFLAGS to CFLAGS. Simplify
> everything by not passing down CFLAGS, and add -Wall in the recursive
> Makefiles.
>
> Reported-by: Miroslav Rezanina <mrezanin@redhat.com>
> Fixes: 5e6d1573b4 ("remove Makefile.target", 2020-08-21)
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> Makefile | 4 ++--
> pc-bios/optionrom/Makefile | 8 ++------
> pc-bios/s390-ccw/Makefile | 3 ++-
> 3 files changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/Makefile b/Makefile
> index 27bf8156ec..7230f0f1f3 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -186,10 +186,10 @@ ROM_DIRS_RULES=$(foreach t, all clean, $(addsuffix /$(t), $(ROM_DIRS)))
> # Only keep -O and -g cflags
> .PHONY: $(ROM_DIRS_RULES)
> $(ROM_DIRS_RULES):
> - $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" CFLAGS="$(filter -O% -g%,$(CFLAGS))" $(notdir $@),)
> + $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $(dir $@) V="$(V)" TARGET_DIR="$(dir $@)" $(notdir $@),)
>
> .PHONY: recurse-all recurse-clean
> -recurse-all: $(ROM_DIRS)
> +recurse-all: $(addsuffix /all, $(ROM_DIRS))
> recurse-clean: $(addsuffix /clean, $(ROM_DIRS))
>
> ######################################################################
> diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
> index 51cb6ca9d8..6495802d9f 100644
> --- a/pc-bios/optionrom/Makefile
> +++ b/pc-bios/optionrom/Makefile
> @@ -8,15 +8,12 @@ all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin
> @true
>
> include ../../config-host.mak
> +CFLAGS = -O2 -g
>
> quiet-command = $(if $(V),$1,$(if $(2),@printf " %-7s %s\n" $2 $3 && $1, @$1))
> cc-option = $(if $(shell $(CC) $1 -S -o /dev/null -xc /dev/null >/dev/null 2>&1 && echo OK), $1, $2)
>
> -# Compiling with no optimization creates ROMs that are too large
> -ifeq ($(lastword $(filter -O%, -O0 $(CFLAGS))),-O0)
> -override CFLAGS += -O2
> -endif
> -override CFLAGS += -march=i486
> +override CFLAGS += -march=i486 -Wall
>
> # Flags for dependency generation
> override CPPFLAGS += -MMD -MP -MT $@ -MF $(@D)/$(*F).d
> @@ -42,7 +39,6 @@ Wa = -Wa,
> override ASFLAGS += -32
> override CFLAGS += $(call cc-option, $(Wa)-32)
>
> -
> LD_I386_EMULATION ?= elf_i386
> override LDFLAGS = -m $(LD_I386_EMULATION) -T $(SRC_DIR)/flat.lds
> override LDFLAGS += $(LDFLAGS_NOPIE)
> diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile
> index cc0f77baa6..3eb785048a 100644
> --- a/pc-bios/s390-ccw/Makefile
> +++ b/pc-bios/s390-ccw/Makefile
> @@ -3,6 +3,7 @@ all: build-all
> @true
>
> include ../../config-host.mak
> +CFLAGS = -O2 -g
>
> quiet-command = $(if $(V),$1,$(if $(2),@printf " %-7s %s\n" $2 $3 && $1, @$1))
> cc-option = $(if $(shell $(CC) $1 -S -o /dev/null -xc /dev/null > /dev/null \
> @@ -28,7 +29,7 @@ QEMU_DGFLAGS = -MMD -MP -MT $@ -MF $(@D)/$(*F).d
> OBJECTS = start.o main.o bootmap.o jump2ipl.o sclp.o menu.o \
> virtio.o virtio-scsi.o virtio-blkdev.o libc.o cio.o dasd-ipl.o
>
> -QEMU_CFLAGS := $(filter -W%, $(QEMU_CFLAGS))
> +QEMU_CFLAGS := -Wall $(filter -W%, $(QEMU_CFLAGS))
> QEMU_CFLAGS += -ffreestanding -fno-delete-null-pointer-checks -msoft-float
> QEMU_CFLAGS += -march=z900 -fPIE -fno-strict-aliasing
> QEMU_CFLAGS += -fno-asynchronous-unwind-tables
>
Thanks, this fixes the build of the s390-ccw bios on s390x, too!
Tested-by: Thomas Huth <thuth@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-08-31 13:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-31 12:56 [PATCH] build: fix recurse-all target Paolo Bonzini
2020-08-31 13:50 ` Miroslav Rezanina
2020-08-31 13:51 ` Thomas Huth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).