summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authorVladislav Vaintroub <wlad@mariadb.com>2021-06-06 22:22:03 +0200
committerVladislav Vaintroub <wlad@mariadb.com>2021-06-07 23:15:36 +0200
commit5ba4c4200ce1f9bce8c2fc1de5d97a131d3c2f37 (patch)
treee66b282a70dc2ae6ec3b376543dcd95dbfdf3fe4 /mysys
parent233590a48d78fb1c7e320c7131c4543c10a4face (diff)
downloadmariadb-git-5ba4c4200ce1f9bce8c2fc1de5d97a131d3c2f37.tar.gz
MDEV-25870 Windows - fix ARM64 cross-compilation
Diffstat (limited to 'mysys')
-rw-r--r--mysys/CMakeLists.txt2
-rw-r--r--mysys/my_delete.c5
-rw-r--r--mysys/stacktrace.c6
3 files changed, 9 insertions, 4 deletions
diff --git a/mysys/CMakeLists.txt b/mysys/CMakeLists.txt
index 5a4eeeba603..269369360f1 100644
--- a/mysys/CMakeLists.txt
+++ b/mysys/CMakeLists.txt
@@ -58,7 +58,7 @@ IF (WIN32)
my_win_popen.cc)
ENDIF()
-IF(MSVC)
+IF(MSVC_INTEL)
SET(MYSYS_SOURCES ${MYSYS_SOURCES} crc32/crc32_x86.c)
IF(CMAKE_SIZEOF_VOID_P EQUAL 8)
SET (MYSYS_SOURCES ${MYSYS_SOURCES} crc32/crc32c_amd64.cc)
diff --git a/mysys/my_delete.c b/mysys/my_delete.c
index b9b0e112077..d322f302ea7 100644
--- a/mysys/my_delete.c
+++ b/mysys/my_delete.c
@@ -80,7 +80,8 @@ int my_delete(const char *name, myf MyFlags)
a file to unique name.
Symbolic link are deleted without renaming. Directories are not deleted.
- */
+*/
+#include <my_rdtsc.h>
static int my_win_unlink(const char *name)
{
HANDLE handle= INVALID_HANDLE_VALUE;
@@ -166,7 +167,7 @@ static int my_win_unlink(const char *name)
goto error;
}
- tsc= __rdtsc();
+ tsc= my_timer_cycles();
my_snprintf(unique_filename,sizeof(unique_filename),"%s.%llx.deleted",
name, tsc);
if (!MoveFile(name, unique_filename))
diff --git a/mysys/stacktrace.c b/mysys/stacktrace.c
index 250d0bdbea2..844d8a0b28f 100644
--- a/mysys/stacktrace.c
+++ b/mysys/stacktrace.c
@@ -587,8 +587,12 @@ void my_print_stacktrace(uchar* unused1, ulong unused2, my_bool silent)
frame.AddrFrame.Offset= context.Rbp;
frame.AddrPC.Offset= context.Rip;
frame.AddrStack.Offset= context.Rsp;
+#elif defined(_M_ARM64)
+ machine= IMAGE_FILE_MACHINE_ARM64;
+ frame.AddrFrame.Offset= context.Fp;
+ frame.AddrPC.Offset= context.Pc;
+ frame.AddrStack.Offset= context.Sp;
#else
- /*There is currently no need to support IA64*/
#pragma error ("unsupported architecture")
#endif