[compiler-rt] [compiler-rt] Fix building for arm64ec (PR #164590)

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 22 02:55:11 PDT 2025


https://github.com/mstorsjo created https://github.com/llvm/llvm-project/pull/164590

c208a23643231d0b19c6f795895a16dfe6797340 added the directive `.att_syntax` when building for x86 architectures. However, when building for arm64ec (a Windows target, for an ABI compatible with x86_64), the defines for `__x86_64__` (and similar ones like `__amd64__`) are still defined, so we need to check for `__arm64ec__` here as well to skip it for such targets.

This matches similar existing ifdefs for x86_64/aarch64 in compiler-rt builtins.

>From 51831718f00aa1543b5f818139556c9ce05d00e5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
Date: Wed, 22 Oct 2025 07:51:01 +0300
Subject: [PATCH] [compiler-rt] Fix building for arm64ec

c208a23643231d0b19c6f795895a16dfe6797340 added the directive
`.att_syntax` when building for x86 architectures. However,
when building for arm64ec (a Windows target, for an ABI compatible
with x86_64), the defines for `__x86_64__` (and similar ones like
`__amd64__`) are still defined, so we need to check for
`__arm64ec__` here as well to skip it for such targets.

This matches similar existing ifdefs for x86_64/aarch64 in compiler-rt
builtins.
---
 compiler-rt/lib/builtins/assembly.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler-rt/lib/builtins/assembly.h b/compiler-rt/lib/builtins/assembly.h
index d28f73f14b0cf..f5892df7a102c 100644
--- a/compiler-rt/lib/builtins/assembly.h
+++ b/compiler-rt/lib/builtins/assembly.h
@@ -337,7 +337,7 @@
 #endif
 #endif
 
-#if defined(__ASSEMBLER__) && (defined(__i386__) || defined(__amd64__))
+#if defined(__ASSEMBLER__) && (defined(__i386__) || defined(__amd64__)) && !defined(__arm64ec__)
 .att_syntax
 #endif
 



More information about the llvm-commits mailing list