[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241012112715.1763241-8-sashal@kernel.org>
Date: Sat, 12 Oct 2024 07:26:40 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org,
stable@...r.kernel.org
Cc: Zehui Xu <zehuixu@....edu.cn>,
Alice Ryhl <aliceryhl@...gle.com>,
Neal Gompa <neal@...pa.dev>,
Gary Guo <gary@...yguo.net>,
Miguel Ojeda <ojeda@...nel.org>,
Sasha Levin <sashal@...nel.org>,
alex.gaynor@...il.com,
rust-for-linux@...r.kernel.org
Subject: [PATCH AUTOSEL 6.6 08/20] kbuild: rust: skip -fmin-function-alignment in bindgen flags
From: Zehui Xu <zehuixu@....edu.cn>
[ Upstream commit 869b5016e94eced02f2cf99bf53c69b49adcee32 ]
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/20240222133500.16991-1-petr.pavlu@suse.com/
Signed-off-by: Zehui Xu <zehuixu@....edu.cn>
Reviewed-by: Alice Ryhl <aliceryhl@...gle.com>
Reviewed-by: Neal Gompa <neal@...pa.dev>
Reviewed-by: Gary Guo <gary@...yguo.net>
Link: https://lore.kernel.org/r/20240731134346.10630-1-zehuixu@whu.edu.cn
[ Reworded title. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@...nel.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
rust/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/rust/Makefile b/rust/Makefile
index e5619f25b55ca..060ba8cfa9149 100644
--- a/rust/Makefile
+++ b/rust/Makefile
@@ -288,7 +288,7 @@ bindgen_skip_c_flags := -mno-fp-ret-in-387 -mpreferred-stack-boundary=% \
-fno-reorder-blocks -fno-allow-store-data-races -fasan-shadow-offset=% \
-fzero-call-used-regs=% -fno-stack-clash-protection \
-fno-inline-functions-called-once -fsanitize=bounds-strict \
- -fstrict-flex-arrays=% \
+ -fstrict-flex-arrays=% -fmin-function-alignment=% \
--param=% --param asan-%
# Derived from `scripts/Makefile.clang`.
--
2.43.0
Powered by blists - more mailing lists