48
48
#![ cfg( not( feature = "no-asm" ) ) ]
49
49
// We only define stack probing for these architectures today.
50
50
#![ cfg( any( target_arch = "x86_64" , target_arch = "x86" ) ) ]
51
- // We need to add .att_syntax for bootstraping the new global_asm!
52
- #![ allow( unknown_lints, bad_asm_style) ]
53
51
54
52
extern "C" {
55
53
pub fn __rust_probestack ( ) ;
@@ -65,7 +63,6 @@ macro_rules! define_rust_probestack {
65
63
( $body: expr) => {
66
64
concat!(
67
65
"
68
- .att_syntax
69
66
.pushsection .text.__rust_probestack
70
67
.globl __rust_probestack
71
68
.type __rust_probestack, @function
@@ -86,7 +83,6 @@ macro_rules! define_rust_probestack {
86
83
( $body: expr) => {
87
84
concat!(
88
85
"
89
- .att_syntax
90
86
.globl __rust_probestack
91
87
__rust_probestack:
92
88
" ,
@@ -102,7 +98,6 @@ macro_rules! define_rust_probestack {
102
98
( $body: expr) => {
103
99
concat!(
104
100
"
105
- .att_syntax
106
101
.globl ___rust_probestack
107
102
___rust_probestack:
108
103
" ,
@@ -117,7 +112,6 @@ macro_rules! define_rust_probestack {
117
112
( $body: expr) => {
118
113
concat!(
119
114
"
120
- .att_syntax
121
115
.globl ___rust_probestack
122
116
___rust_probestack:
123
117
" ,
@@ -137,8 +131,9 @@ macro_rules! define_rust_probestack {
137
131
target_arch = "x86_64" ,
138
132
not( all( target_env = "sgx" , target_vendor = "fortanix" ) )
139
133
) ) ]
140
- global_asm ! ( define_rust_probestack!(
141
- "
134
+ core:: arch:: global_asm!(
135
+ define_rust_probestack!(
136
+ "
142
137
.cfi_startproc
143
138
pushq %rbp
144
139
.cfi_adjust_cfa_offset 8
@@ -188,7 +183,9 @@ global_asm!(define_rust_probestack!(
188
183
ret
189
184
.cfi_endproc
190
185
"
191
- ) ) ;
186
+ ) ,
187
+ options( att_syntax)
188
+ ) ;
192
189
193
190
// This function is the same as above, except that some instructions are
194
191
// [manually patched for LVI].
@@ -198,8 +195,9 @@ global_asm!(define_rust_probestack!(
198
195
target_arch = "x86_64" ,
199
196
all( target_env = "sgx" , target_vendor = "fortanix" )
200
197
) ) ]
201
- global_asm ! ( define_rust_probestack!(
202
- "
198
+ core:: arch:: global_asm!(
199
+ define_rust_probestack!(
200
+ "
203
201
.cfi_startproc
204
202
pushq %rbp
205
203
.cfi_adjust_cfa_offset 8
@@ -251,16 +249,19 @@ global_asm!(define_rust_probestack!(
251
249
jmp *%r11
252
250
.cfi_endproc
253
251
"
254
- ) ) ;
252
+ ) ,
253
+ options( att_syntax)
254
+ ) ;
255
255
256
256
#[ cfg( all( target_arch = "x86" , not( target_os = "uefi" ) ) ) ]
257
257
// This is the same as x86_64 above, only translated for 32-bit sizes. Note
258
258
// that on Unix we're expected to restore everything as it was, this
259
259
// function basically can't tamper with anything.
260
260
//
261
261
// The ABI here is the same as x86_64, except everything is 32-bits large.
262
- global_asm ! ( define_rust_probestack!(
263
- "
262
+ core:: arch:: global_asm!(
263
+ define_rust_probestack!(
264
+ "
264
265
.cfi_startproc
265
266
push %ebp
266
267
.cfi_adjust_cfa_offset 4
@@ -291,7 +292,9 @@ global_asm!(define_rust_probestack!(
291
292
ret
292
293
.cfi_endproc
293
294
"
294
- ) ) ;
295
+ ) ,
296
+ options( att_syntax)
297
+ ) ;
295
298
296
299
#[ cfg( all( target_arch = "x86" , target_os = "uefi" ) ) ]
297
300
// UEFI target is windows like target. LLVM will do _chkstk things like windows.
@@ -304,8 +307,9 @@ global_asm!(define_rust_probestack!(
304
307
// MSVC x32's _chkstk and cygwin/mingw's _alloca adjust %esp themselves.
305
308
// MSVC x64's __chkstk and cygwin/mingw's ___chkstk_ms do not adjust %rsp
306
309
// themselves.
307
- global_asm ! ( define_rust_probestack!(
308
- "
310
+ core:: arch:: global_asm!(
311
+ define_rust_probestack!(
312
+ "
309
313
.cfi_startproc
310
314
push %ebp
311
315
.cfi_adjust_cfa_offset 4
@@ -341,4 +345,6 @@ global_asm!(define_rust_probestack!(
341
345
ret
342
346
.cfi_endproc
343
347
"
344
- ) ) ;
348
+ ) ,
349
+ options( att_syntax)
350
+ ) ;
0 commit comments