diff -uprN -x build -x comp_sql mysql-5.7.27_orig/CMakeLists.txt mysql-5.7.27/CMakeLists.txt --- mysql-5.7.27_orig/CMakeLists.txt 2019-06-10 22:43:20.000000000 +0800 +++ mysql-5.7.27/CMakeLists.txt 2019-08-28 09:08:51.947233400 +0800 @@ -43,7 +43,33 @@ IF(CMAKE_VERSION VERSION_EQUAL "3.0.0" O ENDIF() MESSAGE(STATUS "Running cmake version ${CMAKE_VERSION}") +if(PLAT_ARM64) + # this one is important + SET(CMAKE_SYSTEM_NAME Linux) + #this one not so much + SET(CMAKE_SYSTEM_VERSION 1) + # this is install root directory + SET(CMAKE_INSTALL_PREFIX /usr) + + # specify the cross compiler + SET(CMAKE_C_COMPILER aarch64-linux-gnu-gcc) + SET(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++) + SET(CMAKE_STRIP aarch64-fsl-linux-strip) + + # specify the cross compile and link flags + set(CMAKE_C_FLAGS "--sysroot=$ENV{SDKTARGETSYSROOT}") + set(CMAKE_SHARED_LINKER_FLAGS "--sysroot=$ENV{SDKTARGETSYSROOT}") + SET(CMAKE_LIBRARY_PATH $ENV{SDKTARGETSYSROOT}/usr/lib) + # where is the target environment + SET(CMAKE_FIND_ROOT_PATH ${SDKTARGETSYSROOT}) + + # search for programs in the build host directories + SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + # for libraries and headers in the target directories + SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +endif() # Will set GIT_EXECUTABLE and GIT_FOUND FIND_PACKAGE(Git) diff -uprN -x build -x comp_sql mysql-5.7.27_orig/storage/innobase/lock/lock0lock.cc mysql-5.7.27/storage/innobase/lock/lock0lock.cc --- mysql-5.7.27_orig/storage/innobase/lock/lock0lock.cc 2019-06-10 22:43:20.000000000 +0800 +++ mysql-5.7.27/storage/innobase/lock/lock0lock.cc 2019-08-28 09:29:44.927757019 +0800 @@ -1647,7 +1647,7 @@ RecLock::mark_trx_for_rollback(trx_t* tr bool cas; os_thread_id_t thread_id = os_thread_get_curr_id(); - cas = os_compare_and_swap_thread_id(&trx->killed_by, 0, thread_id); + cas = os_compare_and_swap_lint(&trx->killed_by, 0, thread_id); ut_a(cas); diff -uprN -x build -x comp_sql mysql-5.7.27_orig/storage/innobase/trx/trx0trx.cc mysql-5.7.27/storage/innobase/trx/trx0trx.cc --- mysql-5.7.27_orig/storage/innobase/trx/trx0trx.cc 2019-06-10 22:43:20.000000000 +0800 +++ mysql-5.7.27/storage/innobase/trx/trx0trx.cc 2019-08-28 09:33:18.500084963 +0800 @@ -193,7 +193,7 @@ trx_init( if (!TrxInInnoDB::is_async_rollback(trx)) { os_thread_id_t thread_id = trx->killed_by; - os_compare_and_swap_thread_id(&trx->killed_by, thread_id, 0); + os_compare_and_swap_uint32(&trx->killed_by, thread_id, 0); /* Note: Do not set to 0, the ref count is decremented inside the TrxInInnoDB() destructor. We only need to clear the flags. */ @@ -3381,7 +3381,7 @@ trx_kill_blocking(trx_t* trx) ut_ad(victim_trx->version == version); os_thread_id_t thread_id = victim_trx->killed_by; - os_compare_and_swap_thread_id(&victim_trx->killed_by, + os_compare_and_swap_uint32(&victim_trx->killed_by, thread_id, 0); victim_trx->in_innodb &= TRX_FORCE_ROLLBACK_MASK;