From nobody Fri Apr 4 03:43:02 2025 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=1740666783; cv=none; d=zohomail.com; s=zohoarc; b=ceoXrAUs/lstlm+ZgSvK03MiW9d58WyAxsRT/xKPzZDj6dIUjtcKHFAzId0RJ3OhGygbaOnF/E3wDw2B22QTRYvhCvQIIB+uTEkKeSPxMVpWab0LPnK7CeOFVafdoiX5e3phrzv07yBi/1tqbBPq8xMzA5J5XOnUy3ulDgHHJf4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1740666783; h=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=6S3+h0KILMZzEFjUXbmLqWGpqxuaheqFJv+xCK/jNY0=; b=BJ3iP2gLdsuZAdE/z+lRnGPeZ7GkSfUGGm85z5SWcRSD3bzIu/CuaqZQGjTWZ6nElac02B53YCbLqByqk0FbWkYk5vP4lO4jw9KXWS4a39V+2P9FODHPc896c48VfbTh00T/Fxwt6V0sd6c5MTwQHSU+aX70RUthihc5iAE1Brg= 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 1740666783829557.1057012303909; Thu, 27 Feb 2025 06:33:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tnekL-0006yh-8K; Thu, 27 Feb 2025 09:20:17 -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 1tnekH-0006vG-NE for qemu-devel@nongnu.org; Thu, 27 Feb 2025 09:20:13 -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 1tnekC-0003gY-41 for qemu-devel@nongnu.org; Thu, 27 Feb 2025 09:20:10 -0500 Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-15-eTkUseSzMl2VTEQWiQoP0Q-1; Thu, 27 Feb 2025 09:20:05 -0500 Received: by mail-ed1-f71.google.com with SMTP id 4fb4d7f45d1cf-5de5172cc5bso918130a12.0 for ; Thu, 27 Feb 2025 06:20:05 -0800 (PST) Received: from [192.168.10.48] ([176.206.102.52]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-abf0c75d8ddsm127748866b.154.2025.02.27.06.20.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Feb 2025 06:20:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1740666007; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6S3+h0KILMZzEFjUXbmLqWGpqxuaheqFJv+xCK/jNY0=; b=ZAc5Ma+t7Y5kmVBcFi7AYeOjPkHmMtnv0dISxhjQYMWba7S+QxX2N6gkSjOyP+v24EFShS SkmSXfX76+Rx13aL6qC1zYjr8bQTylRM1bUXnlEVRVVjgl3+pViM/vpQA23OpQjWNCwDh7 snDxyTNRfton/q4njcNPaU09Ap8m1pY= X-MC-Unique: eTkUseSzMl2VTEQWiQoP0Q-1 X-Mimecast-MFC-AGG-ID: eTkUseSzMl2VTEQWiQoP0Q_1740666004 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1740666004; x=1741270804; 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=6S3+h0KILMZzEFjUXbmLqWGpqxuaheqFJv+xCK/jNY0=; b=GkTQdWI+uhZNIf6BHBfRrW30fCY5XmvdbdeZvEEpF4I47v3dTV4o34ELZ03TUKSABZ oXb50jZI8aOUiH/POFAn+pT7Bz52dd6gj9l8xv+OkAmB7wF+MXTACG8/W5lQWydpqOGE XWJdtBSPmYGjHfWLfqd+Iq3e9N9MlXT+0nOZLHq6q4iEwSL88ueBKdEv2qh1y9haAtzo 5ELIMnx9D0eYjAS7vXDPNfaDCxdULoDFOA0KL59oofCKDn8guMgQGCzDvsE4t5fJNtuC V2JNM+uyN9aFSWwKpGh1YwaorAIfOCkOjQhRzChrvYdSuBWkfL3rWlc5zXrdXJfXXx+v 0o0A== X-Gm-Message-State: AOJu0YzBWsBqxic4oWUpWOO3agdraa7q3TPsej5me2JNKUffFgxOR3vr 3moNWxpg67WTVLWkMT2xbuy+/yJ4LonRMSmN3WHIIHt9nmhDDOxXxl8NFzp0FNe3Orw85+Jgrum 4ofJFlAx3bO8baSoWPC9pH1a3wP5gGuHJNQQPo6l+6W7aOV+YrkK+U1C0yGFz9ywPo9cR2jrAkQ 7QtumypnUMSI0xQk0JU8yxw1ZoHneBKIM1ec++/vc= X-Gm-Gg: ASbGncu6vRwUpvfqp8307xIAFQcM8Ik4/BODbOZ4Onbd0iDgP6oVpo6UoGq01iPfm82 /J71x9xjkhJ1zc6SxYJMYiYvLJwgPExdMIVom5aEYtOizFBysVQDJy3G8rfGNZPWKZV8WdwhJr0 7w03x/VJbdRpegYZr3h8gmbSEt/TpqIXdrBn8EWfNRQ7+ZyRwqdyuqkG68iBss8ypIeQJghsO9W 4QRc3u3ytk7NoEi/vGWUwoYce2J4HSyfS/sFoypJxClhRlYwYOh1htkmOQ04PQV/ywKHVZr4jrM Sh+K2hDH7BDDcMJ4HxKS X-Received: by 2002:a05:6402:35d3:b0:5dc:caab:9447 with SMTP id 4fb4d7f45d1cf-5e4469dd8eemr30508391a12.18.1740666003596; Thu, 27 Feb 2025 06:20:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IGqZlhQ7KbyYU/7FFHFZRg0Qb5nNfwuQTkzsuGR8q0ELLB/0jkLy8pDqW/yjIx7SX0BSD7zWA== X-Received: by 2002:a05:6402:35d3:b0:5dc:caab:9447 with SMTP id 4fb4d7f45d1cf-5e4469dd8eemr30508292a12.18.1740666002966; Thu, 27 Feb 2025 06:20:02 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Cc: Zhao Liu Subject: [PULL 04/34] rust: subprojects: add libc crate Date: Thu, 27 Feb 2025 15:19:22 +0100 Message-ID: <20250227141952.811410-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250227141952.811410-1-pbonzini@redhat.com> References: <20250227141952.811410-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.129.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.438, 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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=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: 1740666786237019100 Content-Type: text/plain; charset="utf-8" This allows access to errno values. Reviewed-by: Zhao Liu Signed-off-by: Paolo Bonzini --- rust/Cargo.lock | 7 ++++ rust/qemu-api/Cargo.toml | 1 + scripts/archive-source.sh | 2 +- scripts/make-release | 2 +- subprojects/.gitignore | 1 + subprojects/libc-0.2-rs.wrap | 7 ++++ .../packagefiles/libc-0.2-rs/meson.build | 37 +++++++++++++++++++ 7 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 subprojects/libc-0.2-rs.wrap create mode 100644 subprojects/packagefiles/libc-0.2-rs/meson.build diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 79e142723b8..2ebf0a11ea4 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -54,6 +54,12 @@ dependencies =3D [ "either", ] =20 +[[package]] +name =3D "libc" +version =3D "0.2.162" +source =3D "registry+https://github.com/rust-lang/crates.io-index" +checksum =3D "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef0150= 6398" + [[package]] name =3D "pl011" version =3D "0.1.0" @@ -100,6 +106,7 @@ dependencies =3D [ name =3D "qemu_api" version =3D "0.1.0" dependencies =3D [ + "libc", "qemu_api_macros", "version_check", ] diff --git a/rust/qemu-api/Cargo.toml b/rust/qemu-api/Cargo.toml index a51dd142852..57747bc9341 100644 --- a/rust/qemu-api/Cargo.toml +++ b/rust/qemu-api/Cargo.toml @@ -16,6 +16,7 @@ rust-version =3D "1.63.0" =20 [dependencies] qemu_api_macros =3D { path =3D "../qemu-api-macros" } +libc =3D "0.2.162" =20 [build-dependencies] version_check =3D "~0.9" diff --git a/scripts/archive-source.sh b/scripts/archive-source.sh index 30677c3ec90..e461c1531ed 100755 --- a/scripts/archive-source.sh +++ b/scripts/archive-source.sh @@ -28,7 +28,7 @@ sub_file=3D"${sub_tdir}/submodule.tar" # different to the host OS. subprojects=3D"keycodemapdb libvfio-user berkeley-softfloat-3 berkeley-testfloat-3 arbitrary-int-1-rs bilge-0.2-rs - bilge-impl-0.2-rs either-1-rs itertools-0.11-rs proc-macro2-1-rs + bilge-impl-0.2-rs either-1-rs itertools-0.11-rs libc-0.2-rs proc-macro2-= 1-rs proc-macro-error-1-rs proc-macro-error-attr-1-rs quote-1-rs syn-2-rs unicode-ident-1-rs" sub_deinit=3D"" diff --git a/scripts/make-release b/scripts/make-release index 1b89b3423a8..8c3594a1a47 100755 --- a/scripts/make-release +++ b/scripts/make-release @@ -41,7 +41,7 @@ fi # Only include wraps that are invoked with subproject() SUBPROJECTS=3D"libvfio-user keycodemapdb berkeley-softfloat-3 berkeley-testfloat-3 arbitrary-int-1-rs bilge-0.2-rs - bilge-impl-0.2-rs either-1-rs itertools-0.11-rs proc-macro2-1-rs + bilge-impl-0.2-rs either-1-rs itertools-0.11-rs libc-0.2-rs proc-macro2-= 1-rs proc-macro-error-1-rs proc-macro-error-attr-1-rs quote-1-rs syn-2-rs unicode-ident-1-rs" =20 diff --git a/subprojects/.gitignore b/subprojects/.gitignore index 50f173f90db..d12d34618cc 100644 --- a/subprojects/.gitignore +++ b/subprojects/.gitignore @@ -11,6 +11,7 @@ /bilge-impl-0.2.0 /either-1.12.0 /itertools-0.11.0 +/libc-0.2.162 /proc-macro-error-1.0.4 /proc-macro-error-attr-1.0.4 /proc-macro2-1.0.84 diff --git a/subprojects/libc-0.2-rs.wrap b/subprojects/libc-0.2-rs.wrap new file mode 100644 index 00000000000..bbe08f87883 --- /dev/null +++ b/subprojects/libc-0.2-rs.wrap @@ -0,0 +1,7 @@ +[wrap-file] +directory =3D libc-0.2.162 +source_url =3D https://crates.io/api/v1/crates/libc/0.2.162/download +source_filename =3D libc-0.2.162.tar.gz +source_hash =3D 18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01= 506398 +#method =3D cargo +patch_directory =3D libc-0.2-rs diff --git a/subprojects/packagefiles/libc-0.2-rs/meson.build b/subprojects= /packagefiles/libc-0.2-rs/meson.build new file mode 100644 index 00000000000..ac4f80dba98 --- /dev/null +++ b/subprojects/packagefiles/libc-0.2-rs/meson.build @@ -0,0 +1,37 @@ +project('libc-0.2-rs', 'rust', + meson_version: '>=3D1.5.0', + version: '0.2.162', + license: 'MIT OR Apache-2.0', + default_options: []) + +_libc_rs =3D static_library( + 'libc', + files('src/lib.rs'), + gnu_symbol_visibility: 'hidden', + override_options: ['rust_std=3D2015', 'build.rust_std=3D2015'], + rust_abi: 'rust', + rust_args: [ + '--cap-lints', 'allow', + '--cfg', 'freebsd11', + '--cfg', 'libc_priv_mod_use', + '--cfg', 'libc_union', + '--cfg', 'libc_const_size_of', + '--cfg', 'libc_align', + '--cfg', 'libc_int128', + '--cfg', 'libc_core_cvoid', + '--cfg', 'libc_packedN', + '--cfg', 'libc_cfg_target_vendor', + '--cfg', 'libc_non_exhaustive', + '--cfg', 'libc_long_array', + '--cfg', 'libc_ptr_addr_of', + '--cfg', 'libc_underscore_const_names', + '--cfg', 'libc_const_extern_fn', + ], + dependencies: [], +) + +libc_dep =3D declare_dependency( + link_with: _libc_rs, +) + +meson.override_dependency('libc-0.2-rs', libc_dep) --=20 2.48.1