From nobody Tue Feb 10 16:43:56 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=1677763201; cv=none; d=zohomail.com; s=zohoarc; b=IRfjSuh+CEB2PX45NplQiybSOG4IaX6yg6rqJ6cUufMT1TTxBGN2wGN6XnNyYwUuiygZd2nm8Sl8954D9hkyzoPvN8G+EmZhLbLxu7U0vBFb3YtQRykI8VmHum5wAGU8hCX+iHSx3vQzSxuU44j1GXi6wkGaMDqhxk1yXKSzJz4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1677763201; 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=C92cwbrUIEb79ztRwJO63K6JAXeMJ8+BlbvlMZXumCU=; b=MfyDImi5jUG4uObB7eDmMS0exY8RZOP90168SActct1reYcFFS2+by34S+gn0nDmVol4kUpwaZzxxi0Yq3GuqReOghpntCLPRLUJTG6/AEE4pCW6zwnQzxXgZ1uSlNXguudQ4GJJUsgRnVl+prnLvQz+EGCxg2A1GjJ3Kuz1OV4= 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 1677763201397910.0869959159979; Thu, 2 Mar 2023 05:20:01 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXiq6-0002Pk-Jj; Thu, 02 Mar 2023 08:19:18 -0500 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 1pXiq2-0002MS-82 for qemu-devel@nongnu.org; Thu, 02 Mar 2023 08:19:14 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXiq0-0001vu-Ai for qemu-devel@nongnu.org; Thu, 02 Mar 2023 08:19:14 -0500 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-55-MmE3ldrwMceYKrmkwpUYGg-1; Thu, 02 Mar 2023 08:19:10 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E0128858F09; Thu, 2 Mar 2023 13:19:09 +0000 (UTC) Received: from localhost (unknown [10.39.208.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 40D7B40C6EC4; Thu, 2 Mar 2023 13:19:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677763151; 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=C92cwbrUIEb79ztRwJO63K6JAXeMJ8+BlbvlMZXumCU=; b=ieVCPBmBDIH0yzmVlcG1iOGUOSNkqcCmNq73ZVi/1QVLTI2+tG7AhwwsAY7UKW/QBH0aE7 HxzHRQF5I3zV03I5R9gLNWQrixrd8y6hkFIMNNp9Ip5r/jRjaKQIrMpbu6fBmOmjW8sdPZ N9MqA0x7uJEtBESNcixrc9nGEsKy4vc= X-MC-Unique: MmE3ldrwMceYKrmkwpUYGg-1 From: marcandre.lureau@redhat.com To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , John Snow , Paolo Bonzini , Cleber Rosa , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Thomas Huth Subject: [PATCH 4/4] build-sys: replace dtc submodule with dtc.wrap Date: Thu, 2 Mar 2023 17:18:48 +0400 Message-Id: <20230302131848.1527460-5-marcandre.lureau@redhat.com> In-Reply-To: <20230302131848.1527460-1-marcandre.lureau@redhat.com> References: <20230302131848.1527460-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 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.129.124; envelope-from=marcandre.lureau@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 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: 1677763202533100003 From: Marc-Andr=C3=A9 Lureau Use meson wrap fallback for libfdt. Simplify handling of fallback/internal build and get rid of a submodule. This drops support for ./configure --enable-fdt=3Dgit/--enable-fdt=3Dintern= al: if the system version is enough, it will use it, otherwise it can fall back on the wrapped subproject. Signed-off-by: Marc-Andr=C3=A9 Lureau --- configure | 21 ------------- meson.build | 56 +++++------------------------------ .gitignore | 1 + .gitmodules | 3 -- dtc | 1 - meson_options.txt | 5 ++-- scripts/meson-buildoptions.sh | 4 +-- subprojects/dtc.wrap | 6 ++++ 8 files changed, 18 insertions(+), 79 deletions(-) delete mode 160000 dtc create mode 100644 subprojects/dtc.wrap diff --git a/configure b/configure index 02b4aa4ce9..051a5cc69b 100755 --- a/configure +++ b/configure @@ -297,8 +297,6 @@ vfio_user_server=3D"disabled" # are included in the automatically generated help message) =20 # 1. Track which submodules are needed -fdt=3D"auto" - # 2. Automatically enable/disable other options tcg=3D"auto" cfi=3D"false" @@ -860,14 +858,6 @@ for opt do ;; --disable-cfi) cfi=3D"false" ;; - --disable-fdt) fdt=3D"disabled" - ;; - --enable-fdt) fdt=3D"enabled" - ;; - --enable-fdt=3Dgit) fdt=3D"internal" - ;; - --enable-fdt=3D*) fdt=3D"$optarg" - ;; --with-coroutine=3D*) coroutine=3D"$optarg" ;; --with-git=3D*) git=3D"$optarg" @@ -1546,16 +1536,6 @@ if ! compile_prog "$glib_cflags -Werror" "$glib_libs= " ; then fi fi =20 -########################################## -# fdt probe - -case "$fdt" in - auto | enabled | internal) - # Simpler to always update submodule, even if not needed. - git_submodules=3D"${git_submodules} dtc" - ;; -esac - ########################################## # check and set a backend for coroutine =20 @@ -2597,7 +2577,6 @@ if test "$skip_meson" =3D no; then =20 # QEMU options test "$cfi" !=3D false && meson_option_add "-Dcfi=3D$cfi" - test "$fdt" !=3D auto && meson_option_add "-Dfdt=3D$fdt" test -n "${LIB_FUZZING_ENGINE+xxx}" && meson_option_add "-Dfuzzing_engin= e=3D$LIB_FUZZING_ENGINE" test "$qemu_suffix" !=3D qemu && meson_option_add "-Dqemu_suffix=3D$qemu= _suffix" test "$smbd" !=3D '' && meson_option_add "-Dsmbd=3D$smbd" diff --git a/meson.build b/meson.build index 77d2ae87e4..9017141d7d 100644 --- a/meson.build +++ b/meson.build @@ -2759,54 +2759,14 @@ endif =20 fdt =3D not_found if have_system - fdt_opt =3D get_option('fdt') - 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', kwargs: static_kwargs, - required: fdt_opt =3D=3D 'system' or - fdt_opt =3D=3D 'enabled' and not have_= internal) - if fdt.found() and cc.links(''' - #include - #include - int main(void) { fdt_find_max_phandle(NULL, NULL); return 0; }''', - dependencies: fdt) - 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 =3D not_found + # libfdt is not always shipped with a pkgconfig file. + fdt =3D cc.find_library('fdt', kwargs: static_kwargs, required: false) + if not fdt.found() or not cc.has_function('fdt_find_max_phandle', depe= ndencies: fdt) + fdt =3D dependency('fdt', kwargs: static_kwargs, + method: 'pkg-config', version: '>=3D1.5.1', + required: (get_option('fdt').auto() and fdt_required.lengt= h() > 0) or get_option('fdt').enabled(), + default_options: ['python=3Ddisabled', 'tools=3Dfalse']) 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', - ) - - 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) - 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()) @@ -3989,7 +3949,7 @@ summary_info +=3D {'Linux io_uring support': linux_io= _uring} summary_info +=3D {'ATTR/XATTR support': libattr} summary_info +=3D {'RDMA support': rdma} summary_info +=3D {'PVRDMA support': have_pvrdma} -summary_info +=3D {'fdt support': fdt_opt =3D=3D 'disabled' ? false = : fdt_opt} +summary_info +=3D {'fdt support': fdt} summary_info +=3D {'libcap-ng support': libcap_ng} summary_info +=3D {'bpf support': libbpf} summary_info +=3D {'spice protocol support': spice_protocol} diff --git a/.gitignore b/.gitignore index 1ea59f4819..13662d4f24 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,5 @@ GTAGS *.patch *.gcov =20 +/subprojects/dtc /subprojects/slirp diff --git a/.gitmodules b/.gitmodules index 6ce5bf49c5..410a00d566 100644 --- a/.gitmodules +++ b/.gitmodules @@ -13,9 +13,6 @@ [submodule "roms/qemu-palcode"] path =3D roms/qemu-palcode url =3D https://gitlab.com/qemu-project/qemu-palcode.git -[submodule "dtc"] - path =3D dtc - url =3D https://gitlab.com/qemu-project/dtc.git [submodule "roms/u-boot"] path =3D roms/u-boot url =3D https://gitlab.com/qemu-project/u-boot.git diff --git a/dtc b/dtc deleted file mode 160000 index b6910bec11..0000000000 --- a/dtc +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b6910bec11614980a21e46fbccc35934b671bd81 diff --git a/meson_options.txt b/meson_options.txt index fc9447d267..493100ba4c 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -279,9 +279,8 @@ option('vduse_blk_export', type: 'feature', value: 'aut= o', =20 option('capstone', type: 'feature', value: 'auto', description: 'Whether and how to find the capstone library') -option('fdt', type: 'combo', value: 'auto', - choices: ['disabled', 'enabled', 'auto', 'system', 'internal'], - description: 'Whether and how to find the libfdt library') +option('fdt', type: 'feature', value: 'auto', + description: 'libfdt device tree library') =20 option('selinux', type: 'feature', value: 'auto', description: 'SELinux support in qemu-nbd') diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index 009fab1515..2a8e91a60c 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -24,8 +24,6 @@ meson_options_help() { printf "%s\n" ' --enable-debug-mutex mutex debugging support' printf "%s\n" ' --enable-debug-stack-usage' printf "%s\n" ' measure coroutine stack usage' - printf "%s\n" ' --enable-fdt[=3DCHOICE] Whether and how to find the = libfdt library' - printf "%s\n" ' (choices: auto/disabled/enable= d/internal/system)' printf "%s\n" ' --enable-fuzzing build fuzzing targets' printf "%s\n" ' --enable-gcov Enable coverage tracking.' printf "%s\n" ' --enable-gprof QEMU profiling with gprof' @@ -91,6 +89,7 @@ meson_options_help() { printf "%s\n" ' dmg dmg image format support' printf "%s\n" ' docs Documentations build support' printf "%s\n" ' dsound DirectSound sound support' + printf "%s\n" ' fdt libfdt device tree library' printf "%s\n" ' fuse FUSE block device export' printf "%s\n" ' fuse-lseek SEEK_HOLE/SEEK_DATA support for FUSE ex= ports' printf "%s\n" ' gcrypt libgcrypt cryptography support' @@ -262,7 +261,6 @@ _meson_option_parse() { --disable-dsound) printf "%s" -Ddsound=3Ddisabled ;; --enable-fdt) printf "%s" -Dfdt=3Denabled ;; --disable-fdt) printf "%s" -Dfdt=3Ddisabled ;; - --enable-fdt=3D*) quote_sh "-Dfdt=3D$2" ;; --enable-fuse) printf "%s" -Dfuse=3Denabled ;; --disable-fuse) printf "%s" -Dfuse=3Ddisabled ;; --enable-fuse-lseek) printf "%s" -Dfuse_lseek=3Denabled ;; diff --git a/subprojects/dtc.wrap b/subprojects/dtc.wrap new file mode 100644 index 0000000000..da789704d0 --- /dev/null +++ b/subprojects/dtc.wrap @@ -0,0 +1,6 @@ +[wrap-git] +url =3D https://github.com/dgibson/dtc.git +revision =3D 72fc810c3025f07de718f5f32a290a6cd5d1f4ee + +[provide] +fdt =3D libfdt_dep --=20 2.39.2