Re: [PATCH v2 1/2] alpha: pass -Wa,-mev6 only when using GNU as

From: Magnus Lindholm

Date: Wed Aug 05 2026 - 17:32:38 EST


Hi Matt,

On Wed, Aug 5, 2026 at 8:56 PM Matt Turner <mattst88@xxxxxxxxx> wrote:
>
> That flag exists to stop gas emulating instructions the assembler thinks
> the target lacks. It is a gas-only option, and LLVM's integrated
> assembler does not emulate instructions in the first place, so nothing
> is needed there.
>
> Condition it on CONFIG_AS_IS_GNU rather than the compiler, so it is
> still passed for clang builds using GNU as (LLVM_IAS=0) and omitted only
> for the integrated assembler.
>
> Signed-off-by: Matt Turner <mattst88@xxxxxxxxx>
> ---
> Only this patch changed; patch 2/2 ("alpha: read $gp and $sp explicitly
> for clang") is unchanged from v1 and is not resent.
>
> Changes in v2:
> - Drop the scripts/Makefile.clang CLANG_TARGET_FLAGS_alpha entry. It
> will be sent separately when the alpha backend is upstreamed to LLVM.
> - Condition -Wa,-mev6 on CONFIG_AS_IS_GNU rather than CONFIG_CC_IS_GCC,
> so it is still passed for clang builds using GNU as (LLVM_IAS=0).
> - Reword the subject and commit message for the reduced scope.
> - Link to v1: https://lore.kernel.org/r/20260803-alpha-clang-v1-0-1c4ba5ba7a64@xxxxxxxxx
>
> arch/alpha/Makefile | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/arch/alpha/Makefile b/arch/alpha/Makefile
> index 35445ff2e489..7074602dca94 100644
> --- a/arch/alpha/Makefile
> +++ b/arch/alpha/Makefile
> @@ -27,10 +27,16 @@ cpuflags-$(CONFIG_ALPHA_GENERIC) := -mcpu=ev56 -mtune=ev6
> cflags-y += $(cpuflags-y)
>
>
> +KBUILD_CFLAGS += $(cflags-y)
> +
> # For TSUNAMI, we must have the assembler not emulate our instructions.
> # The same is true for IRONGATE, POLARIS, PYXIS.
> # BWX is most important, but we don't really want any emulation ever.
> -KBUILD_CFLAGS += $(cflags-y) -Wa,-mev6
> +# Only gas emulates instructions the target does not implement, and only gas
> +# understands -mev6. LLVM's integrated assembler never emulates.
> +ifdef CONFIG_AS_IS_GNU
> +KBUILD_CFLAGS += -Wa,-mev6
> +endif
>
> libs-y += arch/alpha/lib/
>>
> arch/alpha/Makefile | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/arch/alpha/Makefile b/arch/alpha/Makefile
> index 35445ff2e489..7074602dca94 100644
> --- a/arch/alpha/Makefile
> +++ b/arch/alpha/Makefile
> @@ -27,10 +27,16 @@ cpuflags-$(CONFIG_ALPHA_GENERIC) := -mcpu=ev56 -mtune=ev6
> cflags-y += $(cpuflags-y)
>
>
> +KBUILD_CFLAGS += $(cflags-y)
> +
> # For TSUNAMI, we must have the assembler not emulate our instructions.
> # The same is true for IRONGATE, POLARIS, PYXIS.
> # BWX is most important, but we don't really want any emulation ever.
> -KBUILD_CFLAGS += $(cflags-y) -Wa,-mev6
> +# Only gas emulates instructions the target does not implement, and only gas
> +# understands -mev6. LLVM's integrated assembler never emulates.
> +ifdef CONFIG_AS_IS_GNU
> +KBUILD_CFLAGS += -Wa,-mev6
> +endif
>
> libs-y += arch/alpha/lib/
>

Thanks for the update. This looks good to me.

Reviewed-by: Magnus Lindholm linmag7@xxxxxxxxx

Thanks,
Magnus