Skip to contentSkip to conversation

init/Kconfig: Only block on RANDSTRUCT for RUST

PATCH Superseded Neal Gompa 2 participants 5 messages Jul 31, 2024 Rust

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Neal Gompa

author
#0 lore raw

PATCH 1/1 init/Kconfig: Only block on RANDSTRUCT for RUST

When enabling Rust in the kernel, we only need to block on the RANDSTRUCT feature and GCC plugin. The rest of the GCC plugins are reasonably safe to enable.

---
 init/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
init/Kconfig +2 -2
index a465ea9525bd..ff4ecfa62569 100644
@@ -1900,8 +1900,8 @@ config RUST
 	depends on RUST_IS_AVAILABLE
 	depends on !CFI_CLANG
 	depends on !MODVERSIONS
-	depends on !GCC_PLUGINS
-	depends on !RANDSTRUCT
+	depends on !GCC_PLUGIN_RANDSTRUCT
+	depends on RANDSTRUCT_NONE
 	depends on !DEBUG_INFO_BTF || PAHOLE_HAS_LANG_EXCLUDE
 	help
 	  Enables Rust support in the kernel.
Signature · 1 line
2.45.2
#1 lore raw
Quoted 4 lines · Neal Gompa

When enabling Rust in the kernel, we only need to block on the RANDSTRUCT feature and GCC plugin. The rest of the GCC plugins are reasonably safe to enable.

Yeah, only that one is what we had initially years ago, and then we went the easy route since anyway the mixed builds are best effort at the moment and GCC plugins could possibly be going away anyway.

Did you test it with the other GCC plugins enabled etc.?

Quoted 1 line

+ depends on RANDSTRUCT_NONE

Also, why is this changed?

Thanks!

Cheers,
Miguel

author
#2 lore raw
Quoted 7 lines · Miguel Ojeda
Quoted 4 lines · Neal Gompa

When enabling Rust in the kernel, we only need to block on the RANDSTRUCT feature and GCC plugin. The rest of the GCC plugins are reasonably safe to enable.

Quoted 6 lines

Yeah, only that one is what we had initially years ago, and then we went the easy route since anyway the mixed builds are best effort at the moment and GCC plugins could possibly be going away anyway.

Did you test it with the other GCC plugins enabled etc.?

When I originally wrote this patch two years ago to get things working, Fedora used all the GCC plugins, so I was trying to get GCC + Rust to work while minimizing the delta on build differences. This was the combination that worked. We've been carrying this patch in the Asahi tree for a year now. And while Fedora does not currently have GCC plugins enabled because it caused issues with some third-party modules (I think it was the NVIDIA driver, but I'm not sure), it was around long enough for me to know with some confidence that it was fine this way.

Quoted 4 lines
Quoted 1 line

+ depends on RANDSTRUCT_NONE

Also, why is this changed?

This was mostly because I wanted it to be clearer. The negation didn't exactly read to me the same way, but that hunk can be dropped if you want.

--
真実はいつも一つ!/ Always, there's only one truth!

#3 lore raw
Quoted 6 lines · Neal Gompa

When I originally wrote this patch two years ago to get things working, Fedora used all the GCC plugins, so I was trying to get GCC + Rust to work while minimizing the delta on build differences. This was the combination that worked. We've been carrying this patch in the Asahi tree for a year now. And while Fedora does not currently have

Just for clarity, when you say "carrying the patch for a year", does that mean Asahi used it with the other GCC plugins enabled?

Quoted 4 lines

GCC plugins enabled because it caused issues with some third-party modules (I think it was the NVIDIA driver, but I'm not sure), it was around long enough for me to know with some confidence that it was fine this way.

Same here: I am reading this as "yes, in Fedora we tested it for a while with the other GCC plugins enabled, although not recently".

If so, that is great to know and we can relax things here.

Quoted 2 lines

This was mostly because I wanted it to be clearer. The negation didn't exactly read to me the same way, but that hunk can be dropped if you want.

I see, that is what I suspected, but I wanted to be sure I was not missing something.

I am ambivalent on what reads best, to be honest, so I think I prefer to avoid the change if it is unneeded.

Thanks!

Cheers,
Miguel

author
#4 lore raw
Quoted 12 lines · Miguel Ojeda
Quoted 6 lines · Neal Gompa

When I originally wrote this patch two years ago to get things working, Fedora used all the GCC plugins, so I was trying to get GCC + Rust to work while minimizing the delta on build differences. This was the combination that worked. We've been carrying this patch in the Asahi tree for a year now. And while Fedora does not currently have

Just for clarity, when you say "carrying the patch for a year", does that mean Asahi used it with the other GCC plugins enabled?

Yes. When Fedora had it on, so did we.

Quoted 10 lines
Quoted 4 lines

GCC plugins enabled because it caused issues with some third-party modules (I think it was the NVIDIA driver, but I'm not sure), it was around long enough for me to know with some confidence that it was fine this way.

Same here: I am reading this as "yes, in Fedora we tested it for a while with the other GCC plugins enabled, although not recently".

If so, that is great to know and we can relax things here.

Yup, that is exactly the case.

Quoted 9 lines
Quoted 2 lines

This was mostly because I wanted it to be clearer. The negation didn't exactly read to me the same way, but that hunk can be dropped if you want.

I see, that is what I suspected, but I wanted to be sure I was not missing something.

I am ambivalent on what reads best, to be honest, so I think I prefer to avoid the change if it is unneeded.

I'll send a v2 then.

Signature · 1 line
真実はいつも一つ!/ Always, there's only one truth!