[packages/mysql/MYSQL_5_0] use patch to fix build with gcc 7.x permissive errors

glen glen at pld-linux.org
Fri Sep 15 08:49:20 CEST 2017


commit 648df820a1ba17f0599499b29ca7e90d0c4d74cd
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Fri Sep 15 00:33:49 2017 +0300

    use patch to fix build with gcc 7.x permissive errors
    
    https://git.busybox.net/buildroot/commit/?id=94bad4fbf5759302a9f8f33267989d543f3a1167

 gcc7.patch | 41 +++++++++++++++++++++++++++++++++++++++++
 mysql.spec |  4 +++-
 2 files changed, 44 insertions(+), 1 deletion(-)
---
diff --git a/mysql.spec b/mysql.spec
index 0b1f216..4143ad6 100644
--- a/mysql.spec
+++ b/mysql.spec
@@ -69,6 +69,7 @@ Patch13:	%{name}-bug-34192.patch
 Patch14:	%{name}-bug-16470.patch
 Patch15:	%{name}-system-users.patch
 Patch16:	%{name}-errorlog-no-rename.patch
+Patch17:	gcc7.patch
 Patch18:	%{name}-xtrabackup.patch
 Patch19:	%{name}hotcopy-5.0-5.5.patch
 Patch20:	x32.patch
@@ -547,6 +548,7 @@ mv sphinx-*/mysqlse sql/sphinx
 %patch14 -p1
 %patch15 -p1
 %patch16 -p1
+%patch17 -p1
 %{?with_xtrabackup:%patch18 -p1}
 %patch19 -p1
 %patch20 -p1
@@ -592,7 +594,7 @@ mv sphinx-*/mysqlse sql/sphinx
 %{__autoconf}
 
 # The compiler flags are as per their "official" spec ;)
-CXXFLAGS="%{rpmcflags} -fno-implicit-templates -fno-exceptions -fno-rtti -fpermissive"
+CXXFLAGS="%{rpmcflags} -fno-implicit-templates -fno-exceptions -fno-rtti"
 CFLAGS="%{rpmcflags}"
 CPPFLAGS="%{rpmcppflags} -Wno-narrowing"
 
diff --git a/gcc7.patch b/gcc7.patch
new file mode 100644
index 0000000..1941976
--- /dev/null
+++ b/gcc7.patch
@@ -0,0 +1,41 @@
+Fix gcc7 compile
+
+mysql.cc: In function 'void build_completion_hash(bool, bool)':
+mysql.cc:2687:37: error: invalid conversion from 'char' to 'char*' [-fpermissive]
+       field_names[i][num_fields*2]= '\0';
+                                     ^~~~
+
+Patch was partly backported from upstream commit:
+https://github.com/mysql/mysql-server/commit/ae21683d980d5fe9e39bd0193827ea3604256eb9
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls at t-online.de>
+Signed-off-by: Elan Ruusamäe <glen at pld-linux.org>
+
+--- mysql-5.1.73.org/client/mysql.cc	2013-11-04 19:52:27.000000000 +0100
++++ mysql-5.1.73/client/mysql.cc	2017-05-13 19:52:10.125101101 +0200
+@@ -2684,7 +2684,7 @@
+         mysql_free_result(fields);
+         break;
+       }
+-      field_names[i][num_fields*2]= '\0';
++      field_names[i][num_fields*2]= NULL;
+       j=0;
+       while ((sql_field=mysql_fetch_field(fields)))
+       {
+--- mysql-5.0.96/server-tools/instance-manager/instance_map.cc	2017-09-15 00:50:42.031193601 +0300
++++ mysql-5.0.96/server-tools/instance-manager/instance_map.cc	2017-09-15 09:41:27.301368452 +0300
+@@ -305,12 +305,12 @@
+              Options::config_file);
+ 
+     argv_options[1]= defaults_file_arg;
+-    argv_options[2]= '\0';
++    argv_options[2]= NULL;
+ 
+     argc= 2;
+   }
+   else
+-    argv_options[1]= '\0';
++    argv_options[1]= NULL;
+ 
+   /*
+     If the routine failed, we'll simply fallback to defaults in
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/mysql.git/commitdiff/648df820a1ba17f0599499b29ca7e90d0c4d74cd



More information about the pld-cvs-commit mailing list