Skip to content

Commit c208a23

Browse files
authored
[NFCI][asm][i386/x86-64] Enable AT&T syntax explicitly (#164453)
Implementation files using the Intel syntax explicitly specify it. Do the same for the few files using AT&T syntax. This also enables building LLVM with `-mllvm -x86-asm-syntax=intel` in one's Clang config files (i.e. a global preference for Intel syntax). No functional change intended.
1 parent 297f972 commit c208a23

File tree

11 files changed

+20
-0
lines changed

11 files changed

+20
-0
lines changed

compiler-rt/lib/asan/asan_rtl_x86_64.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "sanitizer_common/sanitizer_platform.h"
66

77
.file "asan_rtl_x86_64.S"
8+
.att_syntax
89

910
#define NAME(n, reg, op, s, i) n##_##op##_##i##_##s##_##reg
1011

compiler-rt/lib/builtins/assembly.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,4 +337,8 @@
337337
#endif
338338
#endif
339339

340+
#if defined(__i386__) || defined(__amd64__)
341+
.att_syntax
342+
#endif
343+
340344
#endif // COMPILERRT_ASSEMBLY_H

compiler-rt/lib/hwasan/hwasan_setjmp_x86_64.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
.section .text
3232
.file "hwasan_setjmp_x86_64.S"
33+
.att_syntax
3334

3435
.global ASM_WRAPPER_NAME(setjmp)
3536
ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(setjmp))

compiler-rt/lib/orc/elfnix_tls.x86-64.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
// The content of this file is x86_64-only
1515
#if defined(__x86_64__)
16+
.att_syntax
1617

1718
#define REGISTER_SAVE_SPACE_SIZE 512
1819

compiler-rt/lib/orc/sysv_reenter.x86-64.S

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
// The content of this file is x86_64-only
1414
#if defined(__x86_64__)
15+
.att_syntax
1516

1617
// Save all GRPS except %rsp.
1718
// This value is also subtracted from %rsp below, despite the fact that %rbp

compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_vfork_i386.inc.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include "sanitizer_common/sanitizer_asm.h"
44

5+
.att_syntax
6+
57
.comm _ZN14__interception10real_vforkE,4,4
68
.globl ASM_WRAPPER_NAME(vfork)
79
ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(vfork))

compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_vfork_x86_64.inc.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include "sanitizer_common/sanitizer_asm.h"
44

5+
.att_syntax
6+
57
.comm _ZN14__interception10real_vforkE,8,8
68
.globl ASM_WRAPPER_NAME(vfork)
79
ASM_TYPE_FUNCTION(ASM_WRAPPER_NAME(vfork))

compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
#include "sanitizer_common/sanitizer_asm.h"
55

6+
.att_syntax
7+
68
#if !defined(__APPLE__)
79
.section .text
810
#else

libunwind/src/UnwindRegistersRestore.S

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
#if !defined(__USING_SJLJ_EXCEPTIONS__)
2626

2727
#if defined(__i386__)
28+
.att_syntax
29+
2830
DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_x86_jumpto)
2931
#
3032
# extern "C" void __libunwind_Registers_x86_jumpto(Registers_x86 *);
@@ -69,6 +71,7 @@ DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_x86_jumpto)
6971
# skip gs
7072

7173
#elif defined(__x86_64__) && !defined(__arm64ec__)
74+
.att_syntax
7275

7376
DEFINE_LIBUNWIND_FUNCTION(__libunwind_Registers_x86_64_jumpto)
7477
#

libunwind/src/UnwindRegistersSave.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#if !defined(__USING_SJLJ_EXCEPTIONS__)
2626

2727
#if defined(__i386__)
28+
.att_syntax
2829

2930
#
3031
# extern int __unw_getcontext(unw_context_t* thread_state)
@@ -109,6 +110,7 @@ DEFINE_LIBUNWIND_FUNCTION("#__unw_getcontext")
109110
.text
110111

111112
#elif defined(__x86_64__)
113+
.att_syntax
112114

113115
#
114116
# extern int __unw_getcontext(unw_context_t* thread_state)

0 commit comments

Comments
 (0)