From nobody Mon Feb 9 19:08:59 2026 Received: from zg8tmtyylji0my4xnjeumjiw.icoremail.net (zg8tmtyylji0my4xnjeumjiw.icoremail.net [162.243.161.220]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 15A64157466; Tue, 30 Jul 2024 22:21:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=162.243.161.220 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722378076; cv=none; b=k4mkhF2uI/pR9qfUu9889O8lnMsTyBF6UbjKjRa8KkGBWNK1hdKCyQiThmv+vUiZ/reH/BL4lG4tPnuNL4zGbpHYIASjhbUo/MTu6XiLWJt2OfPRE3UxX7rYiBmO7gZGb6NHRkd6ekVhTfuB3kK6Is6li64b7FmA+n3Y3YzW7cc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722378076; c=relaxed/simple; bh=IBY9niT3crChkL57i2tqKYDFZoHdqXWz0t4ljNwbLrQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=KxJo7fokmHfOXXyiuloMYifUhCdBA4092P4t5tk0wqFQY9Ka0pGbqBhuH90UL24oOeYMm/Vg7+GrbVbrw940cNQF9ChYJVmYiHO2/PKbQI5RiLSq/rHwSNGSHTFmURT3+QUaMx0D6sAQgrQnj4vci6bQ947r38hK7ULgsG49rh0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=whu.edu.cn; spf=pass smtp.mailfrom=whu.edu.cn; dkim=fail (0-bit key) header.d=whu.edu.cn header.i=@whu.edu.cn header.b=sVlb9nUq reason="key not found in DNS"; arc=none smtp.client-ip=162.243.161.220 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=whu.edu.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=whu.edu.cn Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="key not found in DNS" (0-bit key) header.d=whu.edu.cn header.i=@whu.edu.cn header.b="sVlb9nUq" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=whu.edu.cn; s=dkim; h=Received:Received:From:To:Cc:Subject: Date:Message-ID:MIME-Version:Content-Transfer-Encoding; bh=JLqJc 6R1ahX/CN5dyLs8cECox0Rx+KE2rkJzMprmvtI=; b=sVlb9nUqZ9YRy2/cPQcpP r+VmKV2zgaKIfS+BU4iX68cyUZ5Hw2CgHnPcgkkROzfjal7HiBCQrK0bVIklopiQ zPba+yd7KKKfah+8y67T4+2FnmVDrqkCWlclim1OTE4YTq1vwFxr+1BxRoAK36rb 1y0vsAvRuheuxb2lo7mR+U= Received: from whu.edu.cn (unknown [10.1.14.8]) by app1 (Coremail) with SMTP id Bg4BCgAnACZOZ6lmc4bOAA--.29964S2; Wed, 31 Jul 2024 06:21:02 +0800 (CST) Received: from zehuixu-vmwarevirtualplatform.localdomain (unknown [82.130.46.207]) by mtasvr (Coremail) with SMTP id _____wB3Q_VIZ6lmkd4JAA--.480S2; Wed, 31 Jul 2024 06:21:01 +0800 (CST) From: Zehui Xu To: ojeda@kernel.org, alex.gaynor@gmail.com, wedsonaf@gmail.com Cc: boqun.feng@gmail.com, gary@garyguo.net, bjorn3_gh@protonmail.com, benno.lossin@proton.me, a.hindborg@samsung.com, aliceryhl@google.com, rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, zehuixu@whu.edu.cn Subject: [PATCH] rust: Kbuild: Skip -fmin-function-alignment in bindgen flags Date: Wed, 31 Jul 2024 01:20:53 +0300 Message-ID: <20240730222053.37066-1-zehuixu@whu.edu.cn> X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: Bg4BCgAnACZOZ6lmc4bOAA--.29964S2 Authentication-Results: app1; spf=neutral smtp.mail=zehuixu@whu.edu.c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fo: qsqrmjqqqqijqqxyq4lkxovvfxof0/1tbiAgYOA2apDkcEwwAAsI Content-Type: text/plain; charset="utf-8" GCC recently added the -fmin-function-alignment option, which will appear i= n GCC 14. However, this flag can cause issues when passed to the Rust Makef= ile and affect the bindgen process. Bindgen relies on libclang to parse C c= ode, and currently does not support the -fmin-function-alignment flag, lead= ing to compilation failures when GCC 14 is used. This patch addresses the issue by adding -fmin-function-alignment to the bi= ndgen_skip_c_flags in rust/Makefile, ensuring it is skipped during the bind= gen process. This prevents the flag from causing compilation issues and mai= ntains compatibility with the upcoming GCC 14. This is my first patch to the kernel, if there are any issues or improvemen= ts needed, please let me know. ;) Reference: https://lore.kernel.org/linux-kbuild/20240222133500.16991-1-petr.pavlu@suse= .com/ Signed-off-by: Zehui Xu --- rust/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust/Makefile b/rust/Makefile index 1f10f92737f2..0c8736cce64f 100644 --- a/rust/Makefile +++ b/rust/Makefile @@ -227,7 +227,7 @@ bindgen_skip_c_flags :=3D -mno-fp-ret-in-387 -mpreferre= d-stack-boundary=3D% \ -fno-reorder-blocks -fno-allow-store-data-races -fasan-shadow-offset=3D% \ -fzero-call-used-regs=3D% -fno-stack-clash-protection \ -fno-inline-functions-called-once -fsanitize=3Dbounds-strict \ - -fstrict-flex-arrays=3D% \ + -fstrict-flex-arrays=3D% -fmin-function-alignment=3D% \ --param=3D% --param asan-% =20 # Derived from `scripts/Makefile.clang`. --=20 2.45.2