Re: [PATCH] x86: rust: Disable entry padding with Rust

From: Dave Hansen
Date: Tue Jan 30 2024 - 18:46:17 EST


On 1/28/24 09:48, Miguel Ojeda wrote:
> On Fri, Dec 15, 2023 at 8:48 PM Matthew Maurer <mmaurer@xxxxxxxxxx> wrote:
>> rustc-1.73.0 used by Linux does not support entry padding. Mark entry
>> padding support as explicitly incompatible with Rust.
> We are now at 1.74.1 and moving to 1.75.0 for the next cycle, which
> does not support it yet, in case whoever applies the patch wants to
> update it in the description.
>
>> Signed-off-by: Matthew Maurer <mmaurer@xxxxxxxxxx>
> x86: are you picking this one up through your tree? Thanks!

Do we need a 'rust-option' equivalent of 'cc-option', like:

config CC_HAS_ENTRY_PADDING
def_bool $(cc-option,-fpatchable-function-entry=16,16)

That way this doesn't become a temporary option at all. We just do:

config RUST_HAS_ENTRY_PADDING
def_bool $(rust-option,-fpatchable-function-entry) # or whatever

and:

config HAVE_ENTRY_PADDING
def_bool CC_HAS_ENTRY_PADDING
depends on !RUST || RUST_HAS_ENTRY_PADDING

and never have to touch this again.