Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stack unwinding for 32 bit Windows builds #8596

Closed
wants to merge 8 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/rt/arch/i386/ccall.S
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@

.text

#if defined(__APPLE__) || defined(_WIN32)
#if defined(__APPLE__) || defined(__WIN32__)
.globl ___morestack
___morestack:
#else
@@ -21,20 +21,20 @@ ___morestack:
__morestack:
#endif

#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__WIN32__)
.cfi_startproc
#endif

pushl %ebp

#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__WIN32__)
.cfi_def_cfa_offset 8
.cfi_offset %ebp, -8
#endif

movl %esp,%ebp // save esp

#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__WIN32__)
.cfi_def_cfa_register %ebp
#endif

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

ret

#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__WIN32__)
.cfi_endproc
#endif
10 changes: 5 additions & 5 deletions src/rt/arch/i386/morestack.S
Original file line number Diff line number Diff line change
@@ -97,7 +97,7 @@
#endif
.globl MORESTACK

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

MORESTACK:
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__WIN32__)
.cfi_startproc
#endif

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

pushl %ebp
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__WIN32__)
// The CFA is 20 bytes above the register that it is
// associated with for this frame (which will be %ebp)
.cfi_def_cfa_offset 20
// %ebp is -20 bytes from the CFA
.cfi_offset %ebp, -20
#endif
movl %esp, %ebp
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__WIN32__)
// Calculate the CFA as an offset from %ebp
.cfi_def_cfa_register %ebp
#endif
@@ -232,7 +232,7 @@ MORESTACK:

jmpl *%eax

#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__)
#if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) || defined(__WIN32__)
.cfi_endproc
#endif