From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2960B400DE8; Thu, 16 Jul 2026 14:00:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784210425; cv=none; b=e6JTpMZpCvxnkPT+5jZmCNuU+dS1tA8VYctLO81yw3w9m5V0zsItG6oZMGspVOooPdFFIniUzB66DoWdpTicjBkdE5OFNy+x/vs7Ydzq3UJaNNPyI0pG27qkkTeG016zw74LFPQ1KkhSmv0aTgSNCM+YDuodvKcGR7e7dUzXfss= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784210425; c=relaxed/simple; bh=rAkCZX72x5D7cavF8h42efQOJd1Z2I1N1xqSrv//E38=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=d1JAuqIlc7yvdffHEbFgm21HxNu/B+7tZFh6iEVRNmL2sMzctlp7YJi7RAp8m0gbfwZSma1aRM7ExsHxlaZjgNC9shDVOh6GNPbtNt3/Ifx/+lflXEK5soCsehEakSogMJ0ou7eUMXR3+FfA2C+qSB36XGiyLivjSsh6Hq1MAS0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=UTVzcrI2; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="UTVzcrI2" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DC371F000E9; Thu, 16 Jul 2026 14:00:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1784210424; bh=FmySMID2put2mU8HwPsVZRvy9kB4KIquda18Sq9nNyc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=UTVzcrI2YYBspKTQHmiImAZv4jP4MAMfKsjwc77xpHkoUnjvFP4GGx4K9mRfBBcYm ba5a8MoK9ynyOVglGlP7Cp8PmUZBBERTZSYwtc2WmCjlQNfLa/NUz5ma0nSwy1o7I/ LZWTzd/z8BVS/4DZTZhzJhZDTqblHpsyOv8BAU8E= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Alice Ryhl , Miguel Ojeda Subject: [PATCH 6.18 040/480] rust: Kbuild: set frame-pointer llvm module flag for CONFIG_FRAME_POINTER Date: Thu, 16 Jul 2026 15:26:27 +0200 Message-ID: <20260716133045.571209187@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260716133044.672218725@linuxfoundation.org> References: <20260716133044.672218725@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Alice Ryhl commit 191f49f1e38b1c10eb44b0f967c6175c884ef7db upstream. Due to a rustc bug, the -Cforce-frame-pointers=y flag only emits the frame-pointer annotation for functions, but not for the module. This means that functions generated by the LLVM backend such as 'asan.module_ctor' do not receive the frame-pointer annotation. This is likely to lead to broken backtraces and may also cause issues with ftrace if these features are used with functions generated by the LLVM backend. Thus, use -Zllvm_module_flag to work around this rustc bug if using a rustc without the fix. [ The fix [1] has landed for Rust 1.98.0 (expected release on 2026-08-20). - Miguel ] Cc: stable@vger.kernel.org # 6.12.y and later (flag not available in pinned Rust in older LTSs). Fixes: 2f7ab1267dc9 ("Kbuild: add Rust support") Link: https://github.com/rust-lang/rust/pull/156980 [1] Signed-off-by: Alice Ryhl Link: https://patch.msgid.link/20260616-frame-ptr-fix-v1-1-dc6b29a631d9@google.com [ - Adjusted Cc: stable@ as discussed. Signed-off-by: Greg Kroah-Hartman - Added comment with link to the PR, similar to what we did in commit ac35b5580ace ("rust: arm64: set uwtable llvm module flag for CONFIG_UNWIND_TABLES"). - Miguel ] Signed-off-by: Miguel Ojeda --- Makefile | 3 +++ 1 file changed, 3 insertions(+) --- a/Makefile +++ b/Makefile @@ -905,6 +905,9 @@ KBUILD_CFLAGS += $(stackp-flags-y) ifdef CONFIG_FRAME_POINTER KBUILD_CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls KBUILD_RUSTFLAGS += -Cforce-frame-pointers=y +# Work around rustc bug on compilers without +# https://github.com/rust-lang/rust/pull/156980. +KBUILD_RUSTFLAGS += $(if $(call rustc-min-version,109800),,-Zllvm_module_flag=frame-pointer:u32:2:max) else # Some targets (ARM with Thumb2, for example), can't be built with frame # pointers. For those, we don't have FUNCTION_TRACER automatically