From nobody Sun Nov 24 08:36:25 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=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1725971848; cv=none; d=zohomail.com; s=zohoarc; b=N80xWAE2xWo4TgDiZFPdtZbMxQqLbDmdUyV8ttR0IRWLpZRcdImtCT7BKGHJEZKjDkJ/INeqTn3mp/Bwu53Wls3wgOvEsYAb+HhAQPrWMyTPPItJc2t0RJ4Tdha1XV5RlCOE0tXZm1rSZTzoBZVVvYUiR3pgpm4eQwzYpfeDgNc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1725971848; 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=xyrO78X77QhVFouGIPi7mA6rUE8yV7wCKALnuzu9hto=; b=hkf+yrFNXv4bBa1bE3134iqqN4pm71n2tHDkJTpMNz7iFeyVvLPNuHluEH724xgl49bZFBt+FaERaQd9+/wwdYA721OFVc57xtyA46MS1TyoMbh9wvnuI6cU+shm5aAgGMYYsJy+pRoc9/lj+tTcQeio3CH9HhAvCRDzwZ4FG3Q= 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 1725971847985643.9368452127953; Tue, 10 Sep 2024 05:37:27 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1so05w-0008Fm-Ny; Tue, 10 Sep 2024 08:35:44 -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 1so05r-0008E5-Tg for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:35:39 -0400 Received: from mail-wr1-x429.google.com ([2a00:1450:4864:20::429]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1so05p-0004pR-VA for qemu-devel@nongnu.org; Tue, 10 Sep 2024 08:35:39 -0400 Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-374bd059b12so3359489f8f.1 for ; Tue, 10 Sep 2024 05:35:37 -0700 (PDT) Received: from [127.0.1.1] (adsl-234.109.242.225.tellas.gr. [109.242.225.234]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5c3ebd41cd7sm4242994a12.3.2024.09.10.05.35.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Sep 2024 05:35:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725971736; x=1726576536; darn=nongnu.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=xyrO78X77QhVFouGIPi7mA6rUE8yV7wCKALnuzu9hto=; b=KgGoAb1XUm3XUUZOg/L9OxGyy0CUR0JYANAQ0DRhf4CaPA5KXUymiDCpVU8whAkrr9 Lx/dKPY6+IxpOwzIHDjmgTWcX4fn01T1OA/1+JTOpin2TcZLXSBrE22tjfVaIK3EMhFI 1UdRFXfNQt6//YLNsdQb9efngBMNLiZLOpGQ1GU+GIlyTN+KaU789Y6IuZXNOsNvZeaB y3nzCEY1wIoiNNB/0aAygS/SUjBstUdE/Pg5bS5MkJtY6ujbkKHyGjPBLCve6acdwjnh 4Ju+GZ53Zp4PJnYLI2UnVAGBE4teZPe9dsJqRr8ZRPkIqkp903XFvm0yJ0pZFAcFf1Sp np8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725971736; x=1726576536; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xyrO78X77QhVFouGIPi7mA6rUE8yV7wCKALnuzu9hto=; b=iIACpvTZONwkhXjqbR2DAyjGFts/1LBTdR0HyT5OdSN+fYEhSJel4CC8rHxkJIj8iF sEiv/KkA4LBDCOcO6Ksb1biTVaRWFuMauzb6lL4PaUrA449LsYpNFNv22CslcIw6PgJ7 x0VdJdK24MpUXrGApXJS6mKjWwX+6SmHuJhQP90CyIb4KYoFPpIQL+nfAB0tTWgwHGiK 6eu2N6baB4IHFoMd4wTRp9HHVG5le9jw76moRQACGYsvRY1sVsntsLzV6d2RikjczAMQ ZeOx64qx3UhCFOX3k89a9rQu7XfjX+gtNfJBN/NAW9yb+lppE8rw9C9PWf3Q9pHDKBEi plxw== X-Gm-Message-State: AOJu0YyvZFJtcPu8mWRVtBcv4AXd3NQNckWt9IAWYqNXiwIjeuxpUJiQ q9tKkucUZBPrrfkZW1W+LpxIU75FFqR7o2RqjQTQWBtVcUXZaUNL1HOg9rNqGBE= X-Google-Smtp-Source: AGHT+IEdJ4YF+CqRhFGVNAKxj8RUdgGIow2zFt0RCe6LN6lWNZ4SQyFE0lfp/3rXPSDXYi9Snb0fbQ== X-Received: by 2002:a5d:4983:0:b0:374:ca16:e09b with SMTP id ffacd0b85a97d-378949ef74bmr6870055f8f.9.1725971736161; Tue, 10 Sep 2024 05:35:36 -0700 (PDT) From: Manos Pitsidianakis Date: Tue, 10 Sep 2024 15:35:08 +0300 Subject: [PATCH v10 2/9] build-sys: Add rust feature option MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20240910-rust-pl011-v10-2-85a89ee33c40@linaro.org> References: <20240910-rust-pl011-v10-0-85a89ee33c40@linaro.org> In-Reply-To: <20240910-rust-pl011-v10-0-85a89ee33c40@linaro.org> To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Richard Henderson , Gustavo Romero , =?utf-8?q?Alex_Benn=C3=A9e?= , Peter Maydell , Junjie Mao , Zhao Liu , John Snow , Cleber Rosa , Beraldo Leal , Wainer dos Santos Moschetta , qemu-arm@nongnu.org X-Mailer: b4 0.15-dev-c2c95 X-Developer-Signature: v=1; a=openpgp-sha256; l=5706; i=manos.pitsidianakis@linaro.org; h=from:subject:message-id; bh=sf6hnX5CNuBCp1PVgFEUPHeKC7QicbX1QOXnSOSG4tU=; b=LS0tLS1CRUdJTiBQR1AgTUVTU0FHRS0tLS0tCgpvd0VCYlFLUy9aQU5Bd0FLQVhjcHgzQi9mZ 25RQWNzbVlnQm00RDBMdlBuZzNkek5yV1dNRXJ2NGxubGlmaS9LCkZnaXZ0ZitPWGJzeERTVFFP R2lKQWpNRUFBRUtBQjBXSVFUTVhCdE9SS0JXODRkd0hSQjNLY2R3ZjM0SjBBVUMKWnVBOUN3QUt DUkIzS2Nkd2YzNEowQm5ORC8wVEpIM2tJc3RDd3EzVjRqaGhGQ2FRRFBNbjFNN2hXTFFXNDQ2Nw pzZHdZMWdyRGRESmRIeXdYWE1hRlpmT0lFZnhqbEs5M2xENjF0NHphS3pFMy9WcFA3Zmhlb1FwT Fg4OFM0MFFSClFUd0hiK092Q1ZZWVdiTk5TOWptenhvejFnTFlqZGlFRXMvTWY2UEVjSThpQnox QnVpVEQzcVl2OTQ0Skw4c28KMVFBdVZ6bUZMdDJnTHJldDhhUXdOWW1VaUlUTzVVNTdEbWErOXA zRjUxSWZWdFZuMG9icEJ6bnFQYVcyaWJDbAphRmN2Q0tyNXc1VTgxVDVZNmhXN1R2Zlp4NkVwNk gvVktUL2c4ZE13TjcxS1pCNk05bFV2eEt3c0lsSmoxZTVkCjArQUs2dkxBdFA3NVpoVUU2eGhTO WE2blRtdm4xUngvUEh2SGlsRHgySFFtaU1kUkNGN05VdlUvQTNRRjIxTFcKQTFldURTYnlPZDRs MHlGdTBZMWJSRHZwZ052S1V3N3VsRllhM1RHN01GMU1xYzJ6RTJKbk1UNmJjSm9JNFQ0bgprc3J uNUJjcFBpWkl5M01KOWRNMC9Pb0J3TW8yVXZGSlVVdWFjWWxHNmREMWtuZ3R1Q1NIZ3RWS2JsV0 1lRVkwCkkvaWtsSi9Zcm5hWnVweTZxRkxkMzc4T0FwM0szRDZYNDZwOHRWb3F1K1l3Vk5DUTJse XExZzlkV3liZFlrTEoKMTM2NTk4clh1cXo1c1c5Z1RJTDM2NDR5RTdkMmllbFpPTk1DSU96dzQ1 V3k1ZnB6TjAxektZOXluZ3VncXZWegpQR0FSL21tMzI1KytjVllxN3dYMFpyV2dIOXRIQStqTFh QTlh3bi9odXhRU3hMMjIvY3RFZlhoVjRWc3YzalR4ClpNelBlQT09Cj1lczdzCi0tLS0tRU5EIF BHUCBNRVNTQUdFLS0tLS0K X-Developer-Key: i=manos.pitsidianakis@linaro.org; a=openpgp; fpr=7C721DF9DB3CC7182311C0BF68BC211D47B421E1 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=2a00:1450:4864:20::429; envelope-from=manos.pitsidianakis@linaro.org; helo=mail-wr1-x429.google.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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable 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 @linaro.org) X-ZM-MESSAGEID: 1725971848292116600 Add rust feature in meson.build, configure, to prepare for adding Rust code in the followup commits. Signed-off-by: Manos Pitsidianakis Reviewed-by: Alex Benn=C3=A9e --- MAINTAINERS | 5 +++++ meson.build | 22 +++++++++++++++++++++- Kconfig | 1 + Kconfig.host | 3 +++ meson_options.txt | 3 +++ rust/Kconfig | 0 scripts/meson-buildoptions.sh | 3 +++ 7 files changed, 36 insertions(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 3584d6a6c6da9a3210150534d640d29ddf329dce..0bc8e515daf7e63320620b52b42= a799b99dbe035 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4243,6 +4243,11 @@ F: docs/sphinx/ F: docs/_templates/ F: docs/devel/docs.rst =20 +Rust build system integration +M: Manos Pitsidianakis +S: Maintained +F: rust/Kconfig + Miscellaneous ------------- Performance Tools and Tests diff --git a/meson.build b/meson.build index 7eb4b8a41c0a667cacf693cfa2764f326ba72b1f..47a9c04e322a2171daf188eb62b= 7b4ad941c9ea8 100644 --- a/meson.build +++ b/meson.build @@ -70,6 +70,19 @@ if host_os =3D=3D 'darwin' and \ all_languages +=3D ['objc'] objc =3D meson.get_compiler('objc') endif +have_rust =3D false +if not get_option('rust').disabled() and add_languages('rust', required: g= et_option('rust'), native: false) + rustc =3D meson.get_compiler('rust') + have_rust =3D true + if rustc.version().version_compare('<1.80.0') + if get_option('rust').enabled() + error('rustc version ' + rustc.version() + ' is unsupported: Please = upgrade to at least 1.80.0') + else + warning('rustc version ' + rustc.version() + ' is unsupported: Disab= ling Rust compilation. Please upgrade to at least 1.80.0 to use Rust.') + have_rust =3D false + endif + endif +endif =20 dtrace =3D not_found stap =3D not_found @@ -2131,6 +2144,7 @@ endif =20 config_host_data =3D configuration_data() =20 +config_host_data.set('CONFIG_HAVE_RUST', have_rust) audio_drivers_selected =3D [] if have_system audio_drivers_available =3D { @@ -3076,7 +3090,8 @@ host_kconfig =3D \ (host_os =3D=3D 'linux' ? ['CONFIG_LINUX=3Dy'] : []) + \ (multiprocess_allowed ? ['CONFIG_MULTIPROCESS_ALLOWED=3Dy'] : []) + \ (vfio_user_server_allowed ? ['CONFIG_VFIO_USER_SERVER_ALLOWED=3Dy'] : []= ) + \ - (hv_balloon ? ['CONFIG_HV_BALLOON_POSSIBLE=3Dy'] : []) + (hv_balloon ? ['CONFIG_HV_BALLOON_POSSIBLE=3Dy'] : []) + \ + (have_rust ? ['CONFIG_HAVE_RUST=3Dy'] : []) =20 ignored =3D [ 'TARGET_XML_FILES', 'TARGET_ABI_DIR', 'TARGET_ARCH' ] =20 @@ -4287,6 +4302,11 @@ if 'objc' in all_languages else summary_info +=3D {'Objective-C compiler': false} endif +summary_info +=3D {'Rust support': have_rust} +if have_rust + summary_info +=3D {'rustc version': rustc.version()} + summary_info +=3D {'rustc': ' '.join(rustc.cmd_array())} +endif option_cflags =3D (get_option('debug') ? ['-g'] : []) if get_option('optimization') !=3D 'plain' option_cflags +=3D ['-O' + get_option('optimization')] diff --git a/Kconfig b/Kconfig index fb6a24a2de8c3ff11d4ee432d65ad000ba9d6c4d..63ca7f46df788144864b26ef5a6= 4b29ad6547435 100644 --- a/Kconfig +++ b/Kconfig @@ -4,3 +4,4 @@ source accel/Kconfig source target/Kconfig source hw/Kconfig source semihosting/Kconfig +source rust/Kconfig diff --git a/Kconfig.host b/Kconfig.host index 17f405004b3bc765890688304322a1937ca8c01c..4ade7899d67a5ed91928f8ee1e2= 87f5ba3331949 100644 --- a/Kconfig.host +++ b/Kconfig.host @@ -52,3 +52,6 @@ config VFIO_USER_SERVER_ALLOWED =20 config HV_BALLOON_POSSIBLE bool + +config HAVE_RUST + bool diff --git a/meson_options.txt b/meson_options.txt index 0269fa0f16ed6b6f734fcefa2cfa94aa029fa837..fa94a5ce97bb14ab108e21cccb6= 51923ac6a58f8 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -371,3 +371,6 @@ option('hexagon_idef_parser', type : 'boolean', value := true, =20 option('x86_version', type : 'combo', choices : ['0', '1', '2', '3', '4'],= value: '1', description: 'tweak required x86_64 architecture version beyond com= piler default') + +option('rust', type: 'feature', value: 'auto', + description: 'Rust support') diff --git a/rust/Kconfig b/rust/Kconfig new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775= ad8c2e48c5391 diff --git a/scripts/meson-buildoptions.sh b/scripts/meson-buildoptions.sh index c97079a38c9e4ed24a0fe9b44e492b7108481048..5e8a225a6b343cf506950a3146a= f718d52a6c1a0 100644 --- a/scripts/meson-buildoptions.sh +++ b/scripts/meson-buildoptions.sh @@ -170,6 +170,7 @@ meson_options_help() { printf "%s\n" ' rbd Ceph block device driver' printf "%s\n" ' rdma Enable RDMA-based migration' printf "%s\n" ' replication replication support' + printf "%s\n" ' rust Rust support' printf "%s\n" ' rutabaga-gfx rutabaga_gfx support' printf "%s\n" ' sdl SDL user interface' printf "%s\n" ' sdl-image SDL Image support for icons' @@ -452,6 +453,8 @@ _meson_option_parse() { --disable-replication) printf "%s" -Dreplication=3Ddisabled ;; --enable-rng-none) printf "%s" -Drng_none=3Dtrue ;; --disable-rng-none) printf "%s" -Drng_none=3Dfalse ;; + --enable-rust) printf "%s" -Drust=3Denabled ;; + --disable-rust) printf "%s" -Drust=3Ddisabled ;; --enable-rutabaga-gfx) printf "%s" -Drutabaga_gfx=3Denabled ;; --disable-rutabaga-gfx) printf "%s" -Drutabaga_gfx=3Ddisabled ;; --enable-safe-stack) printf "%s" -Dsafe_stack=3Dtrue ;; --=20 2.45.2