• ARM机下编辑安装mysql错误处理


     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

    之后重新编辑即可。 

  • 相关阅读:
    《穿越时空的git》之创建版本库和常用命令操作
    【华为OD机试真题 python】最大花费金额 【2022 Q4 | 100分】
    Maven-入门
    100个Python实战项目(十二)Python 并发图像下载器
    Java EasyExcel带格式多线程导出百万数据
    BootStrap日历插件
    卡方检验简介
    offset 百度地图 bm-info-window bm-marker 弹窗偏移量
    学习c#的第十三天
    普通用户使用spark的client无法更新Ranger策略
  • 原文地址:https://blog.csdn.net/Cookie_1030/article/details/126018632