51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

arm架构编译MySQL5.5报错

当前arm、aarch64环境,系统anolis8,理论适用于其它ARM系统,报错内容如下
mysql-5.5.62/sql-common/client_plugin.c: In function 'mysql_client_plugin_init': mysql-5.5.62/sql-common/client_plugin.c:252:40: error: incompatible type for argument 5 of 'add_plugin' add_plugin(&mysql, *builtin, 0, 0, 0); ^ mysql-5.5.62/sql-common/client_plugin.c:121:30: note: expected 'va_list' {aka '__va_list'} but argument is of type 'int' int argc, va_list args) ~~~~~~~~^~~~ mysql-5.5.62/sql-common/client_plugin.c: In function 'mysql_client_register_plugin': mysql-5.5.62/sql-common/client_plugin.c:310:45: error: incompatible type for argument 5 of 'add_plugin' plugin= add_plugin(mysql, plugin, 0, 0, 0); ^

|-------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 1 2 3 4 5 6 7 8 9 10 11 | mysql-5.5.62/sql-common/client_plugin.c: In function 'mysql_client_plugin_init': mysql-5.5.62/sql-common/client_plugin.c:252:40: error: incompatible type for argument 5 of 'add_plugin' add_plugin(&mysql, *builtin, 0, 0, 0); ^ mysql-5.5.62/sql-common/client_plugin.c:121:30: note: expected 'va_list' {aka '__va_list'} but argument is of type 'int' int argc, va_list args) ~~~~~~~~^~~~ mysql-5.5.62/sql-common/client_plugin.c: In function 'mysql_client_register_plugin': mysql-5.5.62/sql-common/client_plugin.c:310:45: error: incompatible type for argument 5 of 'add_plugin' plugin= add_plugin(mysql, plugin, 0, 0, 0); ^ |

问题原因

这个错误是由于在ARM架构上,va_list类型和int类型不兼容造成的。在这些函数调用中,参数类型需要进行适当的调整。

解决办法

已经有补丁来解决此问题,下载补丁

https://down.whsir.com/downloads/mysql-5.5-fix-arm-client_plugin.patch

在MySQL源代码目录导入补丁
patch -p1 < mysql-5.5-fix-arm-client_plugin.patch

|---|----------------------------------------------------| | 1 | patch -p1 < mysql-5.5-fix-arm-client_plugin.patch |

运行上述命令后,应该会看到类似如下的输出,表示补丁应用成功

patching file sql-common/client_plugin.c

make clean后重新编译即可

赞(0)
未经允许不得转载:工具盒子 » arm架构编译MySQL5.5报错