|
| 1 | +diff --git a/Makefile b/Makefile |
| 2 | +index 97dc61d550..99b775c584 100644 |
| 3 | +--- a/Makefile |
| 4 | ++++ b/Makefile |
| 5 | +@@ -44,52 +44,11 @@ SHELL=/usr/bin/env bash |
| 6 | + IS_DARWIN := 0 |
| 7 | + IS_LINUX := 0 |
| 8 | + IS_FREEBSD := 0 |
| 9 | +-IS_WINDOWS := 0 |
| 10 | +-IS_AMD64 := 0 |
| 11 | ++IS_WINDOWS := 1 |
| 12 | ++IS_AMD64 := 1 |
| 13 | + IS_AARCH64 := 0 |
| 14 | + IS_RISCV64 := 0 |
| 15 | + |
| 16 | +-# Test Windows apart because it doesn't support `uname -s`. |
| 17 | +-ifeq ($(OS), Windows_NT) |
| 18 | +- # We can assume it will likely be in amd64. |
| 19 | +- IS_AMD64 := 1 |
| 20 | +- IS_WINDOWS := 1 |
| 21 | +-else |
| 22 | +- # Platform |
| 23 | +- uname := $(shell uname -s) |
| 24 | +- |
| 25 | +- ifeq ($(uname), Darwin) |
| 26 | +- IS_DARWIN := 1 |
| 27 | +- else ifeq ($(uname), Linux) |
| 28 | +- IS_LINUX := 1 |
| 29 | +- else ifeq ($(uname), FreeBSD) |
| 30 | +- IS_FREEBSD := 1 |
| 31 | +- else |
| 32 | +- # We use spaces instead of tabs to indent `$(error)` |
| 33 | +- # otherwise it's considered as a command outside a |
| 34 | +- # target and it will fail. |
| 35 | +- $(error Unrecognized platform, expect `Darwin`, `Linux` or `Windows_NT`) |
| 36 | +- endif |
| 37 | +- |
| 38 | +- # Architecture |
| 39 | +- uname := $(shell uname -m) |
| 40 | +- |
| 41 | +- ifneq (, $(filter $(uname), x86_64 amd64)) |
| 42 | +- IS_AMD64 := 1 |
| 43 | +- else ifneq (, $(filter $(uname), aarch64 arm64)) |
| 44 | +- IS_AARCH64 := 1 |
| 45 | +- else ifneq (, $(filter $(uname), riscv64)) |
| 46 | +- IS_RISCV64 := 1 |
| 47 | +- else |
| 48 | +- # We use spaces instead of tabs to indent `$(error)` |
| 49 | +- # otherwise it's considered as a command outside a |
| 50 | +- # target and it will fail. |
| 51 | +- $(error Unrecognized architecture, expect `x86_64`, `aarch64`, `arm64`, 'riscv64') |
| 52 | +- endif |
| 53 | +- |
| 54 | +- # Libc |
| 55 | +- LIBC ?= $(shell ldd 2>&1 | grep -o musl | head -n1) |
| 56 | +-endif |
| 57 | + |
| 58 | + |
| 59 | + ##### |
| 60 | +diff --git a/lib/vm/src/probestack.rs b/lib/vm/src/probestack.rs |
| 61 | +index fd78d8d0b2..814ddf9c20 100644 |
| 62 | +--- a/lib/vm/src/probestack.rs |
| 63 | ++++ b/lib/vm/src/probestack.rs |
| 64 | +@@ -42,10 +42,10 @@ cfg_if::cfg_if! { |
| 65 | + // ___chkstk (note the triple underscore) is implemented in compiler-builtins/src/x86_64.rs |
| 66 | + // by the Rust compiler for the MinGW target |
| 67 | + #[cfg(all(target_os = "windows", target_env = "gnu"))] |
| 68 | +- pub fn ___chkstk(); |
| 69 | ++ pub fn ___chkstk_ms(); |
| 70 | + } |
| 71 | + /// The probestack for Windows when compiled with GNU |
| 72 | +- pub const PROBESTACK: unsafe extern "C" fn() = ___chkstk; |
| 73 | ++ pub const PROBESTACK: unsafe extern "C" fn() = ___chkstk_ms; |
| 74 | + } else if #[cfg(not(any(target_arch = "x86_64", target_arch = "x86")))] { |
| 75 | + // As per |
| 76 | + // https://github.com/rust-lang/compiler-builtins/blob/cae3e6ea23739166504f9f9fb50ec070097979d4/src/probestack.rs#L39, |
0 commit comments