[PATCH v2] rust: bindgen: disable GCC latent entropy plugin

stijn@linux-ipv6.be posted 1 patch 6 days, 15 hours ago
rust/Makefile | 4 ++++
1 file changed, 4 insertions(+)
[PATCH v2] rust: bindgen: disable GCC latent entropy plugin
Posted by stijn@linux-ipv6.be 6 days, 15 hours ago
When CONFIG_GCC_PLUGIN_LATENT_ENTROPY and CONFIG_RUST are enabled, rust
bindgen fails due to latent_entropy being undeclared:

  BINDGEN rust/bindings/bindings_generated.rs
./include/linux/random.h:24:39: error: use of undeclared identifier 'latent_entropy'
./include/linux/random.h:24:62: error: use of undeclared identifier 'latent_entropy'
Unable to generate bindings: clang diagnosed error: ./include/linux/random.h:24:39: error: use of undeclared identifier 'latent_entropy'
./include/linux/random.h:24:62: error: use of undeclared identifier 'latent_entropy'

Fix this by adding DISABLE_LATENT_ENTROPY_PLUGIN to
bindgen_extra_c_flags.

Fixes: f1385dc670fe ("init/Kconfig: Only block on RANDSTRUCT for RUST")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
---
Changes since V1:
* Correct "Fixes:" tag.
---
 rust/Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/rust/Makefile b/rust/Makefile
index b9e9f512cec31..a2f13bae29b9e 100644
--- a/rust/Makefile
+++ b/rust/Makefile
@@ -427,6 +427,10 @@ bindgen_extra_c_flags += -enable-trivial-auto-var-init-zero-knowing-it-will-be-r
 endif
 endif
 
+ifdef CONFIG_GCC_PLUGIN_LATENT_ENTROPY
+bindgen_extra_c_flags += $(DISABLE_LATENT_ENTROPY_PLUGIN)
+endif
+
 bindgen_c_flags = $(filter-out $(bindgen_skip_c_flags), $(c_flags)) \
 	$(bindgen_extra_c_flags)
 endif
-- 
2.53.0