From: Matt Turner <mattst88@gmail.com>
To: Richard Henderson <richard.henderson@linaro.org>,
Matt Turner <mattst88@gmail.com>,
Magnus Lindholm <linmag7@gmail.com>,
Nathan Chancellor <nathan@kernel.org>,
Nick Desaulniers <nick.desaulniers+lkml@gmail.com>,
Bill Wendling <morbo@google.com>,
Justin Stitt <justinstitt@google.com>,
Nicolas Schier <nsc@kernel.org>
Cc: linux-alpha@vger.kernel.org, linux-kernel@vger.kernel.org,
llvm@lists.linux.dev, linux-kbuild@vger.kernel.org
Subject: [PATCH 1/2] alpha: enable building with clang
Date: Mon, 03 Aug 2026 13:08:41 -0400 [thread overview]
Message-ID: <20260803-alpha-clang-v1-1-1c4ba5ba7a64@gmail.com> (raw)
In-Reply-To: <20260803-alpha-clang-v1-0-1c4ba5ba7a64@gmail.com>
Register the clang target triple for alpha, and pass -Wa,-mev6 only when
building with gcc. That flag exists to stop gas emulating instructions
the assembler thinks the target lacks; it is a gas-only option, and
clang's integrated assembler does not emulate instructions in the first
place, so nothing is needed there.
With this, LLVM=1 (and LLVM_IAS=1) builds work. Note that the alpha
backend is not in upstream LLVM yet; it lives in
https://github.com/alphalinux-org/llvm-project
and is a work in progress.
Signed-off-by: Matt Turner <mattst88@gmail.com>
---
arch/alpha/Makefile | 8 +++++++-
scripts/Makefile.clang | 1 +
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/alpha/Makefile b/arch/alpha/Makefile
index 35445ff2e489..54283705911f 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; clang's integrated assembler never emulates.
+ifdef CONFIG_CC_IS_GCC
+KBUILD_CFLAGS += -Wa,-mev6
+endif
libs-y += arch/alpha/lib/
diff --git a/scripts/Makefile.clang b/scripts/Makefile.clang
index b67636b28c35..2434cf90ad7e 100644
--- a/scripts/Makefile.clang
+++ b/scripts/Makefile.clang
@@ -1,6 +1,7 @@
# Individual arch/{arch}/Makefiles should use -EL/-EB to set intended
# endianness and -m32/-m64 to set word size based on Kconfigs instead of
# relying on the target triple.
+CLANG_TARGET_FLAGS_alpha := alpha-linux-gnu
CLANG_TARGET_FLAGS_arm := arm-linux-gnueabi
CLANG_TARGET_FLAGS_arm64 := aarch64-linux-gnu
CLANG_TARGET_FLAGS_hexagon := hexagon-linux-musl
--
2.54.0
next prev parent reply other threads:[~2026-08-03 17:08 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-03 17:08 [PATCH 0/2] alpha: enable building with clang Matt Turner
2026-08-03 17:08 ` Matt Turner [this message]
2026-08-03 20:56 ` [PATCH 1/2] " Magnus Lindholm
2026-08-03 17:08 ` [PATCH 2/2] alpha: read $gp and $sp explicitly for clang Matt Turner
2026-08-03 21:15 ` Magnus Lindholm
2026-08-11 11:09 ` Maciej W. Rozycki
2026-08-11 17:54 ` Magnus Lindholm
2026-08-11 18:03 ` Matt Turner
2026-08-11 21:56 ` Maciej W. Rozycki
2026-08-12 8:28 ` Magnus Lindholm
2026-08-03 19:51 ` [PATCH 0/2] alpha: enable building with clang Nathan Chancellor
2026-08-17 23:16 ` Nick Desaulniers
2026-08-18 3:28 ` Matt Turner
2026-08-18 16:24 ` Nick Desaulniers
2026-08-19 0:47 ` Maciej W. Rozycki
2026-08-19 1:06 ` Matt Turner
2026-08-19 11:26 ` David Laight
2026-08-05 18:55 ` [PATCH v2 1/2] alpha: pass -Wa,-mev6 only when using GNU as Matt Turner
2026-08-05 21:27 ` Magnus Lindholm
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=20260803-alpha-clang-v1-1-1c4ba5ba7a64@gmail.com \
--to=mattst88@gmail.com \
--cc=justinstitt@google.com \
--cc=linmag7@gmail.com \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=morbo@google.com \
--cc=nathan@kernel.org \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=nsc@kernel.org \
--cc=richard.henderson@linaro.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;
as well as URLs for NNTP newsgroup(s).