From 7e25cc2aa0b7a34a5f42a4edb2c5477ddcfa2381 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 7 May 2024 11:34:19 +0100 Subject: [PATCH] build: Add "fuzzing" as a valid cfg(..) attribute The compiler is now able to warn if an invalid attribute (e.g like a feature) is not available. See https://blog.rust-lang.org/2024/05/06/check-cfg.html for more details. Add build.rs files in the crates that use #cfg(fuzzing) to add fuzzing to the list of valid cfg attributes. Signed-off-by: Rob Bradford --- net_util/build.rs | 8 ++++++++ virtio-devices/build.rs | 8 ++++++++ vmm/build.rs | 8 ++++++++ 3 files changed, 24 insertions(+) create mode 100644 net_util/build.rs create mode 100644 virtio-devices/build.rs create mode 100644 vmm/build.rs diff --git a/net_util/build.rs b/net_util/build.rs new file mode 100644 index 000000000..8a89660d9 --- /dev/null +++ b/net_util/build.rs @@ -0,0 +1,8 @@ +// Copyright © 2024 Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 +// + +fn main() { + println!("cargo::rustc-check-cfg=cfg(fuzzing)"); +} diff --git a/virtio-devices/build.rs b/virtio-devices/build.rs new file mode 100644 index 000000000..8a89660d9 --- /dev/null +++ b/virtio-devices/build.rs @@ -0,0 +1,8 @@ +// Copyright © 2024 Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 +// + +fn main() { + println!("cargo::rustc-check-cfg=cfg(fuzzing)"); +} diff --git a/vmm/build.rs b/vmm/build.rs new file mode 100644 index 000000000..8a89660d9 --- /dev/null +++ b/vmm/build.rs @@ -0,0 +1,8 @@ +// Copyright © 2024 Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 +// + +fn main() { + println!("cargo::rustc-check-cfg=cfg(fuzzing)"); +}