lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240731134346.10630-1-zehuixu@whu.edu.cn>
Date: Wed, 31 Jul 2024 16:43:46 +0300
From: Zehui Xu <zehuixu@....edu.cn>
To: ojeda@...nel.org,
	alex.gaynor@...il.com,
	wedsonaf@...il.com
Cc: boqun.feng@...il.com,
	gary@...yguo.net,
	bjorn3_gh@...tonmail.com,
	benno.lossin@...ton.me,
	a.hindborg@...sung.com,
	aliceryhl@...gle.com,
	rust-for-linux@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	zehuixu@....edu.cn
Subject: [PATCH v3] rust: Kbuild: 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.

Link: https://lore.kernel.org/linux-kbuild/20240222133500.16991-1-petr.pavlu@suse.com/
Signed-off-by: Zehui Xu <zehuixu@....edu.cn>
---
Since -falign-functions does not affect bindgen output, we do not
need logic to add it back to the flags. Thanks to the community's
help, especially Miguel Ojeda. Hope this patch is free of problems
and can be submitted smoothly : )

v1:
* https://lore.kernel.org/all/20240730222053.37066-1-zehuixu@whu.edu.cn/

v2:
* Added -falign-functions to bindgen_extra_c_flags when skipping 
  -fmin-function-alignment to maintain function alignment settings in GCC 14
* Used reasonable length and moved email content out of the commit message
* Used "Link" tag instead of "Reference:" and removed empty lines between tags
* Specified the base commit
* https://lore.kernel.org/all/20240731034112.6060-1-zehuixu@whu.edu.cn/

v3:
* Removed logic from patch v2 which adds -falign-functions

 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 := -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`.

base-commit: 8400291e289ee6b2bf9779ff1c83a291501f017b
-- 
2.45.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ