Skip to content

Commit 6be0a75

Browse files
committed
rust: disable on GCC_PLUGIN_RANDSTRUCT
Suggested-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 447c571 commit 6be0a75

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

init/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,6 +2059,7 @@ config RUST
20592059
depends on HAS_RUST
20602060
depends on !COMPILE_TEST
20612061
depends on !MODVERSIONS
2062+
depends on !GCC_PLUGIN_RANDSTRUCT
20622063
default n
20632064
help
20642065
Enables Rust support in the kernel.

rust/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,9 +188,9 @@ else
188188
# bindgen relies on libclang to parse C. Ideally, bindgen would support a GCC
189189
# plugin backend and/or the Clang driver would be perfectly compatible with GCC.
190190
#
191-
# For the moment, here we are tweaking the flags on the fly. Some config
192-
# options may not work (e.g. `GCC_PLUGIN_RANDSTRUCT` if we end up using one
193-
# of those structs).
191+
# For the moment, here we are tweaking the flags on the fly. This is a hack,
192+
# and some kernel configurations may not work (e.g. `GCC_PLUGIN_RANDSTRUCT`
193+
# if we end up using one of those structs).
194194
bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \
195195
-mskip-rax-setup -mgeneral-regs-only -msign-return-address=% \
196196
-mindirect-branch=thunk-extern -mindirect-branch-register -mrecord-mcount \

0 commit comments

Comments
 (0)