From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Zehui Xu <zehuixu@whu.edu.cn>, Alice Ryhl <aliceryhl@google.com>,
Neal Gompa <neal@gompa.dev>, Gary Guo <gary@garyguo.net>,
Miguel Ojeda <ojeda@kernel.org>, Sasha Levin <sashal@kernel.org>,
alex.gaynor@gmail.com, rust-for-linux@vger.kernel.org
Subject: [PATCH AUTOSEL 6.6 08/20] kbuild: rust: skip -fmin-function-alignment in bindgen flags
Date: Sat, 12 Oct 2024 07:26:40 -0400 [thread overview]
Message-ID: <20241012112715.1763241-8-sashal@kernel.org> (raw)
In-Reply-To: <20241012112715.1763241-1-sashal@kernel.org>
From: Zehui Xu <zehuixu@whu.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@whu.edu.cn>
Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Reviewed-by: Neal Gompa <neal@gompa.dev>
Reviewed-by: Gary Guo <gary@garyguo.net>
Link: https://lore.kernel.org/r/20240731134346.10630-1-zehuixu@whu.edu.cn
[ Reworded title. - Miguel ]
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.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
next parent reply other threads:[~2024-10-12 11:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20241012112715.1763241-1-sashal@kernel.org>
2024-10-12 11:26 ` Sasha Levin [this message]
2024-10-12 11:26 ` [PATCH AUTOSEL 6.6 09/20] rust: add intrinsics to fix `-Os` builds Sasha Levin
[not found] <20240823140309.1974696-1-sashal@kernel.org>
2024-08-23 14:02 ` [PATCH AUTOSEL 6.6 08/20] kbuild: rust: skip -fmin-function-alignment in bindgen flags Sasha Levin
2024-08-24 14:45 ` Miguel Ojeda
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241012112715.1763241-8-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=alex.gaynor@gmail.com \
--cc=aliceryhl@google.com \
--cc=gary@garyguo.net \
--cc=linux-kernel@vger.kernel.org \
--cc=neal@gompa.dev \
--cc=ojeda@kernel.org \
--cc=rust-for-linux@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=zehuixu@whu.edu.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).