All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Convert pc-bios Makefiles to meson
@ 2020-09-18 20:47 marcandre.lureau
  2020-09-18 20:47 ` [PATCH 1/6] meson: convert pc-bios/s390-ccw marcandre.lureau
                   ` (7 more replies)
  0 siblings, 8 replies; 12+ messages in thread
From: marcandre.lureau @ 2020-09-18 20:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, qemu-s390x, Thomas Huth, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Hi,

Here is a series of patches to convert the remaining Makefile in pc-bios/ to
meson. I have done various tests to check that the resulting binaries are
working as expected, but I didn't cover it all, and I am not sure the test su=
ite
covers them all either.

Please review,

Marc-Andr=C3=A9 Lureau (6):
  meson: convert pc-bios/s390-ccw
  optionrom: make kvmapic.S compile with clang
  meson: convert pc-bios/optionrom
  build-sys: remove no longer needed ROMS variable
  build-sys: remove recurse-* rules
  meson: replace pc-bios/Makefile

 Makefile                      |  16 +--
 configure                     |  21 ----
 pc-bios/Makefile              |  19 ----
 pc-bios/meson.build           |  20 ++++
 pc-bios/optionrom/Makefile    |  73 --------------
 pc-bios/optionrom/kvmvapic.S  |   4 +-
 pc-bios/optionrom/meson.build |  73 ++++++++++++++
 pc-bios/s390-ccw/Makefile     |  62 ------------
 pc-bios/s390-ccw/meson.build  | 177 ++++++++++++++++++++++++++++++++++
 pc-bios/s390-ccw/netboot.mak  |  62 ------------
 subprojects/optionrom         |   1 +
 subprojects/s390-ccw          |   1 +
 12 files changed, 276 insertions(+), 253 deletions(-)
 delete mode 100644 pc-bios/Makefile
 delete mode 100644 pc-bios/optionrom/Makefile
 create mode 100644 pc-bios/optionrom/meson.build
 delete mode 100644 pc-bios/s390-ccw/Makefile
 create mode 100644 pc-bios/s390-ccw/meson.build
 delete mode 100644 pc-bios/s390-ccw/netboot.mak
 create mode 120000 subprojects/optionrom
 create mode 120000 subprojects/s390-ccw

--=20
2.26.2




^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH 1/6] meson: convert pc-bios/s390-ccw
  2020-09-18 20:47 [PATCH 0/6] Convert pc-bios Makefiles to meson marcandre.lureau
@ 2020-09-18 20:47 ` marcandre.lureau
  2020-09-18 20:47 ` [PATCH 2/6] optionrom: make kvmapic.S compile with clang marcandre.lureau
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: marcandre.lureau @ 2020-09-18 20:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, qemu-s390x, Thomas Huth, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Use a fake subproject: this is a simple workaround to avoid the
incompatible flags (such as gprof) that are set globally for the rest of
QEMU.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 configure                    |   2 -
 pc-bios/meson.build          |   4 +
 pc-bios/s390-ccw/Makefile    |  62 ------------
 pc-bios/s390-ccw/meson.build | 177 +++++++++++++++++++++++++++++++++++
 pc-bios/s390-ccw/netboot.mak |  62 ------------
 subprojects/s390-ccw         |   1 +
 6 files changed, 182 insertions(+), 126 deletions(-)
 delete mode 100644 pc-bios/s390-ccw/Makefile
 create mode 100644 pc-bios/s390-ccw/meson.build
 delete mode 100644 pc-bios/s390-ccw/netboot.mak
 create mode 120000 subprojects/s390-ccw

diff --git a/configure b/configure
index 7564479008..3a8733c9be 100755
--- a/configure
+++ b/configure
@@ -6462,7 +6462,6 @@ fi
 if test "$cpu" = "s390x" ; then
   write_c_skeleton
   if compile_prog "-march=z900" ""; then
-    roms="$roms s390-ccw"
     # SLOF is required for building the s390-ccw firmware on s390x,
     # since it is using the libnet code from SLOF for network booting.
     if test -e "${source_path}/.git" ; then
@@ -7863,7 +7862,6 @@ LINKS="Makefile"
 LINKS="$LINKS tests/tcg/lm32/Makefile"
 LINKS="$LINKS tests/tcg/Makefile.target"
 LINKS="$LINKS pc-bios/optionrom/Makefile"
-LINKS="$LINKS pc-bios/s390-ccw/Makefile"
 LINKS="$LINKS roms/seabios/Makefile"
 LINKS="$LINKS pc-bios/qemu-icon.bmp"
 LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit
diff --git a/pc-bios/meson.build b/pc-bios/meson.build
index a0d21be432..e5139b3ef5 100644
--- a/pc-bios/meson.build
+++ b/pc-bios/meson.build
@@ -91,3 +91,7 @@ endif
 
 subdir('descriptors')
 subdir('keymaps')
+
+if host_machine.cpu_family() == 's390x' and cc.has_argument('-march=z900')
+  subproject('s390-ccw')
+endif
diff --git a/pc-bios/s390-ccw/Makefile b/pc-bios/s390-ccw/Makefile
deleted file mode 100644
index 3eb785048a..0000000000
--- a/pc-bios/s390-ccw/Makefile
+++ /dev/null
@@ -1,62 +0,0 @@
-all: build-all
-# Dummy command so that make thinks it has done something
-	@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)
-
-VPATH_SUFFIXES = %.c %.h %.S %.m %.mak %.sh %.rc Kconfig% %.json.in
-set-vpath = $(if $1,$(foreach PATTERN,$(VPATH_SUFFIXES),$(eval vpath $(PATTERN) $1)))
-$(call set-vpath, $(SRC_PATH)/pc-bios/s390-ccw)
-
-# Flags for dependency generation
-QEMU_DGFLAGS = -MMD -MP -MT $@ -MF $(@D)/$(*F).d
-
-%.o: %.c
-	$(call quiet-command,$(CC) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) \
-	       -c -o $@ $<,"CC","$(TARGET_DIR)$@")
-
-%.o: %.S
-	$(call quiet-command,$(CCAS) $(QEMU_CFLAGS) $(QEMU_DGFLAGS) $(CFLAGS) \
-	       -c -o $@ $<,"CCAS","$(TARGET_DIR)$@")
-
-.PHONY : all clean build-all
-
-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 := -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
-QEMU_CFLAGS += $(call cc-option, $(QEMU_CFLAGS), -fno-stack-protector)
-LDFLAGS += -Wl,-pie -nostdlib
-
-build-all: s390-ccw.img s390-netboot.img
-
-s390-ccw.elf: $(OBJECTS)
-	$(call quiet-command,$(CC) $(LDFLAGS) -o $@ $(OBJECTS),"BUILD","$(TARGET_DIR)$@")
-
-STRIP ?= strip
-
-s390-ccw.img: s390-ccw.elf
-	$(call quiet-command,$(STRIP) --strip-unneeded $< -o $@,"STRIP","$(TARGET_DIR)$@")
-
-$(OBJECTS): Makefile
-
-ifneq ($(wildcard $(SRC_PATH)/roms/SLOF/lib/libnet),)
-include $(SRC_PATH)/pc-bios/s390-ccw/netboot.mak
-else
-s390-netboot.img:
-	@echo "s390-netboot.img not built since roms/SLOF/ is not available."
-endif
-
-ALL_OBJS = $(sort $(OBJECTS) $(NETOBJS) $(LIBCOBJS) $(LIBNETOBJS))
--include $(ALL_OBJS:%.o=%.d)
-
-clean:
-	rm -f *.o *.d *.img *.elf *~ *.a
diff --git a/pc-bios/s390-ccw/meson.build b/pc-bios/s390-ccw/meson.build
new file mode 100644
index 0000000000..0de5400287
--- /dev/null
+++ b/pc-bios/s390-ccw/meson.build
@@ -0,0 +1,177 @@
+project('s390-ccw')
+
+strip = find_program('strip')
+cc = meson.get_compiler('c')
+link_args = ['-Wl,-pie', '-nostdlib']
+
+# FIXME: find a better way to check/enable slof
+slof = '../../roms/SLOF'
+has_slof = cc.has_header('libnet/tftp.h', args: '-I' + meson.current_source_dir() / slof / 'lib')
+
+s390_cargs = [
+  '-ffreestanding',
+  '-fno-delete-null-pointer-checks',
+  '-msoft-float',
+  '-march=z900',
+  '-fPIE',
+  '-fno-strict-aliasing',
+  '-fno-asynchronous-unwind-tables',
+  cc.get_supported_arguments('-fno-stack-protector')
+]
+
+s390_incs = []
+
+s390_srcs = [
+  'bootmap.c',
+  'cio.c',
+  'dasd-ipl.c',
+  'jump2ipl.c',
+  'libc.c',
+  'main.c',
+  'menu.c',
+  'sclp.c',
+  'start.S',
+  'virtio-blkdev.c',
+  'virtio-scsi.c',
+  'virtio.c',
+]
+
+if has_slof
+  s390_srcs += [
+    'netmain.c',
+    'virtio-net.c',
+  ]
+  s390_incs += include_directories(slof / 'lib/libnet')
+  s390_incs += include_directories(slof / 'lib/libc/include')
+  s390_cargs += '-nostdinc'
+endif
+
+s390_lib = static_library(
+  's390', s390_srcs,
+  c_args: s390_cargs,
+  include_directories: s390_incs,
+)
+
+s390_ccw_elf = executable(
+  's390-ccw.elf',
+  link_args: link_args,
+  objects: s390_lib.extract_objects([
+    'bootmap.c',
+    'cio.c',
+    'dasd-ipl.c',
+    'jump2ipl.c',
+    'libc.c',
+    'main.c',
+    'menu.c',
+    'sclp.c',
+    'start.S',
+    'virtio-blkdev.c',
+    'virtio-scsi.c',
+    'virtio.c',
+  ]),
+)
+
+custom_target(
+  's390-ccw.img',
+  output: 's390-ccw.img',
+  input: s390_ccw_elf,
+  command: [strip, '--strip-unneeded', '@INPUT@', '-o', '@OUTPUT@'],
+  build_by_default: true,
+)
+
+if has_slof
+  slof_ctype = slof / 'lib/libc/ctype'
+  slof_str = slof / 'lib/libc/string'
+  slof_stdlib = slof / 'lib/libc/stdlib'
+  slof_stdio = slof / 'lib/libc/stdio'
+
+  s390_libc = static_library(
+    's390-libc', files(
+      slof_ctype / 'isdigit.c',
+      slof_ctype / 'isxdigit.c',
+      slof_ctype / 'toupper.c',
+      slof_str / 'strcat.c',
+      slof_str / 'strchr.c',
+      slof_str / 'strrchr.c',
+      slof_str / 'strcpy.c',
+      slof_str / 'strlen.c',
+      slof_str / 'strncpy.c',
+      slof_str / 'strcmp.c',
+      slof_str / 'strncmp.c',
+      slof_str / 'strcasecmp.c',
+      slof_str / 'strncasecmp.c',
+      slof_str / 'strstr.c',
+      slof_str / 'memset.c',
+      slof_str / 'memcpy.c',
+      slof_str / 'memmove.c',
+      slof_str / 'memcmp.c',
+      slof_stdlib / 'atoi.c',
+      slof_stdlib / 'atol.c',
+      slof_stdlib / 'strtoul.c',
+      slof_stdlib / 'strtol.c',
+      slof_stdlib / 'rand.c',
+      slof_stdlib / 'malloc.c',
+      slof_stdlib / 'free.c',
+      slof_stdio / 'sprintf.c',
+      slof_stdio / 'snprintf.c',
+      slof_stdio / 'vfprintf.c',
+      slof_stdio / 'vsnprintf.c',
+      slof_stdio / 'vsprintf.c',
+      slof_stdio / 'fprintf.c',
+      slof_stdio / 'printf.c',
+      slof_stdio / 'putc.c',
+      slof_stdio / 'puts.c',
+      slof_stdio / 'putchar.c',
+      slof_stdio / 'stdchnls.c',
+      slof_stdio / 'fileno.c',
+      slof / 'slof/sbrk.c',
+    ),
+    c_args: s390_cargs,
+    include_directories: s390_incs,
+  )
+
+  slof_libnet = slof / 'lib/libnet'
+  s390_libnet = static_library(
+    's390-libnet', files(
+      slof_libnet / 'args.c',
+      slof_libnet / 'dhcp.c',
+      slof_libnet / 'dns.c',
+      slof_libnet / 'icmpv6.c',
+      slof_libnet / 'ipv6.c',
+      slof_libnet / 'tcp.c',
+      slof_libnet / 'udp.c',
+      slof_libnet / 'bootp.c',
+      slof_libnet / 'dhcpv6.c',
+      slof_libnet / 'ethernet.c',
+      slof_libnet / 'ipv4.c',
+      slof_libnet / 'ndp.c',
+      slof_libnet / 'tftp.c',
+      slof_libnet / 'pxelinux.c',
+    ),
+    c_args: [s390_cargs, '-DDHCPARCH=0x1F'],
+    include_directories: s390_incs,
+  )
+
+  s390_netboot_elf = executable(
+    's390-netboot.elf',
+    link_with: [s390_libc, s390_libnet],
+    link_args: [link_args, '-Ttext=0x7800000'],
+    objects: s390_lib.extract_objects([
+      'cio.c',
+      'jump2ipl.c',
+      'netmain.c',
+      'sclp.c',
+      'start.S',
+      'virtio-net.c',
+      'virtio.c',
+    ]),
+  )
+
+  custom_target(
+    's390-netboot.img',
+    output: 's390-netboot.img',
+    input: s390_netboot_elf,
+    command: [strip, '--strip-unneeded', '@INPUT@', '-o', '@OUTPUT@'],
+    build_by_default: true,
+  )
+endif
diff --git a/pc-bios/s390-ccw/netboot.mak b/pc-bios/s390-ccw/netboot.mak
deleted file mode 100644
index 577c023afe..0000000000
--- a/pc-bios/s390-ccw/netboot.mak
+++ /dev/null
@@ -1,62 +0,0 @@
-
-SLOF_DIR := $(SRC_PATH)/roms/SLOF
-
-NETOBJS := start.o sclp.o cio.o virtio.o virtio-net.o jump2ipl.o netmain.o
-
-LIBC_INC := -nostdinc -I$(SLOF_DIR)/lib/libc/include
-LIBNET_INC := -I$(SLOF_DIR)/lib/libnet
-
-NETLDFLAGS := $(LDFLAGS) -Ttext=0x7800000
-
-$(NETOBJS): QEMU_CFLAGS += $(LIBC_INC) $(LIBNET_INC)
-
-s390-netboot.elf: $(NETOBJS) libnet.a libc.a
-	$(call quiet-command,$(CC) $(NETLDFLAGS) -o $@ $^,"BUILD","$(TARGET_DIR)$@")
-
-s390-netboot.img: s390-netboot.elf
-	$(call quiet-command,$(STRIP) --strip-unneeded $< -o $@,"STRIP","$(TARGET_DIR)$@")
-
-# libc files:
-
-LIBC_CFLAGS = $(QEMU_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \
-	      -MMD -MP -MT $@ -MF $(@:%.o=%.d)
-
-CTYPE_OBJS = isdigit.o isxdigit.o toupper.o
-%.o : $(SLOF_DIR)/lib/libc/ctype/%.c
-	$(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")
-
-STRING_OBJS = strcat.o strchr.o strrchr.o strcpy.o strlen.o strncpy.o \
-	      strcmp.o strncmp.o strcasecmp.o strncasecmp.o strstr.o \
-	      memset.o memcpy.o memmove.o memcmp.o
-%.o : $(SLOF_DIR)/lib/libc/string/%.c
-	$(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")
-
-STDLIB_OBJS = atoi.o atol.o strtoul.o strtol.o rand.o malloc.o free.o
-%.o : $(SLOF_DIR)/lib/libc/stdlib/%.c
-	$(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")
-
-STDIO_OBJS = sprintf.o snprintf.o vfprintf.o vsnprintf.o vsprintf.o fprintf.o \
-	     printf.o putc.o puts.o putchar.o stdchnls.o fileno.o
-%.o : $(SLOF_DIR)/lib/libc/stdio/%.c
-	$(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")
-
-sbrk.o: $(SLOF_DIR)/slof/sbrk.c
-	$(call quiet-command,$(CC) $(LIBC_CFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")
-
-LIBCOBJS := $(STRING_OBJS) $(CTYPE_OBJS) $(STDLIB_OBJS) $(STDIO_OBJS) sbrk.o
-
-libc.a: $(LIBCOBJS)
-	$(call quiet-command,$(AR) -rc $@ $^,"AR","$(TARGET_DIR)$@")
-
-# libnet files:
-
-LIBNETOBJS := args.o dhcp.o dns.o icmpv6.o ipv6.o tcp.o udp.o bootp.o \
-	      dhcpv6.o ethernet.o ipv4.o ndp.o tftp.o pxelinux.o
-LIBNETCFLAGS = $(QEMU_CFLAGS) $(CFLAGS) $(LIBC_INC) $(LIBNET_INC) \
-	       -DDHCPARCH=0x1F -MMD -MP -MT $@ -MF $(@:%.o=%.d)
-
-%.o : $(SLOF_DIR)/lib/libnet/%.c
-	$(call quiet-command,$(CC) $(LIBNETCFLAGS) -c -o $@ $<,"CC","$(TARGET_DIR)$@")
-
-libnet.a: $(LIBNETOBJS)
-	$(call quiet-command,$(AR) -rc $@ $^,"AR","$(TARGET_DIR)$@")
diff --git a/subprojects/s390-ccw b/subprojects/s390-ccw
new file mode 120000
index 0000000000..8a3120224b
--- /dev/null
+++ b/subprojects/s390-ccw
@@ -0,0 +1 @@
+../pc-bios/s390-ccw
\ No newline at end of file
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/6] optionrom: make kvmapic.S compile with clang
  2020-09-18 20:47 [PATCH 0/6] Convert pc-bios Makefiles to meson marcandre.lureau
  2020-09-18 20:47 ` [PATCH 1/6] meson: convert pc-bios/s390-ccw marcandre.lureau
@ 2020-09-18 20:47 ` marcandre.lureau
  2020-09-18 20:47 ` [PATCH 3/6] meson: convert pc-bios/optionrom marcandre.lureau
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: marcandre.lureau @ 2020-09-18 20:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, qemu-s390x, Thomas Huth, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Clang doesn't support specifying segment prefixes before the
instruction, and requires specifying them on the address.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 pc-bios/optionrom/kvmvapic.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pc-bios/optionrom/kvmvapic.S b/pc-bios/optionrom/kvmvapic.S
index aa17a402df..9a615549e6 100644
--- a/pc-bios/optionrom/kvmvapic.S
+++ b/pc-bios/optionrom/kvmvapic.S
@@ -104,7 +104,7 @@ mp_get_tpr_eax:
 	reenable_vtpr
 	push %ecx
 
-	fs/movzbl pcr_cpu, %eax
+	movzbl %fs:pcr_cpu, %eax
 
 	mov vcpu_shift, %ecx	; fixup
 	shl %cl, %eax
@@ -178,7 +178,7 @@ mp_set_tpr:
 	reenable_vtpr
 
 mp_set_tpr_failed:
-	fs/movzbl pcr_cpu, %edx
+	movzbl %fs:pcr_cpu, %edx
 
 	mov vcpu_shift, %ecx	; fixup
 	shl %cl, %edx
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/6] meson: convert pc-bios/optionrom
  2020-09-18 20:47 [PATCH 0/6] Convert pc-bios Makefiles to meson marcandre.lureau
  2020-09-18 20:47 ` [PATCH 1/6] meson: convert pc-bios/s390-ccw marcandre.lureau
  2020-09-18 20:47 ` [PATCH 2/6] optionrom: make kvmapic.S compile with clang marcandre.lureau
@ 2020-09-18 20:47 ` marcandre.lureau
  2020-09-18 20:47 ` [PATCH 4/6] build-sys: remove no longer needed ROMS variable marcandre.lureau
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: marcandre.lureau @ 2020-09-18 20:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, qemu-s390x, Thomas Huth, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Checking for linker emulation is a bit tricky with meson, since it
actually tries to compile a file with a main().

I didn't bother to port the Darwin or SunOS check, as they are
quite old, and not very specific to the compiler version/issue, so they
might be outdated.

Use a subproject: this is a simple workaround to avoid the incompatible
flags (such as gprof) that are set globally for the rest of QEMU.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 configure                     | 16 --------
 pc-bios/meson.build           |  4 ++
 pc-bios/optionrom/Makefile    | 73 -----------------------------------
 pc-bios/optionrom/meson.build | 73 +++++++++++++++++++++++++++++++++++
 subprojects/optionrom         |  1 +
 5 files changed, 78 insertions(+), 89 deletions(-)
 delete mode 100644 pc-bios/optionrom/Makefile
 create mode 100644 pc-bios/optionrom/meson.build
 create mode 120000 subprojects/optionrom

diff --git a/configure b/configure
index 3a8733c9be..4e56edc70c 100755
--- a/configure
+++ b/configure
@@ -6441,22 +6441,7 @@ if test "$guest_agent_msi" = "yes"; then
   esac
 fi
 
-# Mac OS X ships with a broken assembler
 roms=
-if { test "$cpu" = "i386" || test "$cpu" = "x86_64"; } && \
-        test "$targetos" != "Darwin" && test "$targetos" != "SunOS" && \
-        test "$softmmu" = yes ; then
-    # Different host OS linkers have different ideas about the name of the ELF
-    # emulation. Linux and OpenBSD/amd64 use 'elf_i386'; FreeBSD uses the _fbsd
-    # variant; OpenBSD/i386 uses the _obsd variant; and Windows uses i386pe.
-    for emu in elf_i386 elf_i386_fbsd elf_i386_obsd i386pe; do
-        if "$ld" -verbose 2>&1 | grep -q "^[[:space:]]*$emu[[:space:]]*$"; then
-            ld_i386_emulation="$emu"
-            roms="optionrom"
-            break
-        fi
-    done
-fi
 
 # Only build s390-ccw bios if we're on s390x and the compiler has -march=z900
 if test "$cpu" = "s390x" ; then
@@ -7861,7 +7846,6 @@ DIRS="$DIRS contrib/plugins/"
 LINKS="Makefile"
 LINKS="$LINKS tests/tcg/lm32/Makefile"
 LINKS="$LINKS tests/tcg/Makefile.target"
-LINKS="$LINKS pc-bios/optionrom/Makefile"
 LINKS="$LINKS roms/seabios/Makefile"
 LINKS="$LINKS pc-bios/qemu-icon.bmp"
 LINKS="$LINKS .gdbinit scripts" # scripts needed by relative path in .gdbinit
diff --git a/pc-bios/meson.build b/pc-bios/meson.build
index e5139b3ef5..d25585ca97 100644
--- a/pc-bios/meson.build
+++ b/pc-bios/meson.build
@@ -92,6 +92,10 @@ endif
 subdir('descriptors')
 subdir('keymaps')
 
+if host_machine.cpu_family() in ['x86', 'x86_64']
+  subproject('optionrom')
+endif
+
 if host_machine.cpu_family() == 's390x' and cc.has_argument('-march=z900')
   subproject('s390-ccw')
 endif
diff --git a/pc-bios/optionrom/Makefile b/pc-bios/optionrom/Makefile
deleted file mode 100644
index 084fc10f05..0000000000
--- a/pc-bios/optionrom/Makefile
+++ /dev/null
@@ -1,73 +0,0 @@
-CURRENT_MAKEFILE := $(realpath $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
-SRC_DIR := $(dir $(CURRENT_MAKEFILE))
-TOPSRC_DIR := $(SRC_DIR)/../..
-VPATH = $(SRC_DIR)
-
-all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin
-# Dummy command so that make thinks it has done something
-	@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 -c -o /dev/null -xc /dev/null >/dev/null 2>&1 && echo OK), $1, $2)
-
-override CFLAGS += -march=i486 -Wall
-
-# Flags for dependency generation
-override CPPFLAGS += -MMD -MP -MT $@ -MF $(@D)/$(*F).d
-
-override CFLAGS += $(filter -W%, $(QEMU_CFLAGS))
-override CFLAGS += $(CFLAGS_NOPIE) -ffreestanding -I$(TOPSRC_DIR)/include
-override CFLAGS += $(call cc-option, -fno-stack-protector)
-override CFLAGS += $(call cc-option, -m16)
-
-ifeq ($(filter -m16, $(CFLAGS)),)
-# Attempt to work around compilers that lack -m16 (GCC <= 4.8, clang <= ??)
-# On GCC we add -fno-toplevel-reorder to keep the order of asm blocks with
-# respect to the rest of the code.  clang does not have -fno-toplevel-reorder,
-# but it places all asm blocks at the beginning and we're relying on it for
-# the option ROM header.  So just force clang not to use the integrated
-# assembler, which doesn't support .code16gcc.
-override CFLAGS += $(call cc-option, -fno-toplevel-reorder)
-override CFLAGS += $(call cc-option, -no-integrated-as)
-override CFLAGS += -m32 -include $(SRC_DIR)/code16gcc.h
-endif
-
-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)
-
-all: multiboot.bin linuxboot.bin linuxboot_dma.bin kvmvapic.bin pvh.bin
-
-pvh.img: pvh.o pvh_main.o
-
-%.o: %.S
-	$(call quiet-command,$(CPP) $(CPPFLAGS) -c -o - $< | $(AS) $(ASFLAGS) -o $@,"AS","$@")
-
-%.o: %.c
-	$(call quiet-command,$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@,"CC","$@")
-
-%.img: %.o
-	$(call quiet-command,$(LD) $(LDFLAGS) -s -o $@ $^,"BUILD","$@")
-
-%.raw: %.img
-	$(call quiet-command,$(OBJCOPY) -O binary -j .text $< $@,"BUILD","$@")
-
-%.bin: %.raw
-	$(call quiet-command,$(PYTHON) $(TOPSRC_DIR)/scripts/signrom.py $< $@,"SIGN","$@")
-
-include $(wildcard *.d)
-
-clean:
-	rm -f *.o *.d *.raw *.img *.bin *~
-
-# suppress auto-removal of intermediate files
-.SECONDARY:
-
-.PHONY: all clean
diff --git a/pc-bios/optionrom/meson.build b/pc-bios/optionrom/meson.build
new file mode 100644
index 0000000000..7d5314cd80
--- /dev/null
+++ b/pc-bios/optionrom/meson.build
@@ -0,0 +1,73 @@
+project('optionrom')
+
+cc = meson.get_compiler('c')
+objcopy = find_program('objcopy')
+signrom = find_program(meson.current_source_dir() / '../../scripts/signrom.py')
+
+emu = ''
+foreach e: ['elf_i386', 'elf_i386_fbsd', 'elf_i386_obsd', 'i386pe']
+  if cc.has_multi_link_arguments('-nostdlib', '-Wl,-emain', '-m32', '-Wl,-m' + e)
+    emu = e
+    break
+  endif
+endforeach
+
+if emu == ''
+  message('No suitable compiler/linker found to build optionrom')
+  subdir_done()
+endif
+
+link_args = ['-nostdlib', '-m32', '-Wl,-m' + e]
+link_args += cc.get_supported_link_arguments('-Wl,--build-id=none')
+if cc.has_multi_link_arguments('-fno-pie', '-no-pie')
+  link_args += ['-no-pie']
+endif
+
+link_args += '-Wl,-T' + meson.current_source_dir() / 'flat.lds'
+
+c_args = ['-O2', '-ffreestanding', '-march=i486']
+c_args += cc.get_supported_arguments('-fno-pie', '-fno-stack-protector', '-Wa,-32')
+if cc.has_argument('-m16')
+  c_args += '-m16'
+else
+  # Attempt to work around compilers that lack -m16 (GCC <= 4.8, clang <= ??)
+  # On GCC we add -fno-toplevel-reorder to keep the order of asm blocks with
+  # respect to the rest of the code.  clang does not have -fno-toplevel-reorder,
+  # but it places all asm blocks at the beginning and we're relying on it for
+  # the option ROM header.  So just force clang not to use the integrated
+  # assembler, which doesn't support .code16gcc.
+  c_args += cc.get_supported_arguments('-fno-toplevel-reorder', '-no-integrated-as')
+  c_args += ['-m32', '-include', meson.current_source_dir() / 'code16gcc.h']
+endif
+
+foreach target, src: {
+  'multiboot': ['multiboot.S'],
+  'linuxboot_dma': ['linuxboot_dma.c'],
+  'linuxboot': ['linuxboot.S'],
+  'kvmvapic': ['kvmvapic.S'],
+  'pvh': ['pvh.S', 'pvh_main.c'],
+ }
+  img = executable(
+    target + '.img',
+    src,
+    c_args: c_args,
+    include_directories: include_directories('../../include'),
+    link_args: link_args,
+    override_options: ['b_coverage=false'],
+  )
+
+  raw = custom_target(
+    target + '.raw',
+    output: target + '.raw',
+    input: img,
+    command: [objcopy, '-O', 'binary', '-j', '.text', '@INPUT@', '@OUTPUT@'],
+  )
+
+  bin = custom_target(
+    target + '.bin',
+    output: target + '.bin',
+    input: raw,
+    command: [signrom, '@INPUT@', '@OUTPUT@'],
+    build_by_default: true,
+  )
+endforeach
diff --git a/subprojects/optionrom b/subprojects/optionrom
new file mode 120000
index 0000000000..0bd7ed1798
--- /dev/null
+++ b/subprojects/optionrom
@@ -0,0 +1 @@
+../pc-bios/optionrom
\ No newline at end of file
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 4/6] build-sys: remove no longer needed ROMS variable
  2020-09-18 20:47 [PATCH 0/6] Convert pc-bios Makefiles to meson marcandre.lureau
                   ` (2 preceding siblings ...)
  2020-09-18 20:47 ` [PATCH 3/6] meson: convert pc-bios/optionrom marcandre.lureau
@ 2020-09-18 20:47 ` marcandre.lureau
  2020-09-18 20:47 ` [PATCH 5/6] build-sys: remove recurse-* rules marcandre.lureau
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: marcandre.lureau @ 2020-09-18 20:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, qemu-s390x, Thomas Huth, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 Makefile  | 9 ---------
 configure | 3 ---
 2 files changed, 12 deletions(-)

diff --git a/Makefile b/Makefile
index 7c60b9dcb8..cb23123606 100644
--- a/Makefile
+++ b/Makefile
@@ -180,16 +180,7 @@ slirp/all: .git-submodule-status
 		CC="$(CC)" AR="$(AR)" 	LD="$(LD)" RANLIB="$(RANLIB)"	\
 		CFLAGS="$(QEMU_CFLAGS) $(CFLAGS)" LDFLAGS="$(QEMU_LDFLAGS)")
 
-ROM_DIRS = $(addprefix pc-bios/, $(ROMS))
-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 $@)" $(notdir $@),)
-
 .PHONY: recurse-all recurse-clean
-recurse-all: $(addsuffix /all, $(ROM_DIRS))
-recurse-clean: $(addsuffix /clean, $(ROM_DIRS))
 
 ######################################################################
 
diff --git a/configure b/configure
index 4e56edc70c..fa9b44328b 100755
--- a/configure
+++ b/configure
@@ -6441,8 +6441,6 @@ if test "$guest_agent_msi" = "yes"; then
   esac
 fi
 
-roms=
-
 # Only build s390-ccw bios if we're on s390x and the compiler has -march=z900
 if test "$cpu" = "s390x" ; then
   write_c_skeleton
@@ -7397,7 +7395,6 @@ else
   QEMU_INCLUDES="-iquote ${source_path}/tcg/${ARCH} $QEMU_INCLUDES"
 fi
 
-echo "ROMS=$roms" >> $config_host_mak
 echo "MAKE=$make" >> $config_host_mak
 echo "PYTHON=$python" >> $config_host_mak
 echo "SPHINX_BUILD=$sphinx_build" >> $config_host_mak
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 5/6] build-sys: remove recurse-* rules
  2020-09-18 20:47 [PATCH 0/6] Convert pc-bios Makefiles to meson marcandre.lureau
                   ` (3 preceding siblings ...)
  2020-09-18 20:47 ` [PATCH 4/6] build-sys: remove no longer needed ROMS variable marcandre.lureau
@ 2020-09-18 20:47 ` marcandre.lureau
  2020-09-18 20:47 ` [PATCH 6/6] meson: replace pc-bios/Makefile marcandre.lureau
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 12+ messages in thread
From: marcandre.lureau @ 2020-09-18 20:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, qemu-s390x, Thomas Huth, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 Makefile | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/Makefile b/Makefile
index cb23123606..4728fcf1bd 100644
--- a/Makefile
+++ b/Makefile
@@ -135,13 +135,12 @@ Makefile: ;
 configure: ;
 
 .PHONY: all clean distclean install \
-	recurse-all dist msi FORCE
+	dist msi FORCE
 
 SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet)
 
 include $(SRC_PATH)/tests/Makefile.include
 
-all: recurse-all
 Makefile: $(addsuffix /all, $(SUBDIRS))
 
 # LIBFDT_lib="": avoid breaking existing trees with objects requiring -fPIC
@@ -180,11 +179,9 @@ slirp/all: .git-submodule-status
 		CC="$(CC)" AR="$(AR)" 	LD="$(LD)" RANLIB="$(RANLIB)"	\
 		CFLAGS="$(QEMU_CFLAGS) $(CFLAGS)" LDFLAGS="$(QEMU_LDFLAGS)")
 
-.PHONY: recurse-all recurse-clean
-
 ######################################################################
 
-clean: recurse-clean ninja-clean clean-ctlist
+clean: ninja-clean clean-ctlist
 	if test -f ninjatool; then ./ninjatool $(if $(V),-v,) -t clean; fi
 # avoid old build problems by removing potentially incorrect old files
 	rm -f config.mak op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 6/6] meson: replace pc-bios/Makefile
  2020-09-18 20:47 [PATCH 0/6] Convert pc-bios Makefiles to meson marcandre.lureau
                   ` (4 preceding siblings ...)
  2020-09-18 20:47 ` [PATCH 5/6] build-sys: remove recurse-* rules marcandre.lureau
@ 2020-09-18 20:47 ` marcandre.lureau
  2020-09-18 23:22 ` [PATCH 0/6] Convert pc-bios Makefiles to meson no-reply
  2020-09-19 14:58 ` Paolo Bonzini
  7 siblings, 0 replies; 12+ messages in thread
From: marcandre.lureau @ 2020-09-18 20:47 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, qemu-s390x, Thomas Huth, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau@redhat.com>

Add an alias target "update-dtb" to recompile the device-tree "sources"
to the "blob" format.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 pc-bios/Makefile    | 19 -------------------
 pc-bios/meson.build | 12 ++++++++++++
 2 files changed, 12 insertions(+), 19 deletions(-)
 delete mode 100644 pc-bios/Makefile

diff --git a/pc-bios/Makefile b/pc-bios/Makefile
deleted file mode 100644
index 315288df84..0000000000
--- a/pc-bios/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-#
-# NOTE: only compilable with x86 cross compile tools
-#
-include ../config-host.mak
-
-DEFINES=
-
-TARGETS=
-
-all: $(TARGETS)
-
-%.o: %.S
-	$(CC) $(DEFINES) -c -o $@ $<
-
-%.dtb: %.dts
-	dtc -I dts -O dtb -o $@ $<
-
-clean:
-	rm -f $(TARGETS) *.o *~
diff --git a/pc-bios/meson.build b/pc-bios/meson.build
index d25585ca97..f004df7a4d 100644
--- a/pc-bios/meson.build
+++ b/pc-bios/meson.build
@@ -92,6 +92,18 @@ endif
 subdir('descriptors')
 subdir('keymaps')
 
+dtc = find_program('dtc', required: false)
+if dtc.found()
+  t = []
+  foreach f: ['bamboo.dts', 'canyonlands.dts', 'petalogix-ml605.dts', 'petalogix-s3adsp1800.dts']
+    t += custom_target(f,
+                       input: f,
+                       output: '@BASENAME@' + '.dtb',
+                       command: [dtc, '-I', 'dts', '-O', 'dtb', '-o', '@OUTPUT@', '@INPUT@'])
+  endforeach
+  alias_target('update-dtb', t)
+endif
+
 if host_machine.cpu_family() in ['x86', 'x86_64']
   subproject('optionrom')
 endif
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/6] Convert pc-bios Makefiles to meson
  2020-09-18 20:47 [PATCH 0/6] Convert pc-bios Makefiles to meson marcandre.lureau
                   ` (5 preceding siblings ...)
  2020-09-18 20:47 ` [PATCH 6/6] meson: replace pc-bios/Makefile marcandre.lureau
@ 2020-09-18 23:22 ` no-reply
  2020-09-19 14:58 ` Paolo Bonzini
  7 siblings, 0 replies; 12+ messages in thread
From: no-reply @ 2020-09-18 23:22 UTC (permalink / raw)
  To: marcandre.lureau
  Cc: thuth, pbonzini, qemu-s390x, qemu-devel, marcandre.lureau

Patchew URL: https://patchew.org/QEMU/20200918204759.225810-1-marcandre.lureau@redhat.com/



Hi,

This series failed the docker-quick@centos7 build test. Please find the testing commands and
their output below. If you have Docker installed, you can probably reproduce it
locally.

=== TEST SCRIPT BEGIN ===
#!/bin/bash
make docker-image-centos7 V=1 NETWORK=1
time make docker-test-quick@centos7 SHOW_ENV=1 J=14 NETWORK=1
=== TEST SCRIPT END ===

C linker for the host machine: cc ld.bfd 2.27-43
Host machine cpu family: x86_64
Host machine cpu: x86_64
../src/meson.build:10: WARNING: Module unstable-keyval has no backwards or forwards compatibility and might not exist in future releases.
Program sh found: YES
Program python3 found: YES (/usr/bin/python3)
Configuring ninjatool using configuration
---
Compiling C object subprojects/optionrom/linuxboot.img.p/linuxboot.S.o
Compiling C object subprojects/optionrom/kvmvapic.img.p/kvmvapic.S.o
/tmp/qemu-test/src/subprojects/optionrom/code16gcc.h: Assembler messages:
/tmp/qemu-test/src/subprojects/optionrom/code16gcc.h:1: Error: invalid character '(' in mnemonic
/tmp/qemu-test/src/subprojects/optionrom/code16gcc.h:2: Error: unknown pseudo-op: `.code16gcc\n'
/tmp/qemu-test/src/subprojects/optionrom/code16gcc.h:3: Error: junk at end of line, first unrecognized character is `)'
make: *** [subprojects/optionrom/multiboot.img.p/multiboot.S.o] Error 1
make: *** Waiting for unfinished jobs....
/tmp/qemu-test/src/subprojects/optionrom/code16gcc.h: Assembler messages:
/tmp/qemu-test/src/subprojects/optionrom/code16gcc.h:1: Error: invalid character '(' in mnemonic
/tmp/qemu-test/src/subprojects/optionrom/code16gcc.h:2: Error: unknown pseudo-op: `.code16gcc\n'
/tmp/qemu-test/src/subprojects/optionrom/code16gcc.h:3: Error: junk at end of line, first unrecognized character is `)'
make: *** [subprojects/optionrom/linuxboot.img.p/linuxboot.S.o] Error 1
/tmp/qemu-test/src/subprojects/optionrom/code16gcc.h: Assembler messages:
/tmp/qemu-test/src/subprojects/optionrom/code16gcc.h:1: Error: invalid character '(' in mnemonic
/tmp/qemu-test/src/subprojects/optionrom/code16gcc.h:2: Error: unknown pseudo-op: `.code16gcc\n'
/tmp/qemu-test/src/subprojects/optionrom/code16gcc.h:3: Error: junk at end of line, first unrecognized character is `)'
make: *** [subprojects/optionrom/kvmvapic.img.p/kvmvapic.S.o] Error 1
Traceback (most recent call last):
  File "./tests/docker/docker.py", line 709, in <module>
    sys.exit(main())
---
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['sudo', '-n', 'docker', 'run', '--rm', '--label', 'com.qemu.instance.uuid=3b7f1af7e75b48f3bb69d8fa30eb5a2e', '-u', '1001', '--security-opt', 'seccomp=unconfined', '-e', 'TARGET_LIST=', '-e', 'EXTRA_CONFIGURE_OPTS=', '-e', 'V=', '-e', 'J=14', '-e', 'DEBUG=', '-e', 'SHOW_ENV=1', '-e', 'CCACHE_DIR=/var/tmp/ccache', '-v', '/home/patchew/.cache/qemu-docker-ccache:/var/tmp/ccache:z', '-v', '/var/tmp/patchew-tester-tmp-4a1odio7/src/docker-src.2020-09-18-19.19.48.23563:/var/tmp/qemu:z,ro', 'qemu/centos7', '/var/tmp/qemu/run', 'test-quick']' returned non-zero exit status 2.
filter=--filter=label=com.qemu.instance.uuid=3b7f1af7e75b48f3bb69d8fa30eb5a2e
make[1]: *** [docker-run] Error 1
make[1]: Leaving directory `/var/tmp/patchew-tester-tmp-4a1odio7/src'
make: *** [docker-run-test-quick@centos7] Error 2

real    3m3.001s
user    0m18.547s


The full log is available at
http://patchew.org/logs/20200918204759.225810-1-marcandre.lureau@redhat.com/testing.docker-quick@centos7/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/6] Convert pc-bios Makefiles to meson
  2020-09-18 20:47 [PATCH 0/6] Convert pc-bios Makefiles to meson marcandre.lureau
                   ` (6 preceding siblings ...)
  2020-09-18 23:22 ` [PATCH 0/6] Convert pc-bios Makefiles to meson no-reply
@ 2020-09-19 14:58 ` Paolo Bonzini
  2020-09-19 15:15   ` Marc-André Lureau
  2020-09-20 20:21   ` Peter Maydell
  7 siblings, 2 replies; 12+ messages in thread
From: Paolo Bonzini @ 2020-09-19 14:58 UTC (permalink / raw)
  To: marcandre.lureau, qemu-devel; +Cc: qemu-s390x, Thomas Huth

On 18/09/20 22:47, marcandre.lureau@redhat.com wrote:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
> 
> Hi,
> 
> Here is a series of patches to convert the remaining Makefile in
> pc-bios/ to meson. I have done various tests to check that the
> resulting binaries are working as expected, but I didn't cover it
> all, and I am not sure the test su= ite covers them all either.

I don't know, the way pc-bios/ works seems just wrong to me.  pc-bios 
should IMO be its own build system with support for docker-based cross 
compilers similar to tests/tcg.

In fact one thing I was considering before falling in love with Meson :) 
was to write a simple meta-build-system for all of QEMU-owned ROMs, 
submodules such as SLOF and tests/tcg.  I never even got to the 
whiteboard phase, but if this were done, we could just build all the 
firmwares as a Meson 0.56 "external project"[1].

Paolo

[1] https://github.com/mesonbuild/meson/commit/master#diff-3a49da052fafbb502673f20d188644e1



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/6] Convert pc-bios Makefiles to meson
  2020-09-19 14:58 ` Paolo Bonzini
@ 2020-09-19 15:15   ` Marc-André Lureau
  2020-09-19 15:26     ` Paolo Bonzini
  2020-09-20 20:21   ` Peter Maydell
  1 sibling, 1 reply; 12+ messages in thread
From: Marc-André Lureau @ 2020-09-19 15:15 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: Thomas Huth, Qemu-s390x list, QEMU

[-- Attachment #1: Type: text/plain, Size: 1577 bytes --]

Hi

On Sat, Sep 19, 2020 at 6:59 PM Paolo Bonzini <pbonzini@redhat.com> wrote:

> On 18/09/20 22:47, marcandre.lureau@redhat.com wrote:
> > From: Marc-André Lureau <marcandre.lureau@redhat.com>
> >
> > Hi,
> >
> > Here is a series of patches to convert the remaining Makefile in
> > pc-bios/ to meson. I have done various tests to check that the
> > resulting binaries are working as expected, but I didn't cover it
> > all, and I am not sure the test su= ite covers them all either.
>
> I don't know, the way pc-bios/ works seems just wrong to me.  pc-bios
> should IMO be its own build system with support for docker-based cross
> compilers similar to tests/tcg.
>

It could still use meson to build the binaries though (like we did for
qboot). It's more about setting up the environment for the build to compile
for the target.


> In fact one thing I was considering before falling in love with Meson :)
> was to write a simple meta-build-system for all of QEMU-owned ROMs,
> submodules such as SLOF and tests/tcg.  I never even got to the
> whiteboard phase, but if this were done, we could just build all the
> firmwares as a Meson 0.56 "external project"[1].
>
> Paolo
>
> [1]
> https://github.com/mesonbuild/meson/commit/master#diff-3a49da052fafbb502673f20d188644e1
>

I suppose you meant:
https://github.com/mesonbuild/meson/commit/9d338200dacdf24c50259c309380200f8a53d5b5

fwiw, this version doesn't compile with gcc 4.8 (on centos6, as patchew
found out). I couldn't find a workaround yet. :(



-- 
Marc-André Lureau

[-- Attachment #2: Type: text/html, Size: 2647 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/6] Convert pc-bios Makefiles to meson
  2020-09-19 15:15   ` Marc-André Lureau
@ 2020-09-19 15:26     ` Paolo Bonzini
  0 siblings, 0 replies; 12+ messages in thread
From: Paolo Bonzini @ 2020-09-19 15:26 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Thomas Huth, Qemu-s390x list, QEMU

On 19/09/20 17:15, Marc-André Lureau wrote:
> 
> 
>     I don't know, the way pc-bios/ works seems just wrong to me.  pc-bios
>     should IMO be its own build system with support for docker-based cross
>     compilers similar to tests/tcg.
> 
> 
> It could still use meson to build the binaries though (like we did for
> qboot). It's more about setting up the environment for the build to
> compile for the target.

Yes, essentially it would set up the cross file.  However, to some
extent whether or not Meson is used would be of relative importance.

Step 1 would probably be to find a place for the common docker
infrastructure, moving the common parts of tests/docker and tests/tcg to
scripts/docker and de-Make-izing them.

Paolo



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 0/6] Convert pc-bios Makefiles to meson
  2020-09-19 14:58 ` Paolo Bonzini
  2020-09-19 15:15   ` Marc-André Lureau
@ 2020-09-20 20:21   ` Peter Maydell
  1 sibling, 0 replies; 12+ messages in thread
From: Peter Maydell @ 2020-09-20 20:21 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Thomas Huth, Marc-André Lureau, qemu-s390x, QEMU Developers

On Sat, 19 Sep 2020 at 15:59, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> I don't know, the way pc-bios/ works seems just wrong to me.  pc-bios
> should IMO be its own build system with support for docker-based cross
> compilers similar to tests/tcg.

Yes, I've always thought this :-) It borrows the host x86 compiler
just because it kinda happens to work most of the time in the
common cases. Now we have proper docker cross infrastructure
available it would certainly be nice to use it consistently for
building firmware. (It would also make it more palatable to
have VDSOs for linux-user, which would also need to be built with
a target C compiler.)

-- PMM


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-09-20 20:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18 20:47 [PATCH 0/6] Convert pc-bios Makefiles to meson marcandre.lureau
2020-09-18 20:47 ` [PATCH 1/6] meson: convert pc-bios/s390-ccw marcandre.lureau
2020-09-18 20:47 ` [PATCH 2/6] optionrom: make kvmapic.S compile with clang marcandre.lureau
2020-09-18 20:47 ` [PATCH 3/6] meson: convert pc-bios/optionrom marcandre.lureau
2020-09-18 20:47 ` [PATCH 4/6] build-sys: remove no longer needed ROMS variable marcandre.lureau
2020-09-18 20:47 ` [PATCH 5/6] build-sys: remove recurse-* rules marcandre.lureau
2020-09-18 20:47 ` [PATCH 6/6] meson: replace pc-bios/Makefile marcandre.lureau
2020-09-18 23:22 ` [PATCH 0/6] Convert pc-bios Makefiles to meson no-reply
2020-09-19 14:58 ` Paolo Bonzini
2020-09-19 15:15   ` Marc-André Lureau
2020-09-19 15:26     ` Paolo Bonzini
2020-09-20 20:21   ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.