From nobody Mon Nov 25 12:22:42 2024 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=1715511153; cv=none; d=zohomail.com; s=zohoarc; b=lOyKgeNvRJjNfoSKIJTIMdwKFcL8KpOL7WyW2abKHebKgMecG3gcbWuISUbYH0WZtHtnPLDyrpeij6LAICu1Idx2FCbZAROewgt5Y6KuxWbQ8knCi8ESusLUhGgS2RN8pxqnAtdrSZDQOGn4GWaZZwQA+qtNEyvzBggOxwPHGj4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1715511153; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=06tnROEYbNdlOjy/Cabi3aQ+xVn+VV5Uf85hOLxVCTM=; b=Gh8ERfzPtRhIdiJ/hUBvSNA0nzpa8WE0miidL+sSIb6JHjOMnUhzGt8ZRJHFDZE7Bnzm9j9TMlNrFDj1RIvC5wEKm+B1zsFa3nGXyp18P8Gi9FC+c6BMM5Kg/rCeyZkgFdB+JDMWs2PFF8PdWUMrvuNA6UUTmLQoTdCZvxHx85I= 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 1715511153245436.73420764828575; Sun, 12 May 2024 03:52:33 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s66nF-0003g4-0g; Sun, 12 May 2024 06:51:01 -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 1s66n6-0003Xc-Ia for qemu-devel@nongnu.org; Sun, 12 May 2024 06:50: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 1s66n4-00069v-Vl for qemu-devel@nongnu.org; Sun, 12 May 2024 06:50:52 -0400 Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-440-idc5n44jNG2zlnfwGQD-kQ-1; Sun, 12 May 2024 06:50:48 -0400 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a59a1fe7396so227179966b.3 for ; Sun, 12 May 2024 03:50:48 -0700 (PDT) Received: from avogadro.local ([151.95.155.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a5a17b17cd0sm442135366b.214.2024.05.12.03.50.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 May 2024 03:50:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1715511050; 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-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=06tnROEYbNdlOjy/Cabi3aQ+xVn+VV5Uf85hOLxVCTM=; b=cT7CT4xXAKK55sZ72rmrWVmOYsIXbAJyH+e/FVsjx6UJr2YlIa2M8S58m+8MCxE/ymSjoh Yq6y/QibX/RCdWeeMGTLdIwBjoVVeWpWjckp6jSeLCL9eXeXx/KXmDASNSwGHlBpBhjxrA XBg7ETwlf/MS1IdY2d/gOlAgcTcAutc= X-MC-Unique: idc5n44jNG2zlnfwGQD-kQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715511046; x=1716115846; 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=06tnROEYbNdlOjy/Cabi3aQ+xVn+VV5Uf85hOLxVCTM=; b=nNFctuTvjlCarGGBa7FXQVYHze7eIoBb+Koq0KhpOOJgGMHGe//uQIAm7zY4PnzTDp 6zJh8eqFMQxoip09kGTjvGYj0GSvu/2VBw2PORyp870CPV0Cj3qrPpHyEDXx0l8v+Gdu tvUTjaq6yLAlaEu0PZVohiepR6AG2TPGGaHxd9tDE0t15vHyJgZdgtYR4P/Ly6I+VMRm oCNEC1Xu1TdaIqbrd4mMQjtmkQ6RJV7sCnv6lMqovwl53XIHHOHWNupkkf0jxcOD5/5h qFGCfgE0V9M/V1sbH4hqpS42J4KOLc3SWubdeFYzXn+bIRimdt7P44G+Dwg9jYgSVpaW Kx6w== X-Gm-Message-State: AOJu0YwEt4nFQL1gC7xlsJMtmbrgdSeSoMlP2wz/9XLwPvwdxfw2Qhba D7M6WBOoesfmCIyGge3YjZ69AVI6svp4F8WVh8h27W15Hs2/yF86L19bmF9y6oELh+2yqIWR8r/ gWjDe2X/P0iM2LGPDMiQD8xkCAPMWXw4siZudBXcu5Kn0FR+cuw5FpkTV+eNtOA0LRGhzf0Qzd6 cpievbgIU+hFAXxPVZtp9BM+W3CFMyIllvd8YM X-Received: by 2002:a17:907:26c9:b0:a59:ba2b:5913 with SMTP id a640c23a62f3a-a5a2d66b525mr593301466b.62.1715511045952; Sun, 12 May 2024 03:50:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFhgSuvqUHo8+OApbS+2ShTQmb+abIloJGP3oYeTOLzlneCoW6XvL862kgoXDAN6CQvuIsTwA== X-Received: by 2002:a17:907:26c9:b0:a59:ba2b:5913 with SMTP id a640c23a62f3a-a5a2d66b525mr593300466b.62.1715511045532; Sun, 12 May 2024 03:50:45 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 23/27] meson: move libfdt together with other dependencies Date: Sun, 12 May 2024 12:49:41 +0200 Message-ID: <20240512104945.130198-24-pbonzini@redhat.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240512104945.130198-1-pbonzini@redhat.com> References: <20240512104945.130198-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset=UTF-8 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: -26 X-Spam_score: -2.7 X-Spam_bar: -- X-Spam_report: (-2.7 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.587, 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_H4=0.001, RCVD_IN_MSPIKE_WL=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: 1715511153859100001 Move the libfdt detection code together with other dependencies instead of keeping it with subprojects. This has the disadvantage of performing the detection even if no target requires libfdt; but it has the advantage that Kconfig will be able to observe the availability of the library. Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Paolo Bonzini --- meson.build | 79 ++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 41 deletions(-) diff --git a/meson.build b/meson.build index ab1f44b25c2..dd4a28f8f8f 100644 --- a/meson.build +++ b/meson.build @@ -1858,6 +1858,34 @@ if numa.found() and not cc.links(''' endif endif =20 +fdt =3D not_found +fdt_opt =3D get_option('fdt') +if fdt_opt =3D=3D 'enabled' and get_option('wrap_mode') =3D=3D 'nodownload' + fdt_opt =3D 'system' +endif +if fdt_opt in ['enabled', 'system'] or (fdt_opt =3D=3D 'auto' and have_sys= tem) + fdt =3D cc.find_library('fdt', required: fdt_opt =3D=3D 'system') + 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 'system' + fdt_opt =3D get_option('wrap_mode') =3D=3D 'nodownload' ? 'disabled' := 'internal' + fdt =3D not_found + else + error('system libfdt is too old (1.5.1 or newer required)') + endif +endif +if fdt_opt =3D=3D 'internal' + assert(not fdt.found()) + libfdt_proj =3D subproject('dtc', required: true, + default_options: ['tools=3Dfalse', 'yaml=3Ddis= abled', + 'python=3Ddisabled', 'default= _library=3Dstatic']) + fdt =3D libfdt_proj.get_variable('libfdt_dep') +endif + rdma =3D not_found if not get_option('rdma').auto() or have_system libumad =3D cc.find_library('ibumad', required: get_option('rdma')) @@ -2199,6 +2227,7 @@ config_host_data.set('CONFIG_BSD', host_os in bsd_ose= s) config_host_data.set('CONFIG_CAPSTONE', capstone.found()) config_host_data.set('CONFIG_COCOA', cocoa.found()) config_host_data.set('CONFIG_DARWIN', host_os =3D=3D 'darwin') +config_host_data.set('CONFIG_FDT', fdt.found()) config_host_data.set('CONFIG_FUZZ', get_option('fuzzing')) config_host_data.set('CONFIG_GCOV', get_option('b_coverage')) config_host_data.set('CONFIG_LIBUDEV', libudev.found()) @@ -3024,14 +3053,16 @@ foreach target : target_dirs error('No accelerator available for target @0@'.format(target)) endif =20 - actual_target_dirs +=3D target config_target +=3D keyval.load('configs/targets' / target + '.mak') config_target +=3D { 'TARGET_' + config_target['TARGET_ARCH'].to_upper()= : 'y' } =20 - if 'TARGET_NEED_FDT' in config_target + if 'TARGET_NEED_FDT' in config_target and not fdt.found() fdt_required +=3D target + continue endif =20 + actual_target_dirs +=3D target + # Add default keys if 'TARGET_BASE_ARCH' not in config_target config_target +=3D {'TARGET_BASE_ARCH': config_target['TARGET_ARCH']} @@ -3119,6 +3150,10 @@ genh +=3D custom_target('config-poison.h', command: [find_program('scripts/make-config-poison.s= h'), target_configs_h]) =20 +if fdt_required.length() > 0 + error('fdt disabled but required by targets ' + ', '.join(fdt_required)) +endif + ############### # Subprojects # ############### @@ -3129,44 +3164,6 @@ if have_system and vfio_user_server_allowed libvfio_user_dep =3D libvfio_user_proj.get_variable('libvfio_user_dep') endif =20 -fdt =3D not_found -fdt_opt =3D get_option('fdt') -if fdt_required.length() > 0 or fdt_opt =3D=3D 'enabled' - if fdt_opt =3D=3D 'disabled' - error('fdt disabled but required by targets ' + ', '.join(fdt_required= )) - endif - - if fdt_opt in ['enabled', 'auto', 'system'] - if get_option('wrap_mode') =3D=3D 'nodownload' - fdt_opt =3D 'system' - endif - fdt =3D cc.find_library('fdt', required: fdt_opt =3D=3D 'system') - 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)') - else - fdt_opt =3D 'internal' - fdt =3D not_found - endif - endif - if not fdt.found() - assert(fdt_opt =3D=3D 'internal') - 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 - -config_host_data.set('CONFIG_FDT', fdt.found()) - vhost_user =3D not_found if host_os =3D=3D 'linux' and have_vhost_user libvhost_user =3D subproject('libvhost-user') @@ -4417,7 +4414,7 @@ summary_info +=3D {'Linux AIO support': libaio} 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 {'fdt support': fdt_opt =3D=3D 'disabled' ? false = : fdt_opt} +summary_info +=3D {'fdt support': fdt_opt =3D=3D 'internal' ? 'inter= nal' : fdt} summary_info +=3D {'libcap-ng support': libcap_ng} summary_info +=3D {'bpf support': libbpf} summary_info +=3D {'rbd support': rbd} --=20 2.45.0