Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit ae87671

Browse files
maurerTreehugger Robot
authored andcommitted
FROMLIST: x86: rust: Disable entry padding with Rust
rustc-1.73.0 used by Linux does not support entry padding. Mark entry padding support as explicitly incompatible with Rust. Bug: 316624874 Link: https://lore.kernel.org/rust-for-linux/[email protected]/ Change-Id: I177faf86a72eb424f7b707d1e21e745994901ff6 Signed-off-by: Matthew Maurer <[email protected]>
1 parent b802a76 commit ae87671

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

arch/x86/Kconfig

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2397,6 +2397,9 @@ config CC_HAS_RETURN_THUNK
23972397
config CC_HAS_ENTRY_PADDING
23982398
def_bool $(cc-option,-fpatchable-function-entry=16,16)
23992399

2400+
config HAVE_ENTRY_PADDING
2401+
def_bool CC_HAS_ENTRY_PADDING && !RUST
2402+
24002403
config FUNCTION_PADDING_CFI
24012404
int
24022405
default 59 if FUNCTION_ALIGNMENT_64B
@@ -2414,17 +2417,17 @@ config FUNCTION_PADDING_BYTES
24142417

24152418
config CALL_PADDING
24162419
def_bool n
2417-
depends on CC_HAS_ENTRY_PADDING && OBJTOOL
2420+
depends on HAVE_ENTRY_PADDING && OBJTOOL
24182421
select FUNCTION_ALIGNMENT_16B
24192422

24202423
config FINEIBT
24212424
def_bool y
2422-
depends on X86_KERNEL_IBT && CFI_CLANG && RETPOLINE
2425+
depends on X86_KERNEL_IBT && CFI_CLANG && RETPOLINE && HAVE_ENTRY_PADDING
24232426
select CALL_PADDING
24242427

24252428
config HAVE_CALL_THUNKS
24262429
def_bool y
2427-
depends on CC_HAS_ENTRY_PADDING && RETHUNK && OBJTOOL
2430+
depends on HAVE_ENTRY_PADDING && RETHUNK && OBJTOOL
24282431

24292432
config CALL_THUNKS
24302433
def_bool n

0 commit comments

Comments
 (0)