Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
5ba4c420
Commit
5ba4c420
authored
Jun 06, 2021
by
Vladislav Vaintroub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-25870 Windows - fix ARM64 cross-compilation
parent
233590a4
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
45 additions
and
17 deletions
+45
-17
cmake/os/Windows.cmake
cmake/os/Windows.cmake
+8
-0
cmake/package_name.cmake
cmake/package_name.cmake
+4
-1
extra/wolfssl/CMakeLists.txt
extra/wolfssl/CMakeLists.txt
+2
-2
include/my_byteorder.h
include/my_byteorder.h
+2
-2
include/my_rdtsc.h
include/my_rdtsc.h
+3
-1
mysys/CMakeLists.txt
mysys/CMakeLists.txt
+1
-1
mysys/my_delete.c
mysys/my_delete.c
+3
-2
mysys/stacktrace.c
mysys/stacktrace.c
+5
-1
storage/innobase/handler/ha_innodb.cc
storage/innobase/handler/ha_innodb.cc
+1
-1
storage/innobase/include/univ.i
storage/innobase/include/univ.i
+13
-6
storage/rocksdb/CMakeLists.txt
storage/rocksdb/CMakeLists.txt
+3
-0
No files found.
cmake/os/Windows.cmake
View file @
5ba4c420
...
...
@@ -24,6 +24,14 @@ INCLUDE (CheckCSourceRuns)
INCLUDE
(
CheckSymbolExists
)
INCLUDE
(
CheckTypeSize
)
IF
(
MSVC
)
IF
(
CMAKE_CXX_COMPILER_ARCHITECTURE_ID STREQUAL ARM64
)
SET
(
MSVC_ARM64 1
)
SET
(
MSVC_INTEL 0
)
ELSE
()
SET
(
MSVC_INTEL 1
)
ENDIF
()
ENDIF
()
# avoid running system checks by using pre-cached check results
# system checks are expensive on VS since every tiny program is to be compiled in
...
...
cmake/package_name.cmake
View file @
5ba4c420
...
...
@@ -38,7 +38,10 @@ IF(NOT VERSION)
SET
(
NEED_DASH_BETWEEN_PLATFORM_AND_MACHINE 0
)
SET
(
DEFAULT_PLATFORM
"win"
)
IF
(
64BIT
)
STRING
(
TOLOWER
"
${
CMAKE_C_COMPILER_ARCHITECTURE_ID
}
"
DEFAULT_MACHINE
)
IF
(
NOT DEFAULT_MACHINE
)
SET
(
DEFAULT_MACHINE
"x64"
)
ENDIF
()
ELSE
()
SET
(
DEFAULT_MACHINE
"32"
)
ENDIF
()
...
...
extra/wolfssl/CMakeLists.txt
View file @
5ba4c420
IF
(
MSVC
)
IF
(
MSVC
_INTEL
)
PROJECT
(
wolfssl C ASM_MASM
)
ELSEIF
(
CMAKE_SYSTEM_PROCESSOR MATCHES
"x86_64|amd64"
)
PROJECT
(
wolfssl C ASM
)
...
...
@@ -7,7 +7,7 @@ ELSE()
ENDIF
()
IF
(
CMAKE_SIZEOF_VOID_P MATCHES 8
)
IF
(
MSVC
)
IF
(
MSVC
_INTEL
)
SET
(
WOLFSSL_INTELASM ON
)
SET
(
WOLFSSL_X86_64_BUILD 1
)
SET
(
HAVE_INTEL_RDSEED 1
)
...
...
include/my_byteorder.h
View file @
5ba4c420
...
...
@@ -31,10 +31,10 @@
format (low byte first). There are 'korr' (assume 'corrector') variants
for integer types, but 'get' (assume 'getter') for floating point types.
*/
#if (defined(__i386__) || defined(_
WIN32
)) && !defined(WITH_UBSAN)
#if (defined(__i386__) || defined(_
M_IX86
)) && !defined(WITH_UBSAN)
#define MY_BYTE_ORDER_ARCH_OPTIMIZED
#include "byte_order_generic_x86.h"
#elif
defined(__x86_64__
) && !defined(WITH_UBSAN)
#elif
(defined(__x86_64__) || defined (_M_X64)
) && !defined(WITH_UBSAN)
#include "byte_order_generic_x86_64.h"
#else
#include "byte_order_generic.h"
...
...
include/my_rdtsc.h
View file @
5ba4c420
...
...
@@ -130,8 +130,10 @@ static inline ulonglong my_timer_cycles(void)
{
# if __has_builtin(__builtin_readcyclecounter) && !defined (__aarch64__)
return
__builtin_readcyclecounter
();
# elif defined _
WIN32
|| defined __i386__ || defined __x86_64__
# elif defined _
M_IX86 || defined _M_X64
|| defined __i386__ || defined __x86_64__
return
__rdtsc
();
#elif defined _M_ARM64
return
_ReadStatusReg
(
ARM64_CNTVCT
);
# elif defined(__INTEL_COMPILER) && defined(__ia64__) && defined(HAVE_IA64INTRIN_H)
return
(
ulonglong
)
__getReg
(
_IA64_REG_AR_ITC
);
/* (3116) */
#elif defined(__GNUC__) && defined(__ia64__)
...
...
mysys/CMakeLists.txt
View file @
5ba4c420
...
...
@@ -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
)
...
...
mysys/my_delete.c
View file @
5ba4c420
...
...
@@ -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
))
...
...
mysys/stacktrace.c
View file @
5ba4c420
...
...
@@ -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
...
...
storage/innobase/handler/ha_innodb.cc
View file @
5ba4c420
...
...
@@ -2475,7 +2475,7 @@ __forceinline unsigned int nlz (ulonglong x)
return
(
unsigned
int
)
n
^
m
;
#endif
#elif defined(_M_ARM64)
return
_CountLeadingZeros
(
x
);
return
_CountLeadingZeros
64
(
x
);
#endif
}
#else
...
...
storage/innobase/include/univ.i
View file @
5ba4c420
...
...
@@ -487,14 +487,21 @@ it is read or written. */
#
define
UNIV_PREFETCH_RW
(
addr
)
((
void
)
0
)
#
endif
/* COMPILER_HINTS */
#
elif
defined
_WIN32
&
&
defined
COMPILER_HINTS
#
include
<
xmmintrin
.
h
>
#
elif
defined
_MSC_VER
&
&
defined
COMPILER_HINTS
#
define
UNIV_EXPECT
(
expr
,
value
)
(
expr
)
#
define
UNIV_LIKELY_NULL
(
expr
)
(
expr
)
// __MM_HINT_T0 - (temporal data)
// prefetch data into all levels of the cache hierarchy.
#
if
defined
_M_IX86
||
defined
_M_X64
// __MM_HINT_T0 - (temporal data)
// prefetch data into all levels of the cache hierarchy.
#
define
UNIV_PREFETCH_R
(
addr
)
_mm_prefetch
((
char
*
)
addr
,
_MM_HINT_T0
)
#
define
UNIV_PREFETCH_RW
(
addr
)
_mm_prefetch
((
char
*
)
addr
,
_MM_HINT_T0
)
#
elif
defined
_M_ARM64
#
define
UNIV_PREFETCH_R
(
addr
)
__prefetch
(
addr
)
#
define
UNIV_PREFETCH_RW
(
addr
)
__prefetch
(
addr
)
#
else
#
define
UNIV_PREFETCH_R
((
void
)
0
)
#
define
UNIV_PREFETCH_RW
(
addr
)
((
void
)
0
)
#
endif
#
else
/* Dummy versions of the macros */
#
define
UNIV_EXPECT
(
expr
,
value
)
(
expr
)
...
...
storage/rocksdb/CMakeLists.txt
View file @
5ba4c420
...
...
@@ -42,6 +42,9 @@ endif()
IF
(
WIN32 AND CMAKE_SIZEOF_VOID_P EQUAL 4
)
SKIP_ROCKSDB_PLUGIN
(
"32-Bit Windows are temporarily disabled"
)
ENDIF
()
IF
(
MSVC_ARM64
)
SKIP_ROCKSDB_PLUGIN
(
"Windows ARM64 not supported"
)
ENDIF
()
# This plugin needs recent C++ compilers (it is using C++11 features)
# Skip build for the old compilers
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment