Skip to content

Commit 84e6830

Browse files
committed
Emit unwind info in rustrt assembly files on Windows.
1 parent 9e7f1fc commit 84e6830

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/rt/arch/i386/ccall.S

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
.text
1414

15-
#if defined(__APPLE__) || defined(_WIN32)
15+
#if defined(__APPLE__) || defined(__WIN32__)
1616
.globl ___morestack
1717
___morestack:
1818
#else
@@ -21,20 +21,20 @@ ___morestack:
2121
__morestack:
2222
#endif
2323

24-
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
24+
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__WIN32__)
2525
.cfi_startproc
2626
#endif
2727

2828
pushl %ebp
2929

30-
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
30+
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__WIN32__)
3131
.cfi_def_cfa_offset 8
3232
.cfi_offset %ebp, -8
3333
#endif
3434

3535
movl %esp,%ebp // save esp
3636

37-
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
37+
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__WIN32__)
3838
.cfi_def_cfa_register %ebp
3939
#endif
4040

@@ -47,6 +47,6 @@ __morestack:
4747

4848
ret
4949

50-
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
50+
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__WIN32__)
5151
.cfi_endproc
5252
#endif

src/rt/arch/i386/morestack.S

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@
9797
#endif
9898
.globl MORESTACK
9999

100-
// FIXME: What about _WIN32?
100+
// FIXME: What about __WIN32__?
101101
#if defined(__linux__) || defined(__FreeBSD__)
102102
.hidden MORESTACK
103103
#else
@@ -111,7 +111,7 @@
111111
#endif
112112

113113
MORESTACK:
114-
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
114+
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__WIN32__)
115115
.cfi_startproc
116116
#endif
117117

@@ -130,15 +130,15 @@ MORESTACK:
130130
// __morestack, and an extra return address.
131131

132132
pushl %ebp
133-
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
133+
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__WIN32__)
134134
// The CFA is 20 bytes above the register that it is
135135
// associated with for this frame (which will be %ebp)
136136
.cfi_def_cfa_offset 20
137137
// %ebp is -20 bytes from the CFA
138138
.cfi_offset %ebp, -20
139139
#endif
140140
movl %esp, %ebp
141-
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
141+
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__WIN32__)
142142
// Calculate the CFA as an offset from %ebp
143143
.cfi_def_cfa_register %ebp
144144
#endif
@@ -232,7 +232,7 @@ MORESTACK:
232232

233233
jmpl *%eax
234234

235-
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
235+
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__WIN32__)
236236
.cfi_endproc
237237
#endif
238238

0 commit comments

Comments
 (0)