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)]