Skip to content
Snippets Groups Projects
  1. Apr 20, 2023
    • Peter Maydell's avatar
      configure: Honour cross-prefix when finding ObjC compiler · c0c34c91
      Peter Maydell authored
      Currently when configure picks an ObjectiveC compiler it doesn't pay
      attention to the cross-prefix.  This isn't a big deal in practice,
      because we only use ObjC on macos and you can't cross-compile to
      macos.  But it's a bit inconsistent.
      
      Rearrange the handling of objcc in configure so that we do the
      same thing that we do with cc and cxx. This means that the logic
      for picking the ObjC compiler goes from:
       if --objcc is specified, use that
       otherwise if clang is available, use that
       otherwise use $cc
      to:
       if --objcc is specified, use that
       otherwise if --cross-prefix is specified, use ${cross_prefix}clang
       otherwise if clang is available, use that
       otherwise use $cc
      
      Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1185
      
      
      Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Message-Id: <20230418161554.744834-1-peter.maydell@linaro.org>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      c0c34c91
    • Akihiko Odaki's avatar
      configure: Avoid -Werror=maybe-uninitialized · 8041e9e3
      Akihiko Odaki authored
      
      The configure script used to compile some code which dereferences memory
      with ubsan to verify the compiler can link with ubsan library which
      detects dereferencing of uninitialized memory. However, as the
      dereferenced memory was allocated in the same code, GCC can statically
      detect the unitialized memory dereference and emit maybe-uninitialized
      warning. If -Werror is set, this becomes an error, and the configure
      script incorrectly thinks the error indicates the compiler cannot use
      ubsan.
      
      Fix this error by replacing the code with another function which adds
      1 to a signed integer argument. This brings in ubsan to detect if it
      causes signed integer overflow. As the value of the argument cannot be
      statically determined, the new function is also immune to compiler
      warnings.
      
      Signed-off-by: default avatarAkihiko Odaki <akihiko.odaki@daynix.com>
      Message-Id: <20230405070030.23148-1-akihiko.odaki@daynix.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      8041e9e3
    • Marc-André Lureau's avatar
      build-sys: prevent meson from downloading wrapped subprojects · 5a347a73
      Marc-André Lureau authored
      
      The following patches are going to introduce meson wrap dependencies,
      which is a solution to download and build missing dependencies.
      
      The QEMU build-system will do network access with no way to avoid the
      fallback. As a start, hardcode "--wrap-mode=nodownload" in configure, so
      that wraps would be used only after a conscious decision of the user to
      use "meson subprojects download" (before running configure).
      
      Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
      Message-Id: <20230302131848.1527460-3-marcandre.lureau@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      5a347a73
  2. Mar 29, 2023
    • Emilio Cota's avatar
      util: import GTree as QTree · e3feb2cc
      Emilio Cota authored
      The only reason to add this implementation is to control the memory allocator
      used. Some users (e.g. TCG) cannot work reliably in multi-threaded
      environments (e.g. forking in user-mode) with GTree's allocator, GSlice.
      See https://gitlab.com/qemu-project/qemu/-/issues/285
      
       for details.
      
      Importing GTree is a temporary workaround until GTree migrates away
      from GSlice.
      
      This implementation is identical to that in glib v2.75.0, except that
      we don't import recent additions to the API nor deprecated API calls,
      none of which are used in QEMU.
      
      I've imported tests from glib and added a benchmark just to
      make sure that performance is similar. Note: it cannot be identical
      because (1) we are not using GSlice, (2) we use different compilation flags
      (e.g. -fPIC) and (3) we're linking statically.
      
      $ cat /proc/cpuinfo| grep 'model name' | head -1
      model name      : AMD Ryzen 7 PRO 5850U with Radeon Graphics
      $ echo '0' | sudo tee /sys/devices/system/cpu/cpufreq/boost
      $ tests/bench/qtree-bench
      
       Tree         Op      32            1024            4096          131072         1048576
      ------------------------------------------------------------------------------------------------
      GTree     Lookup   83.23           43.08           25.31           19.40           16.22
      QTree     Lookup  113.42 (1.36x)   53.83 (1.25x)   28.38 (1.12x)   17.64 (0.91x)   13.04 (0.80x)
      GTree     Insert   44.23           29.37           25.83           19.49           17.03
      QTree     Insert   46.87 (1.06x)   25.62 (0.87x)   24.29 (0.94x)   16.83 (0.86x)   12.97 (0.76x)
      GTree     Remove   53.27           35.15           31.43           24.64           16.70
      QTree     Remove   57.32 (1.08x)   41.76 (1.19x)   38.37 (1.22x)   29.30 (1.19x)   15.07 (0.90x)
      GTree  RemoveAll  135.44          127.52          126.72          120.11           64.34
      QTree  RemoveAll  127.15 (0.94x)  110.37 (0.87x)  107.97 (0.85x)   97.13 (0.81x)   55.10 (0.86x)
      GTree   Traverse  277.71          276.09          272.78          246.72           98.47
      QTree   Traverse  370.33 (1.33x)  411.97 (1.49x)  400.23 (1.47x)  262.82 (1.07x)   78.52 (0.80x)
      ------------------------------------------------------------------------------------------------
      
      As a sanity check, the same benchmark when Glib's version
      is >= $glib_dropped_gslice_version (i.e. QTree == GTree):
      
       Tree         Op      32            1024            4096          131072         1048576
      ------------------------------------------------------------------------------------------------
      GTree     Lookup   82.72           43.09           24.18           19.73           16.09
      QTree     Lookup   81.82 (0.99x)   43.10 (1.00x)   24.20 (1.00x)   19.76 (1.00x)   16.26 (1.01x)
      GTree     Insert   45.07           29.62           26.34           19.90           17.18
      QTree     Insert   45.72 (1.01x)   29.60 (1.00x)   26.38 (1.00x)   19.71 (0.99x)   17.20 (1.00x)
      GTree     Remove   54.48           35.36           31.77           24.97           16.95
      QTree     Remove   54.46 (1.00x)   35.32 (1.00x)   31.77 (1.00x)   24.91 (1.00x)   17.15 (1.01x)
      GTree  RemoveAll  140.68          127.36          125.43          121.45           68.20
      QTree  RemoveAll  140.65 (1.00x)  127.64 (1.00x)  125.01 (1.00x)  121.73 (1.00x)   67.06 (0.98x)
      GTree   Traverse  278.68          276.05          266.75          251.65          104.93
      QTree   Traverse  278.31 (1.00x)  275.78 (1.00x)  266.42 (1.00x)  247.89 (0.99x)  104.58 (1.00x)
      ------------------------------------------------------------------------------------------------
      
      Signed-off-by: default avatarEmilio Cota <cota@braap.org>
      Message-Id: <20230205163758.416992-2-cota@braap.org>
      Signed-off-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      e3feb2cc
  3. Mar 08, 2023
    • Thomas Huth's avatar
      tests/qtest/readconfig: Test docs/config/ich9-ehci-uhci.cfg · 201aa17e
      Thomas Huth authored
      
      We've got some sample config files in docs/config/ but no means
      of regression checking them. Thus let's test them in our readconfig
      qtest, starting with ich9-ehci-uhci.cfg. Note: To enable the test
      to read the config files from the build folder, we have to install
      a symlink for docs/config in the build directory.
      
      Message-Id: <20230228211533.201837-3-thuth@redhat.com>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      201aa17e
  4. Mar 07, 2023
  5. Mar 04, 2023
  6. Mar 01, 2023
  7. Feb 27, 2023
    • John Snow's avatar
      configure: Look for auxiliary Python installations · fee6d412
      John Snow authored
      
      At the moment, we look for just "python3" and "python", which is good
      enough almost all of the time. But ... if you are on a platform that
      uses an older Python by default and only offers a newer Python as an
      option, you'll have to specify --python=/usr/bin/foo every time.
      
      We can be kind and instead make a cursory attempt to locate a suitable
      Python binary ourselves, looking for the remaining well-known binaries.
      
      This configure loop will prefer, in order:
      
      1. Whatever is specified in $PYTHON
      2. python3
      3. python
      4. python3.11 down through python3.6
      
      Notes:
      
      - Python virtual environment provides binaries for "python3", "python",
        and whichever version you used to create the venv,
        e.g. "python3.8". If configure is invoked from inside of a venv, this
        configure loop will not "break out" of that venv unless that venv is
        created using an explicitly non-suitable version of Python that we
        cannot use.
      
      - In the event that no suitable python is found, the first python found
        is the version used to generate the human-readable error message.
      
      - The error message isn't printed right away to allow later
        configuration code to pick up an explicitly configured python.
      
      Signed-off-by: default avatarJohn Snow <jsnow@redhat.com>
      Reviewed-by: default avatarDaniel P. Berrangé <berrange@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      fee6d412
    • Paolo Bonzini's avatar
      configure: protect against escaping venv when running Meson · 462a6567
      Paolo Bonzini authored
      
      If neither --python nor --meson are specified, Meson's generated
      build.ninja will invoke Python script using the interpreter *that Meson
      itself is running under*; not the one identified by configure.
      
      This is only an issue if Meson's Python interpreter is not "the first
      one in the path", which is the one that is used if --python is not
      specified.  A common case where this happen is when the "python3" binary
      comes from a virtual environment but Meson is not installed (with pip)
      in the virtual environment.  In this case (presumably) whoever set up
      the venv wanted to use the venv's Python interpreter to build QEMU,
      while Meson might use a different one, for example an enterprise
      distro's older runtime.
      
      So, detect whether a virtual environment is setup, and if the virtual
      environment does not have Meson, use the meson submodule.  Meson will
      then run under the virtual environment's Python interpreter.
      
      Reported-by: default avatarJohn Snow <jsnow@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      462a6567
    • Dinah Baum's avatar
      configure: Add 'mkdir build' check · f160a5b2
      Dinah Baum authored
      QEMU configure script goes into an infinite error printing loop
      when in read only directory due to 'build' dir never being created.
      
      Checking if 'mkdir dir' succeeds prevents this error.
      
      Resolves: https://gitlab.com/qemu-project/qemu/-/issues/321
      
      
      Reviewed-by: default avatarPeter Maydell <peter.maydell@linaro.org>
      Signed-off-by: default avatarDinah Baum <dinahbaum123@gmail.com>
      Message-Id: <20230221110631.4142-1-dinahbaum123@gmail.com>
      Reviewed-by: default avatarThomas Huth <thuth@redhat.com>
      Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@linaro.org>
      [thuth: Remove second "touch $MARKER"]
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      f160a5b2
  8. Feb 17, 2023
  9. Feb 14, 2023
    • Thomas Huth's avatar
      configure: Bump minimum Clang version to 10.0 · 74a1b256
      Thomas Huth authored
      
      Anthony Perard recently reported some problems with Clang v6.0 from
      Ubuntu Bionic (with regards to the -Wmissing-braces configure test).
      Since we're not officially supporting that version of Ubuntu anymore,
      we should better bump our minimum version check in the configure script
      instead of using our time to fix problems of unsupported compilers.
      According to repology.org, our supported distros ship these versions
      of Clang (looking at the highest version only):
      
                    Fedora 36: 14.0.5
            CentOS 8 (RHEL-8): 12.0.1
                    Debian 11: 13.0.1
           OpenSUSE Leap 15.4: 13.0.1
             Ubuntu LTS 20.04: 12.0.0
                FreeBSD Ports: 15.0.7
                NetBSD pkgsrc: 15.0.7
                     Homebrew: 15.0.7
                  MSYS2 mingw: 15.0.7
                  Haiku ports: 12.0.1
      
      While it seems like we could update to v12.0.0 from that point of view,
      the default version on Ubuntu 20.04 is still v10.0, and we use that for
      our CI tests based via the tests/docker/dockerfiles/ubuntu2004.docker
      file.
      
      Thus let's make v10.0 our minimum version now (which corresponds to
      Apple Clang version v12.0). The -Wmissing-braces check can then be
      removed, too, since both our minimum GCC and our minimum Clang version
      now handle this correctly.
      
      Message-Id: <20230131180239.1582302-1-thuth@redhat.com>
      Reviewed-by: default avatarAlex Bennée <alex.bennee@linaro.org>
      Reviewed-by: default avatarRichard Henderson <richard.henderson@linaro.org>
      Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
      74a1b256
  10. Jan 26, 2023
  11. Jan 11, 2023
  12. Jan 06, 2023
  13. Dec 23, 2022
  14. Dec 20, 2022
  15. Nov 22, 2022
  16. Nov 06, 2022
    • Stefan Weil's avatar
      Fix broken configure with -Wunused-parameter · 8a0afbb2
      Stefan Weil authored
      
      The configure script fails because it tries to compile small C programs
      with a main function which is declared with arguments argc and argv
      although those arguments are unused.
      
      Running `configure -extra-cflags=-Wunused-parameter` triggers the problem.
      configure for a native build does abort but shows the error in config.log.
      A cross build configure for Windows with Debian stable aborts with an
      error.
      
      Avoiding unused arguments fixes this.
      
      Signed-off-by: default avatarStefan Weil <sw@weilnetz.de>
      Message-Id: <20221102202258.456359-1-sw@weilnetz.de>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      8a0afbb2
  17. Oct 31, 2022
  18. Oct 18, 2022
    • Michal Privoznik's avatar
      configure: Avoid using strings binary · 33ab5f24
      Michal Privoznik authored
      When determining the endiandness of the target architecture we're
      building for a small program is compiled, which in an obfuscated
      way declares two strings. Then, we look which string is in
      correct order (using strings binary) and deduct the endiandness.
      But using the strings binary is problematic, because it's part of
      toolchain (strings is just a symlink to
      x86_64-pc-linux-gnu-strings or llvm-strings). And when
      (cross-)compiling, it requires users to set the symlink to the
      correct toolchain.
      
      Fortunately, we have a better alternative anyways. We can mimic
      what compiler.h is already doing: comparing __BYTE_ORDER__
      against values for little/big endiandness.
      
      Bug: https://bugs.gentoo.org/876933
      
      
      Signed-off-by: default avatarMichal Privoznik <mprivozn@redhat.com>
      Message-Id: <d6d9c7043cfe6d976d96694f2b4ecf85cf3206f1.1665732504.git.mprivozn@redhat.com>
      Cc: qemu-stable@nongnu.org
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      33ab5f24
    • Paolo Bonzini's avatar
      configure: don't enable firmware for targets that are not built · 35fd22b0
      Paolo Bonzini authored
      
      This avoids the unfortunate effect of building pc-bios blobs
      even for targets the user isn't interested in.
      
      Due to the bi-arch nature of x86 and PPC firmware, check for the
      desired target by hand, and don't just look for the compilation target
      in $target_list.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      35fd22b0
  19. Oct 11, 2022
  20. Oct 06, 2022
Loading