qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>, qemu-devel@nongnu.org
Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org,
	John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Subject: [PATCH 1/3] meson.build: Fix the check for a usable libfdt
Date: Fri, 27 Aug 2021 14:08:59 +0200	[thread overview]
Message-ID: <20210827120901.150276-2-thuth@redhat.com> (raw)
In-Reply-To: <20210827120901.150276-1-thuth@redhat.com>

The check for libfdt currently has a flaw: If there is a system libfdt, the
meson.build code initialized the fdt variable with fdt = cc.find_library(...).
However, if this libfdt is too old and there is no internal dtc module
available, it continues with "fdt" pointing to the old and unusable version.
The check later in the file that tries to detect whether libfdt is necessary
then fails to trigger:

 if not fdt.found() and fdt_required.length() > 0
  error('fdt not available but required by targets ' + ', '.join(fdt_required))
 endif

The build fails then during compilation instead, which is of course bad
since this is quite confusing and already wasted quite some time of the user.
Thus if libfdt is not usable, we should unset the "fdt" variable immediately
again, so that the build already fails during the configuration phase.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/255
Signed-off-by: Thomas Huth <thuth@redhat.com>

If the system has
---
 meson.build | 1 +
 1 file changed, 1 insertion(+)

diff --git a/meson.build b/meson.build
index 0b555197c3..ee156ff0a5 100644
--- a/meson.build
+++ b/meson.build
@@ -1916,6 +1916,7 @@ if have_system
       fdt_opt = 'internal'
     else
       fdt_opt = 'disabled'
+      fdt = not_found
     endif
   endif
   if fdt_opt == 'internal'
-- 
2.27.0



  reply	other threads:[~2021-08-27 12:11 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-27 12:08 [PATCH 0/3] dtc: Fixes for the fdt check and update submodule to 1.6.1 Thomas Huth
2021-08-27 12:08 ` Thomas Huth [this message]
2021-08-27 12:09 ` [PATCH 2/3] meson.build: Don't use internal libfdt if the user requested the system libfdt Thomas Huth
2021-08-27 13:05   ` Philippe Mathieu-Daudé
2021-08-27 12:09 ` [PATCH 3/3] dtc: Update to version 1.6.1 Thomas Huth
2021-09-30  7:10   ` Thomas Huth
2021-09-30 11:56     ` Greg Kurz
2021-10-01  1:42       ` David Gibson
2021-10-01  1:41     ` David Gibson
2021-10-01  9:08     ` Daniel P. Berrangé
2021-10-01  9:37       ` Peter Maydell
2021-10-01  9:44         ` Daniel P. Berrangé
2021-10-01  9:51           ` Peter Maydell
2021-10-01  9:57             ` Peter Maydell
2021-10-01 11:41           ` Thomas Huth
2021-10-02  4:35             ` David Gibson
2021-10-01 17:54           ` Brad Smith
2021-10-01 18:08             ` Brad Smith
2021-08-27 12:22 ` [PATCH 0/3] dtc: Fixes for the fdt check and update submodule to 1.6.1 Marc-André Lureau
2021-08-27 15:17 ` [PATCH 4/3] gitlab-ci: Don't try to use the system libfdt in the debian job Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210827120901.150276-2-thuth@redhat.com \
    --to=thuth@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).