[build] Prepare for Windows arm64 builds (#5390)

Builds aren't actually enabled yet due to a bug in Gradle.
This commit is contained in:
Thad House
2023-07-24 22:46:25 -07:00
committed by GitHub
parent 552f4b76b5
commit b8cdf97621
19 changed files with 636 additions and 1809 deletions

View File

@@ -1,21 +1,21 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: PJ Reiniger <pj.reiniger@gmail.com>
Date: Tue, 24 May 2022 01:24:31 -0400
Subject: [PATCH 3/3] Add advapi pragma
From: Thad House <thadhouse1@gmail.com>
Date: Sat, 22 Jul 2023 13:03:13 -0700
Subject: [PATCH] Add advapi pragma
---
Main/StackWalker/StackWalker.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/Main/StackWalker/StackWalker.cpp b/Main/StackWalker/StackWalker.cpp
index 48c7c57c439dd8feb7ea88fda17d68a4bbbb3d68..6f0fbf28a61f13b796edee56c37737bf14f5a933 100644
index 89545f8612d0d099d48fcf4184a2f2a30cf8577f..b2bcbaa447c5db1a3bcc155fb317ebc8a8050e79 100644
--- a/Main/StackWalker/StackWalker.cpp
+++ b/Main/StackWalker/StackWalker.cpp
@@ -88,6 +88,7 @@
#include <stdlib.h>
#include <tchar.h>
@@ -91,6 +91,7 @@
#include <new>
#pragma comment(lib, "version.lib") // for "VerQueryValue"
+#pragma comment(lib, "Advapi32.lib") // for "GetUserName"
#pragma warning(disable : 4826)
#ifdef UNICODE
#if _MSC_VER >= 1900

File diff suppressed because it is too large Load Diff

View File

@@ -1,79 +0,0 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: PJ Reiniger <pj.reiniger@gmail.com>
Date: Mon, 23 May 2022 00:06:45 -0400
Subject: [PATCH 2/3] Remove _M_IX86 checks
---
Main/StackWalker/StackWalker.h | 52 ----------------------------------
1 file changed, 52 deletions(-)
diff --git a/Main/StackWalker/StackWalker.h b/Main/StackWalker/StackWalker.h
index 03efcecf61638f78679e53c5db8ae6f1bc790dda..89be951624836f4cfaf37d713267dce855287ab9 100644
--- a/Main/StackWalker/StackWalker.h
+++ b/Main/StackWalker/StackWalker.h
@@ -179,57 +179,6 @@ protected:
friend StackWalkerInternal;
}; // class StackWalker
-// The "ugly" assembler-implementation is needed for systems before XP
-// If you have a new PSDK and you only compile for XP and later, then you can use
-// the "RtlCaptureContext"
-// Currently there is no define which determines the PSDK-Version...
-// So we just use the compiler-version (and assumes that the PSDK is
-// the one which was installed by the VS-IDE)
-
-// INFO: If you want, you can use the RtlCaptureContext if you only target XP and later...
-// But I currently use it in x64/IA64 environments...
-//#if defined(_M_IX86) && (_WIN32_WINNT <= 0x0500) && (_MSC_VER < 1400)
-
-#if defined(_M_IX86)
-#ifdef CURRENT_THREAD_VIA_EXCEPTION
-// TODO: The following is not a "good" implementation,
-// because the callstack is only valid in the "__except" block...
-#define GET_CURRENT_CONTEXT_STACKWALKER_CODEPLEX(c, contextFlags) \
- do \
- { \
- memset(&c, 0, sizeof(CONTEXT)); \
- EXCEPTION_POINTERS* pExp = NULL; \
- __try \
- { \
- throw 0; \
- } \
- __except (((pExp = GetExceptionInformation()) ? EXCEPTION_EXECUTE_HANDLER \
- : EXCEPTION_EXECUTE_HANDLER)) \
- { \
- } \
- if (pExp != NULL) \
- memcpy(&c, pExp->ContextRecord, sizeof(CONTEXT)); \
- c.ContextFlags = contextFlags; \
- } while (0);
-#else
-// clang-format off
-// The following should be enough for walking the callstack...
-#define GET_CURRENT_CONTEXT_STACKWALKER_CODEPLEX(c, contextFlags) \
- do \
- { \
- memset(&c, 0, sizeof(CONTEXT)); \
- c.ContextFlags = contextFlags; \
- __asm call x \
- __asm x: pop eax \
- __asm mov c.Eip, eax \
- __asm mov c.Ebp, ebp \
- __asm mov c.Esp, esp \
- } while (0)
-// clang-format on
-#endif
-
-#else
-
// The following is defined for x86 (XP and higher), x64 and IA64:
#define GET_CURRENT_CONTEXT_STACKWALKER_CODEPLEX(c, contextFlags) \
do \
@@ -238,7 +187,6 @@ protected:
c.ContextFlags = contextFlags; \
RtlCaptureContext(&c); \
} while (0);
-#endif
#endif //defined(_MSC_VER)