ARM机下编辑安装mysql5.7.38
操作系统:CentOS Linux release 7.5.1804 (AltArch)
make时报错
错误一:storage/innobase/handler/handler0alter.cc:9025:1: error: could not split insn

解决方案:
编辑CMakeLists.txt文件,添加红色字体部分
vim /opt/mysql-5.7.38/storage/innobase/CMakeLists.txt
# A GCC bug causes crash when compiling these files on ARM64 with -O1+
# Compile them with -O0 as a workaround.
IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
# Bug was fixed in GCC 5.2, so workaround only needed < 5.2
EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION)
IF(GCC_VERSION VERSION_LESS 5.2)
INCLUDE(${MYSQL_CMAKE_SCRIPT_DIR}/compile_flags.cmake)
ADD_COMPILE_FLAGS(
btr/btr0btr.cc
btr/btr0cur.cc
buf/buf0buf.cc
gis/gis0sea.cc
fts/fts0fts.cc
handler/handler0alter.cc
row/row0mysql.cc
srv/srv0srv.cc
COMPILE_FLAGS "-O0"
)
ENDIF()
ENDIF()
之后重新编辑即可。
错误二:
sql/mysqld.cc:1565:36: error: ‘prctl’ was not declared in this scope

解决方案:
cp /usr/include/sys/prctl.h /opt/mysql-5.7.38/include/
编辑mysqld.cc文件,添加红色字体部分
vim /opt/mysql-5.7.38/sql/mysqld.cc
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License, version 2.0, for more details.You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#include "mysqld.h"
#include "mysqld_daemon.h"
#include "prctl.h"
#include
#include
#include
#include
#include
#include
之后重新编辑即可。