From: Nathan Chancellor <nathan@kernel.org>
To: Ard Biesheuvel <ardb+git@google.com>
Cc: linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev,
linux-kernel@vger.kernel.org, will@kernel.org,
catalin.marinas@arm.com, Ard Biesheuvel <ardb@kernel.org>
Subject: Re: [PATCH] arm64: Disable LLD linker ASSERT()s for the time being
Date: Thu, 29 May 2025 19:30:48 -0700 [thread overview]
Message-ID: <20250530023048.GA1491122@ax162> (raw)
In-Reply-To: <20250529073507.2984959-2-ardb+git@google.com>
On Thu, May 29, 2025 at 09:35:08AM +0200, Ard Biesheuvel wrote:
> From: Ard Biesheuvel <ardb@kernel.org>
>
> It turns out that the way LLD handles ASSERT()s in the linker script can
> result in spurious failures, so disable them for the newly introduced
> BSS symbol export checks.
>
> Link: https://github.com/ClangBuiltLinux/linux/issues/2094
> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
You could add Fangrui's commit as a reference to why LLD 21 is needed
for this to work but it is probably not worth a v2 by itself.
https://github.com/llvm/llvm-project/commit/5859863bab7fb1cd98b6028293cba6ba25f7d514
> ---
> arch/arm64/kernel/image-vars.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/arch/arm64/kernel/image-vars.h b/arch/arm64/kernel/image-vars.h
> index c5266430284b..86f088a16147 100644
> --- a/arch/arm64/kernel/image-vars.h
> +++ b/arch/arm64/kernel/image-vars.h
> @@ -10,6 +10,10 @@
> #error This file should only be included in vmlinux.lds.S
> #endif
>
> +#if defined(CONFIG_LD_IS_LLD) && CONFIG_LLD_VERSION < 210000
> +#define ASSERT(...)
> +#endif
> +
> #define PI_EXPORT_SYM(sym) \
> __PI_EXPORT_SYM(sym, __pi_ ## sym, Cannot export BSS symbol sym to startup code)
> #define __PI_EXPORT_SYM(sym, pisym, msg)\
> @@ -142,4 +146,6 @@ KVM_NVHE_ALIAS(kvm_protected_mode_initialized);
> _kernel_codesize = ABSOLUTE(__inittext_end - _text);
> #endif
>
> +#undef ASSERT
> +
> #endif /* __ARM64_KERNEL_IMAGE_VARS_H */
> --
> 2.49.0.1238.gf8c92423fb-goog
>
>
next prev parent reply other threads:[~2025-05-30 2:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-29 7:35 [PATCH] arm64: Disable LLD linker ASSERT()s for the time being Ard Biesheuvel
2025-05-30 2:30 ` Nathan Chancellor [this message]
2025-05-30 13:38 ` Will Deacon
2025-05-30 14:23 ` Ard Biesheuvel
2025-06-02 10:09 ` Will Deacon
2025-06-02 10:18 ` Ard Biesheuvel
2025-06-02 11:43 ` Will Deacon
2025-05-30 15:03 ` Arnd Bergmann
2025-06-02 13:42 ` Will Deacon
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=20250530023048.GA1491122@ax162 \
--to=nathan@kernel.org \
--cc=ardb+git@google.com \
--cc=ardb@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=will@kernel.org \
/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