From nobody Tue Feb 10 15:45:33 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1684414059; cv=none; d=zohomail.com; s=zohoarc; b=Lz9OGFYtk8PcX+p3hkfjUx6enGKwRNB7vKgcZuWj8Mu0zKBNpyWD1u/+ipIfbEAPrLzFw9W3BGMUud7JSa+snSHBvpQGC9aYA7odTSuljxJowChUzeMnXuti+6X/4OXP8ySaVz6bjJGYde5kv13pnPoFPsXmYRbw/jrQ1fOGEsQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684414059; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GJcJKyOnYM4Qh3B5SKwE+AzQB6XGKRVMOYp+JdJJUV8=; b=P8+Cjcjuu7rlNraE1YVAiVsm35WgxJlWFY/gmDy9vuYL+eq9G6eB8m+PjZMOch7wxX06a3VrSw0Asnjl/UFQ3Shuv9zwBbdA5/t3jnh0ANFG7t+zsmvQOLc4HGunvP4w35yIsTNqN3JhqdAi/2hEYZGXrsq6dRhflW2bf2LHhos= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1684414059819122.16403936860047; Thu, 18 May 2023 05:47:39 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzd1z-0000Oe-ET; Thu, 18 May 2023 08:46:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzd1y-0000Mg-Hn for qemu-devel@nongnu.org; Thu, 18 May 2023 08:46:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pzd1w-00072c-OZ for qemu-devel@nongnu.org; Thu, 18 May 2023 08:46:54 -0400 Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-534-nCa6etgINX-9jZ54aGEbhA-1; Thu, 18 May 2023 08:46:50 -0400 Received: by mail-ej1-f71.google.com with SMTP id a640c23a62f3a-969f24626fbso177505666b.0 for ; Thu, 18 May 2023 05:46:50 -0700 (PDT) Received: from [192.168.10.118] ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id e14-20020a056402148e00b0050bc7c882bfsm547309edv.65.2023.05.18.05.46.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 May 2023 05:46:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684414012; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GJcJKyOnYM4Qh3B5SKwE+AzQB6XGKRVMOYp+JdJJUV8=; b=cWy4clKmE5WhE5IBfaV7qCJ1oAckQukHo5vpchcRAZDGz3ztoE8evBv3KYL15ArYOC9AVv rCTtPKXkDoTiJB5VAGb4Xy/7ZWVQoydzxwFX5HiSUQxx+3ZBmRmg+C7g6u6rYy740vYLC0 7M+S7qOyvfuggVGLgL7IgcsKJQrfA6s= X-MC-Unique: nCa6etgINX-9jZ54aGEbhA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684414009; x=1687006009; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GJcJKyOnYM4Qh3B5SKwE+AzQB6XGKRVMOYp+JdJJUV8=; b=Ti5NKkOMU3mjVo7IsLME3250c5omjlUvwkingbEntT21ZOKrZYfSIadTJUBa6d0IH1 JJvQ6kEpn/4OVXuhHB7cVhR5qWJ55CDsTmPra9SAVjHmuXhSG9XB5YQkSWIBhlPI2hSF bV1qnv5RZUcYmWPjL89YqMDGWIKYSeFPL97AGIOWBSYxKCZcSVL/DkE8pSPU5ZeD2uwp e2wLhIZIcbkiVKA/AuRnWvCGhzI4eq2dxTFw4CHfUGcEUga47rCOwF7szxqAUH7ATqk7 P7bpSXMJ/MfhYn+RQ6FVJ2/vvVfIJJUNllcF8fR5cbGiKSkzmkORyeKdUK/JFenT3D2H edHw== X-Gm-Message-State: AC+VfDw3aO47obQU2HESXhoYMzBOU6jKbods0zQyhmr/Bn07DJrNiaVA CDYjDcHm8o9Tzpv3cqKp+0wTSICCpUYDRDfZluTgbUnjiuxA8thGNFRUqIAzDatpntrWhKq2FX4 LnWqvuehQnuueQ7Nvg3aYcgTFBKlpz1A3uGERZPc5Q8nDg1mctzSudeeF7m/jbQiUTLs31lIU7G M= X-Received: by 2002:a17:907:1c0e:b0:966:4d11:7887 with SMTP id nc14-20020a1709071c0e00b009664d117887mr6032961ejc.4.1684414009092; Thu, 18 May 2023 05:46:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7dSi9E5UvCccVkabvR9w26gP6evYeJbpQH+C0PyQQvQaidFA0c65YjGT5pjirpg+fcuP24aQ== X-Received: by 2002:a17:907:1c0e:b0:966:4d11:7887 with SMTP id nc14-20020a1709071c0e00b009664d117887mr6032926ejc.4.1684414008600; Thu, 18 May 2023 05:46:48 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: berrange@redhat.com, marcandre.lureau@redhat.com Subject: [PATCH 1/2] meson: use subproject for internal libfdt Date: Thu, 18 May 2023 14:46:44 +0200 Message-Id: <20230518124645.1011316-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230518124645.1011316-1-pbonzini@redhat.com> References: <20230518124645.1011316-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1684414061272100005 Content-Type: text/plain; charset="utf-8" Recent dtc/libfdt can use both Make and meson as the build system. By using a subproject, our own meson.build can remove the hard coded list of source files. In the future, it may also be possible to use wrap to download the submodule. Signed-off-by: Paolo Bonzini --- .gitmodules | 4 ++-- configure | 2 +- meson.build | 44 +++++++++++++-------------------------- scripts/archive-source.sh | 2 +- dtc =3D> subprojects/dtc | 0 5 files changed, 19 insertions(+), 33 deletions(-) rename dtc =3D> subprojects/dtc (100%) diff --git a/.gitmodules b/.gitmodules index 2a3a12033c4b..3ed5d073d630 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,8 +13,8 @@ [submodule "roms/qemu-palcode"] path =3D roms/qemu-palcode url =3D https://gitlab.com/qemu-project/qemu-palcode.git -[submodule "dtc"] - path =3D dtc +[submodule "subprojects/dtc"] + path =3D subprojects/dtc url =3D https://gitlab.com/qemu-project/dtc.git [submodule "roms/u-boot"] path =3D roms/u-boot diff --git a/configure b/configure index 31a787153e38..5bbca83d9a31 100755 --- a/configure +++ b/configure @@ -1188,7 +1188,7 @@ fi case "$fdt" in auto | enabled | internal) # Simpler to always update submodule, even if not needed. - git_submodules=3D"${git_submodules} dtc" + git_submodules=3D"${git_submodules} subprojects/dtc" ;; esac =20 diff --git a/meson.build b/meson.build index 41c87c441f8e..1e75afdc6844 100644 --- a/meson.build +++ b/meson.build @@ -3041,10 +3041,10 @@ if have_system and vfio_user_server_allowed endif =20 fdt =3D not_found -if have_system - fdt_opt =3D get_option('fdt') +fdt_opt =3D get_option('fdt') +if fdt_required.length() > 0 or fdt_opt =3D=3D 'enabled' + have_internal =3D fs.exists(meson.current_source_dir() / 'subprojects/dt= c/meson.build') if fdt_opt in ['enabled', 'auto', 'system'] - have_internal =3D fs.exists(meson.current_source_dir() / 'dtc/libfdt/M= akefile.libfdt') fdt =3D cc.find_library('fdt', required: fdt_opt =3D=3D 'system' or fdt_opt =3D=3D 'enabled' and not have_= internal) @@ -3056,41 +3056,27 @@ if have_system fdt_opt =3D 'system' elif fdt_opt =3D=3D 'system' error('system libfdt requested, but it is too old (1.5.1 or newer r= equired)') - elif have_internal - fdt_opt =3D 'internal' else - fdt_opt =3D 'disabled' + fdt_opt =3D 'internal' fdt =3D not_found endif endif - if fdt_opt =3D=3D 'internal' - fdt_files =3D files( - 'dtc/libfdt/fdt.c', - 'dtc/libfdt/fdt_ro.c', - 'dtc/libfdt/fdt_wip.c', - 'dtc/libfdt/fdt_sw.c', - 'dtc/libfdt/fdt_rw.c', - 'dtc/libfdt/fdt_strerror.c', - 'dtc/libfdt/fdt_empty_tree.c', - 'dtc/libfdt/fdt_addresses.c', - 'dtc/libfdt/fdt_overlay.c', - 'dtc/libfdt/fdt_check.c', - ) =20 - fdt_inc =3D include_directories('dtc/libfdt') - libfdt =3D static_library('fdt', - build_by_default: false, - sources: fdt_files, - include_directories: fdt_inc) - fdt =3D declare_dependency(link_with: libfdt, - include_directories: fdt_inc) + if fdt_opt =3D=3D 'system' + # verified above + elif fdt_opt =3D=3D 'disabled' + error('fdt disabled but required by targets ' + ', '.join(fdt_required= )) + elif not have_internal + error('libfdt source not found - please pull git submodule') + else + libfdt_proj =3D subproject('dtc', required: true, + default_options: ['tools=3Dfalse', 'yaml=3Dd= isabled', + 'python=3Ddisabled', 'defau= lt_library=3Dstatic']) + fdt =3D libfdt_proj.get_variable('libfdt_dep') endif else fdt_opt =3D 'disabled' endif -if not fdt.found() and fdt_required.length() > 0 - error('fdt not available but required by targets ' + ', '.join(fdt_requi= red)) -endif =20 config_host_data.set('CONFIG_CAPSTONE', capstone.found()) config_host_data.set('CONFIG_FDT', fdt.found()) diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh index 23e042dacdb3..b15f6fe6b8fe 100755 --- a/scripts/archive-source.sh +++ b/scripts/archive-source.sh @@ -26,7 +26,7 @@ sub_file=3D"${sub_tdir}/submodule.tar" # independent of what the developer currently has initialized # in their checkout, because the build environment is completely # different to the host OS. -submodules=3D"dtc meson ui/keycodemapdb" +submodules=3D"subprojects/dtc meson ui/keycodemapdb" submodules=3D"$submodules tests/fp/berkeley-softfloat-3 tests/fp/berkeley-= testfloat-3" sub_deinit=3D"" =20 diff --git a/dtc b/subprojects/dtc similarity index 100% rename from dtc rename to subprojects/dtc --=20 2.40.1