Re: [PATCH] alpha: Use symbol assignment in SYM_END
From: Magnus Lindholm
Date: Tue Nov 03 2026 - 06:26:05 EST
Hi Linus,
On Tue, Nov 3, 2026 at 10:09 AM Linus Walleij <linusw@xxxxxxxxxx> wrote:
>
> Alpha uses the .set directive to select assembler options, so the
> symbol assignment emitted by the generic SYM_END macro fails to assemble.
> This breaks COMPILE_TEST builds left and right, e.g.:
>
> Error: junk at end of line, first unrecognized character is `,'
> Error: .size expression for bcm6846_runner_start does not evaluate to a constant
>
> Override SYM_END to use an ordinary symbol assignment for the calculated
> size. Preserve the symbol type, size and local size symbol while leaving
> other architectures unchanged.
>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202611031620.n4ptlpo7-lkp@xxxxxxxxx/
> Signed-off-by: Linus Walleij <linusw@xxxxxxxxxx>
> ---
> The generic SYM_END uses .set for symbol assignment, but Alpha interprets
> .set as an assembler mode directive. Provide an Alpha override using
> ordinary assignment.
>
> Tested the unchanged Runner wrapper with an Alpha-targeted GNU assembler
> 2.46.1: the original header reproduces the reported errors, while the
> fixed header assembles without warnings. Symbol sizes and the embedded
> Runner bytes were checked. A full Alpha allyesconfig build was not run.
>
> This patch was prepared with LLM assistance.
> ---
> arch/alpha/include/asm/linkage.h | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/arch/alpha/include/asm/linkage.h b/arch/alpha/include/asm/linkage.h
> index aa8661fa60dc..a3f0302c92d0 100644
> --- a/arch/alpha/include/asm/linkage.h
> +++ b/arch/alpha/include/asm/linkage.h
> @@ -6,4 +6,12 @@
> #define SYSCALL_ALIAS(alias, name) \
> asm ( #alias " = " #name "\n\t.globl " #alias)
>
> +#ifdef __ASSEMBLY__
> +/* Alpha uses .set for assembler options, not symbol assignments. */
> +#define SYM_END(name, sym_type) \
> + .type name sym_type ASM_NL \
> + .L__sym_size_##name = . - name ASM_NL \
> + .size name, .L__sym_size_##name
> +#endif
> +
> #endif
>
> ---
> base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
> change-id: 20261103-alpha-compile-efdde587115c
>
> Best regards,
> --
> Linus Walleij <linusw@xxxxxxxxxx>
>
Thanks for fixing this. I reproduced the failure with the unchanged
BCM6846 Runner wrapper using Alpha GNU as 2.43. With your patch it
assembled without warnings. The start symbol is a 32768-byte OBJECT,
the end label is at offset 0x8000, and the embedded bytes match the
Runner assembler's output. I also cross-built the kernel and modules
with my ES40-config and CONFIG_COMPILE_TEST=y.
One related observation: I tried SYM_FUNC_ALIAS() on Alpha and hit
the same assembler error because the generic SYM_ALIAS() also uses
.set. Maybe that is being handled separately?
For this patch:
Reviewed-by: Magnus Lindholm <linmag7@xxxxxxxxx>
Tested-by: Magnus Lindholm <linmag7@xxxxxxxxx>