Skip to content

Commit 869b501

Browse files
Zehui Xuojeda
Zehui Xu
authored andcommitted
kbuild: rust: skip -fmin-function-alignment in bindgen flags
GCC 14 recently added -fmin-function-alignment option and the root Makefile uses it to replace -falign-functions when available. However, this flag can cause issues when passed to the Rust Makefile and affect the bindgen process. Bindgen relies on libclang to parse C code, and currently does not support the -fmin-function-alignment flag, leading to compilation failures when GCC 14 is used. This patch addresses the issue by adding -fmin-function-alignment to the bindgen_skip_c_flags in rust/Makefile. This prevents the flag from causing compilation issues. [ Matthew and Gary confirm function alignment should not change the ABI in a way that bindgen would care about, thus we did not need the extra logic for bindgen from v2. - Miguel ] Link: https://lore.kernel.org/linux-kbuild/[email protected]/ Signed-off-by: Zehui Xu <[email protected]> Reviewed-by: Alice Ryhl <[email protected]> Reviewed-by: Neal Gompa <[email protected]> Reviewed-by: Gary Guo <[email protected]> Link: https://lore.kernel.org/r/[email protected] [ Reworded title. - Miguel ] Signed-off-by: Miguel Ojeda <[email protected]>
1 parent fe99216 commit 869b501

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

rust/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \
227227
-fno-reorder-blocks -fno-allow-store-data-races -fasan-shadow-offset=% \
228228
-fzero-call-used-regs=% -fno-stack-clash-protection \
229229
-fno-inline-functions-called-once -fsanitize=bounds-strict \
230-
-fstrict-flex-arrays=% \
230+
-fstrict-flex-arrays=% -fmin-function-alignment=% \
231231
--param=% --param asan-%
232232

233233
# Derived from `scripts/Makefile.clang`.

0 commit comments

Comments
 (0)