[Lldb-commits] [lldb] [NFCI][lldb][test][asm] Enable AT&T syntax explicitly (PR #172358)

via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 15 11:50:46 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Raul Tambre (tambry)

<details>
<summary>Changes</summary>

Implementation files using the Intel syntax typically explicitly specify it. Do the same for the few files using AT&T syntax.
This enables building LLVM with `-mllvm -x86-asm-syntax=intel` in one's Clang config files (i.e. a global preference for Intel syntax).

Unreverts: 14c69497b31038b37c273417f43bd2cfe169c86f

---
Full diff: https://github.com/llvm/llvm-project/pull/172358.diff


2 Files Affected:

- (modified) lldb/packages/Python/lldbsuite/test/make/Makefile.rules (+15) 
- (modified) lldb/test/Shell/helper/toolchain.py (+5) 


``````````diff
diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
index 55dbd3934860f..a0d40ab868874 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -180,21 +180,27 @@ else
 	# amd64, x86_64, x64 -> 64
 	ifeq "$(ARCH)" "amd64"
 		override ARCH := $(subst amd64,64,$(ARCH))
+		IS_X86 := 1
 	endif
 	ifeq "$(ARCH)" "x86_64"
 		override ARCH := $(subst x86_64,64,$(ARCH))
+		IS_X86 := 1
 	endif
 	ifeq "$(ARCH)" "x64"
 		override ARCH := $(subst x64,64,$(ARCH))
+		IS_X86 := 1
 	endif
 	ifeq "$(ARCH)" "x86"
 		override ARCH := $(subst x86,32,$(ARCH))
+		IS_X86 := 1
 	endif
 	ifeq "$(ARCH)" "i386"
 		override ARCH := $(subst i386,32,$(ARCH))
+		IS_X86 := 1
 	endif
 	ifeq "$(ARCH)" "i686"
 		override ARCH := $(subst i686,32,$(ARCH))
+		IS_X86 := 1
 	endif
 	ifeq "$(ARCH)" "powerpc"
 		override ARCH := $(subst powerpc,32,$(ARCH))
@@ -320,6 +326,15 @@ ifeq "$(MAKE_GMODULES)" "YES"
 	CXXFLAGS += $(MANDATORY_MODULE_BUILD_CFLAGS)
 endif
 
+# Our files use x86 AT&T assembly throughout.
+# Enable it explicitly so any local Clang preference for Intel syntax gets overriden.
+ifeq ($(CC_TYPE), clang)
+	ifeq ($(IS_X86), 1)
+		CFLAGS += -mllvm -x86-asm-syntax=att
+		CXXFLAGS += -mllvm -x86-asm-syntax=att
+	endif
+endif
+
 CFLAGS += $(CFLAGS_EXTRAS)
 CXXFLAGS += -std=c++11 $(CFLAGS) $(ARCH_CXXFLAGS)
 # Copy common options to the linker flags (dwarf, arch. & etc).
diff --git a/lldb/test/Shell/helper/toolchain.py b/lldb/test/Shell/helper/toolchain.py
index 0c8c39d37e089..66664561a249d 100644
--- a/lldb/test/Shell/helper/toolchain.py
+++ b/lldb/test/Shell/helper/toolchain.py
@@ -242,6 +242,11 @@ def use_support_substitutions(config):
     # The clang module cache is used for building inferiors.
     host_flags += ["-fmodules-cache-path={}".format(config.clang_module_cache)]
 
+    # Our files use x86 AT&T assembly throughout.
+    # Enable it explicitly so any local Clang preference for Intel syntax gets overriden.
+    if "x86-registered-target" in config.available_features:
+        host_flags += ["-mllvm", "-x86-asm-syntax=att"]
+
     if config.cmake_sysroot:
         host_flags += ["--sysroot={}".format(config.cmake_sysroot)]
 

``````````

</details>


https://github.com/llvm/llvm-project/pull/172358


More information about the lldb-commits mailing list