Bug #83409 Simplify 5.6 build in 5.7+ spec file
Submitted: 17 Oct 2016 13:39 Modified: 16 Nov 2016 16:43
Reporter: Alexey Kopytov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Packaging Severity:S3 (Non-critical)
Version:5.7 OS:Any
Assigned to: Terje Røsten CPU Architecture:Any

[17 Oct 2016 13:39] Alexey Kopytov
Description:
The bundled libevent library in the MySQL source tree uses deprecated
epoll_create() and epoll_wait() calls which are not available on newer
CPU architectures. This problem has been fixed in 5.7 with the following
commit:

commit 9e3d5f1ab45440373c90196ee9525ab1bd3624f5
Author: Lukasz Kotula <lukasz.kotula@oracle.com>
Date:   Tue Mar 1 19:02:55 2016 +0100

    Bug#22841977 X PLUGIN BREAKS BUILD ON ARM64 (AARCH64)
    
    Description: On arm64 there are multiple definitions for syscalls deprecated
    
    Solution: Application instead using deprecated __NR_epoll_wait will use
    __NR_epoll_pwait (if its defined in unistd.h).
    
    Reviewed-by: Andrzej Religa <andrzej.religa@oracle.org>
    Reviewed-by: Tor Didriksen <tor.didriksen@oracle.com>
    
    RB: 11970

The problem, however, still exists in 5.6. Which becomes a problem when
building 5.6 with bundled libevent on AArch64 (and possibly other
architectures).

This is a request to backport the bugfix to 5.6.

How to repeat:
Compare libevent/epoll_sub.c in 5.6 and 5.7.
[18 Oct 2016 4:46] MySQL Verification Team
Hello Alexey,

Thank you for the report and feedback.

Thanks,
Umesh
[18 Oct 2016 7:30] Ståle Deraas
Posted by developer:
 
Alexey, is it very important to backport this to 5.6? We are a bit reluctant to do this on an old GA-version.
[18 Oct 2016 7:44] Alexey Kopytov
Hi Ståle,

I hit this bug bug when building a MySQL _5.7_ RPM package on an AArch64 machine. Unlike Debian/Ubuntu packaging, the MySQL 5.7 RPM spec file also compiles a MySQL 5.6.31 tarball to build compatibility client libraries (i.e. the mysql-community-libs-compat RPM).

Since my goal is to eventually make upstream MySQL fully functional on AArch64 in all aspects, including packaging, it would be nice to either have that fix backported to 5.6, or maintained separately as an RPM-specific patch in the 5.7 tree. In both cases, I wouldn't have to maintain the fix separately from upstream MySQL.

Thanks,
Alexey.
[18 Oct 2016 14:12] Terje Røsten
Hi Alexey!

Seems like we are a bit too strict here, we only use libmysqlclient from 5.6 any way. The following patch should fix the issue for now:

diff --git a/packaging/rpm-oel/mysql.spec.in b/packaging/rpm-oel/mysql.spec.in
index 2442798..9dd7b8c 100644
--- a/packaging/rpm-oel/mysql.spec.in
+++ b/packaging/rpm-oel/mysql.spec.in
@@ -654,7 +654,7 @@ fi
     -DCMAKE_BUILD_TYPE=RelWithDebInfo \
     -DCMAKE_C_FLAGS="%{optflags}" \
     -DCMAKE_CXX_FLAGS="%{optflags}" \
-    -DWITH_INNODB_MEMCACHED=1 \
+    -DWITH_INNODB_MEMCACHED=0 \
     -DINSTALL_LIBDIR="%{_lib}/mysql" \
     -DINSTALL_PLUGINDIR="%{_lib}/mysql/plugin" \
     -DINSTALL_SQLBENCHDIR=share \

We can even simplify more, hope to include this in future release.
[18 Oct 2016 14:33] Alexey Kopytov
Terje, thanks, that is another way to fix 5.7 packaging which I didn't
think of. It would not fix the actual MySQL 5.6 builds on AArch64, but
that's a less important problem, at least for me.
[16 Nov 2016 16:43] Paul DuBois
Posted by developer:
 
Noted in 5.7.17, 8.0.1 changelogs.

Information about building MySQL 5.6 compatibility libraries in the
MySQL 5.7 and higher .spec file is needed only for building
libmysqlclient and libmysqld. Information about building the InnoDB
memcached plugin was removed.