Skip to content

Commit ae9169f

Browse files
committed
Another 64-bit MinGW attempt
1 parent 22e5937 commit ae9169f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/arch/x86_64.S

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ GLOBAL(__stacker_morestack_stack_limit):
4242

4343
GLOBAL(__stacker_set_morestack_stack_limit):
4444
ret
45+
46+
GLOBAL(__stacker_get_tib_64):
47+
mov %gs:0x30, %rax
48+
ret
4549
#else
4650
#error "unsupported arch"
4751
#endif

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ cfg_if! {
145145
fn get_tib_address() -> *const usize;
146146
}
147147
#[cfg(target_pointer_width = "64")]
148-
#[link(name = "ntdll")]
149148
extern "system" {
150-
#[link_name = "NtCurrentTeb"]
149+
#[cfg_attr(target_env = "msvc", link_name = "NtCurrentTeb")]
150+
#[cfg_attr(target_env = "gnu", link_name = "__stacker_get_tib_64")]
151151
fn get_tib_address() -> *const usize;
152152
}
153153
// https://en.wikipedia.org/wiki/Win32_Thread_Information_Block for

0 commit comments

Comments
 (0)