[PULL 00/14] (Mostly) build system changes for 2022-06-24

Paolo Bonzini posted 14 patches 1 year, 11 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220624082730.246924-1-pbonzini@redhat.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Thomas Huth <thuth@redhat.com>, Cornelia Huck <cohuck@redhat.com>, Alexey Kardashevskiy <aik@ozlabs.ru>, "Cédric Le Goater" <clg@kaod.org>, Daniel Henrique Barboza <danielhb413@gmail.com>, David Gibson <david@gibson.dropbear.id.au>, Greg Kurz <groug@kaod.org>, Alexander Bulekov <alxndr@bu.edu>, Bandan Das <bsd@redhat.com>, Stefan Hajnoczi <stefanha@redhat.com>, Darren Kenny <darren.kenny@oracle.com>, Qiuhao Li <Qiuhao.Li@outlook.com>, "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>, Peter Maydell <peter.maydell@linaro.org>, Wainer dos Santos Moschetta <wainersm@redhat.com>, Beraldo Leal <bleal@redhat.com>, Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>, Ed Maste <emaste@freebsd.org>, Li-Wen Hsu <lwhsu@freebsd.org>
accel/kvm/kvm-all.c                    |   1 +
audio/meson.build                      |   2 +-
configure                              | 188 ++++++++++++++++++++-------------
meson.build                            |   7 +-
pc-bios/optionrom/Makefile             |  15 +--
pc-bios/optionrom/code16gcc.h          |   3 -
pc-bios/s390-ccw/Makefile              |  20 ++--
pc-bios/s390-ccw/netboot.mak           |   6 +-
pc-bios/vof/Makefile                   |   8 +-
scripts/oss-fuzz/build.sh              |   4 +-
tests/tcg/Makefile.target              |   1 +
tests/tcg/aarch64/system/pauth-3.c     |   2 +-
tests/tcg/aarch64/system/semiconsole.c |   2 +-
tests/tcg/aarch64/system/semiheap.c    |   2 +-
tests/tcg/multiarch/system/memory.c    |   2 +-
tests/vm/fedora                        |   1 -
tests/vm/freebsd                       |   1 -
tests/vm/netbsd                        |   1 -
tests/vm/openbsd                       |   1 -
19 files changed, 143 insertions(+), 124 deletions(-)
delete mode 100644 pc-bios/optionrom/code16gcc.h
[PULL 00/14] (Mostly) build system changes for 2022-06-24
Posted by Paolo Bonzini 1 year, 11 months ago
The following changes since commit 2b049d2c8dc01de750410f8f1a4eac498c04c723:

  Merge tag 'pull-aspeed-20220622' of https://github.com/legoater/qemu into staging (2022-06-22 07:27:06 -0700)

are available in the Git repository at:

  https://gitlab.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 72da35fec9a9ba91a5b2cb9ee00843a94fa9413d:

  accel: kvm: Fix memory leak in find_stats_descriptors (2022-06-24 10:19:17 +0200)

----------------------------------------------------------------
* fuzzing fixes
* fix cross compilation CFLAGS and compiler choice
* do not specify -bios option for tests/vm
* miscellaneous fixes

----------------------------------------------------------------
Alexander Bulekov (2):
      build: improve -fsanitize-coverage-allowlist check
      fuzz: only use generic-fuzz targets on oss-fuzz

Marc-André Lureau (1):
      audio/dbus: fix building

Miaoqian Lin (1):
      accel: kvm: Fix memory leak in find_stats_descriptors

Paolo Bonzini (9):
      tests/vm: do not specify -bios option
      pc-bios/optionrom: use -m16 unconditionally
      configure, pc-bios/optionrom: pass cross CFLAGS correctly
      configure, pc-bios/s390-ccw: pass cross CFLAGS correctly
      configure, pc-bios/vof: pass cross CFLAGS correctly
      configure: allow more host/target combos to use the host compiler
      configure: write EXTRA_CFLAGS for all sub-Makefiles
      tests/tcg: compile system emulation tests as freestanding
      build: try both native and cross compilers for linux-user tests

Thomas Huth (1):
      meson.build: Require a recent version of libpng

 accel/kvm/kvm-all.c                    |   1 +
 audio/meson.build                      |   2 +-
 configure                              | 188 ++++++++++++++++++++-------------
 meson.build                            |   7 +-
 pc-bios/optionrom/Makefile             |  15 +--
 pc-bios/optionrom/code16gcc.h          |   3 -
 pc-bios/s390-ccw/Makefile              |  20 ++--
 pc-bios/s390-ccw/netboot.mak           |   6 +-
 pc-bios/vof/Makefile                   |   8 +-
 scripts/oss-fuzz/build.sh              |   4 +-
 tests/tcg/Makefile.target              |   1 +
 tests/tcg/aarch64/system/pauth-3.c     |   2 +-
 tests/tcg/aarch64/system/semiconsole.c |   2 +-
 tests/tcg/aarch64/system/semiheap.c    |   2 +-
 tests/tcg/multiarch/system/memory.c    |   2 +-
 tests/vm/fedora                        |   1 -
 tests/vm/freebsd                       |   1 -
 tests/vm/netbsd                        |   1 -
 tests/vm/openbsd                       |   1 -
 19 files changed, 143 insertions(+), 124 deletions(-)
 delete mode 100644 pc-bios/optionrom/code16gcc.h
-- 
2.36.1


Re: [PULL 00/14] (Mostly) build system changes for 2022-06-24
Posted by Richard Henderson 1 year, 11 months ago
On 6/24/22 01:27, Paolo Bonzini wrote:
> The following changes since commit 2b049d2c8dc01de750410f8f1a4eac498c04c723:
> 
>    Merge tag 'pull-aspeed-20220622' of https://github.com/legoater/qemu into staging (2022-06-22 07:27:06 -0700)
> 
> are available in the Git repository at:
> 
>    https://gitlab.com/bonzini/qemu.git tags/for-upstream
> 
> for you to fetch changes up to 72da35fec9a9ba91a5b2cb9ee00843a94fa9413d:
> 
>    accel: kvm: Fix memory leak in find_stats_descriptors (2022-06-24 10:19:17 +0200)
> 
> ----------------------------------------------------------------
> * fuzzing fixes
> * fix cross compilation CFLAGS and compiler choice
> * do not specify -bios option for tests/vm
> * miscellaneous fixes

Build failure here.  I have ubuntu 22.04,

crossbuild-essential-arm64/jammy,jammy,now 12.9ubuntu3 all [installed]

crossbuild-essential-armhf/jammy,jammy,now 12.9ubuntu3 all [installed]

crossbuild-essential-i386/jammy,jammy,now 12.9ubuntu3 all [installed]

crossbuild-essential-mips64el/jammy,jammy,now 12.9 all [installed]

crossbuild-essential-ppc64el/jammy,jammy,now 12.9ubuntu3 all [installed]

crossbuild-essential-riscv64/jammy,jammy,now 12.9ubuntu3 all [installed]

crossbuild-essential-s390x/jammy,jammy,now 12.9ubuntu3 all [installed]


which is properly detected during configure,

   Cross compilers

     aarch64                      : aarch64-linux-gnu-gcc

     alpha                        : $(DOCKER_SCRIPT) cc --cc alpha-linux-gnu-gcc -i 
qemu/debian-alpha-cross -s /home/rth/qemu-publish/src --

     arm                          : arm-linux-gnueabihf-gcc

     i386                         : i686-linux-gnu-gcc

     nios2                        : $(DOCKER_SCRIPT) cc --cc nios2-linux-gnu-gcc -i 
qemu/debian-nios2-cross -s /home/rth/qemu-publish/src --

     x86_64                       : cc

...


But then the i386 cross-compiler isn't used:

$ cat tests/tcg/config-i386-softmmu.mak

# Automatically generated by configure - do not modify

TARGET_NAME=i386

BUILD_STATIC=

EXTRA_CFLAGS=-m32

CC=cc

CCAS=cc

AR=ar

AS=as

LD=ld

NM=nm

OBJCOPY=objcopy

RANLIB=ranlib

STRIP=strip

QEMU=/home/rth/qemu-publish/bld/qemu-system-i386


leading to failure:

cc -nostdlib -ggdb -O0 -isystem /home/rth/qemu-publish/src/tests/tcg/minilib -m32 
-ffreestanding /home/rth/qemu-publish/src/tests/tcg/multiarch/system/hello.c -o hello 
-Wl,-T/home/rth/qemu-publish/src/tests/tcg/i386/system/kernel.ld -Wl,-melf_i386 -static 
-nostdlib boot.o  printf.o -lgcc

/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/11/libgcc.a when 
searching for -lgcc

/usr/bin/ld: cannot find -lgcc: No such file or directory

collect2: error: ld returned 1 exit status

make[1]: *** [/home/rth/qemu-publish/src/tests/tcg/i386/Makefile.softmmu-target:32: hello] 
Error 1



r~
Re: [PULL 00/14] (Mostly) build system changes for 2022-06-24
Posted by Paolo Bonzini 1 year, 10 months ago
Il ven 24 giu 2022, 17:57 Richard Henderson <richard.henderson@linaro.org>
ha scritto:

> But then the i386 cross-compiler isn't used:
>

Yeah, that was intentional. In theory a softmmu target is freestanding and
does not need anything beyond the compiler install, so configure defaults
to the native compiler, which is biarch. That however assumes that the
compiler install includes the libgcc for both architectures.

Does that mean that Ubuntu installs GCC without a 32-bit libgcc.a?

Paolo


> $ cat tests/tcg/config-i386-softmmu.mak
>
> # Automatically generated by configure - do not modify
>
> TARGET_NAME=i386
>
> BUILD_STATIC=
>
> EXTRA_CFLAGS=-m32
>
> CC=cc
>
> CCAS=cc
>
> AR=ar
>
> AS=as
>
> LD=ld
>
> NM=nm
>
> OBJCOPY=objcopy
>
> RANLIB=ranlib
>
> STRIP=strip
>
> QEMU=/home/rth/qemu-publish/bld/qemu-system-i386
>
>
> leading to failure:
>
> cc -nostdlib -ggdb -O0 -isystem
> /home/rth/qemu-publish/src/tests/tcg/minilib -m32
> -ffreestanding
> /home/rth/qemu-publish/src/tests/tcg/multiarch/system/hello.c -o hello
> -Wl,-T/home/rth/qemu-publish/src/tests/tcg/i386/system/kernel.ld
> -Wl,-melf_i386 -static
> -nostdlib boot.o  printf.o -lgcc
>
> /usr/bin/ld: skipping incompatible
> /usr/lib/gcc/x86_64-linux-gnu/11/libgcc.a when
> searching for -lgcc
>
> /usr/bin/ld: cannot find -lgcc: No such file or directory
>
> collect2: error: ld returned 1 exit status
>
> make[1]: ***
> [/home/rth/qemu-publish/src/tests/tcg/i386/Makefile.softmmu-target:32:
> hello]
> Error 1
>
>
>
> r~
>
>
Re: [PULL 00/14] (Mostly) build system changes for 2022-06-24
Posted by Peter Maydell 1 year, 10 months ago
On Thu, 30 Jun 2022 at 18:14, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
>
> Il ven 24 giu 2022, 17:57 Richard Henderson <richard.henderson@linaro.org> ha scritto:
>>
>> But then the i386 cross-compiler isn't used:
>
>
> Yeah, that was intentional. In theory a softmmu target is freestanding and does not need anything beyond the compiler install, so configure defaults to the native compiler, which is biarch. That however assumes that the compiler install includes the libgcc for both architectures.
>
> Does that mean that Ubuntu installs GCC without a 32-bit libgcc.a?

I think they package it in a separate package, eg lib32gcc-9-dev
(adjust package name to suit gcc version).

-- PMM
Re: [PULL 00/14] (Mostly) build system changes for 2022-06-24
Posted by Richard Henderson 1 year, 10 months ago
On 6/30/22 23:02, Peter Maydell wrote:
> On Thu, 30 Jun 2022 at 18:14, Paolo Bonzini <pbonzini@redhat.com> wrote:
>>
>>
>>
>> Il ven 24 giu 2022, 17:57 Richard Henderson <richard.henderson@linaro.org> ha scritto:
>>>
>>> But then the i386 cross-compiler isn't used:
>>
>>
>> Yeah, that was intentional. In theory a softmmu target is freestanding and does not need anything beyond the compiler install, so configure defaults to the native compiler, which is biarch. That however assumes that the compiler install includes the libgcc for both architectures.
>>
>> Does that mean that Ubuntu installs GCC without a 32-bit libgcc.a?
> 
> I think they package it in a separate package, eg lib32gcc-9-dev
> (adjust package name to suit gcc version).

It's there, as Peter says, but it's not installed with the build-essential meta-package, 
and the crossbuild-essential-i386 package installs a different libgcc.


r~
Re: [PULL 00/14] (Mostly) build system changes for 2022-06-24
Posted by Paolo Bonzini 1 year, 10 months ago
Il ven 1 lug 2022, 02:26 Richard Henderson <richard.henderson@linaro.org>
ha scritto:

> >> Does that mean that Ubuntu installs GCC without a 32-bit libgcc.a?
> >
> > I think they package it in a separate package, eg lib32gcc-9-dev
> > (adjust package name to suit gcc version).
>
> It's there, as Peter says, but it's not installed with the build-essential
> meta-package,
> and the crossbuild-essential-i386 package installs a different libgcc.
>

Ok I will try using ld -r to detect the presence of libgcc.

Paolo


>
> r~
>
>