Bug #89428 8.0.4rc build error on Centos 7 using gcc 7.2 and binutils 2.2x
Submitted: 26 Jan 2018 5:11 Modified: 1 Feb 2018 22:44
Reporter: Roel Van de Paar Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Compiling Severity:S1 (Critical)
Version:8.0.4rc OS:Any
Assigned to: CPU Architecture:Any

[26 Jan 2018 5:11] Roel Van de Paar
Description:
[ 35%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/fts/fts0sql.cc.o
[ 35%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/fts/fts0tlex.cc.o
[ 35%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/gis/gis0geo.cc.o
[ 35%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/gis/gis0rtree.cc.o
[ 35%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/gis/gis0sea.cc.o
In file included from /git/MS-8.0.4rc_dbg/storage/innobase/include/ut0ut.ic:36:0,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/ut0ut.h:583,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/ut0new.h:144,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/sync0types.h:41,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/univ.i:593,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/fsp0fsp.h:37,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/gis/gis0sea.cc:36:
/git/MS-8.0.4rc_dbg/storage/innobase/gis/gis0sea.cc: In function ‘void rtr_copy_buf(matched_rec_t*, const buf_block_t*)’:
/git/MS-8.0.4rc_dbg/storage/innobase/gis/gis0sea.cc:1599:69: error: use of deleted function ‘rw_lock_t::rw_lock_t(const rw_lock_t&)’
  ut_d(new (&matches->block.debug_latch) rw_lock_t(block->debug_latch));
                                                                     ^
/git/MS-8.0.4rc_dbg/storage/innobase/include/ut0dbg.h:68:20: note: in definition of macro ‘ut_d’
 #define ut_d(EXPR) EXPR
                    ^~~~
In file included from /git/MS-8.0.4rc_dbg/storage/innobase/include/mtr0types.h:37:0,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/mach0data.h:41,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/ut0mem.ic:35,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/ut0mem.h:154,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/mem0mem.h:38,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/dyn0buf.h:39,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/log0log.h:45,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/fsp0file.h:38,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/fsp0space.h:38,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/fsp0fsp.h:39,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/gis/gis0sea.cc:36:
/git/MS-8.0.4rc_dbg/storage/innobase/include/sync0rw.h:658:8: note: ‘rw_lock_t::rw_lock_t(const rw_lock_t&)’ is implicitly deleted because the default definition would be ill-formed:
 struct rw_lock_t
        ^~~~~~~~~
/git/MS-8.0.4rc_dbg/storage/innobase/include/sync0rw.h:658:8: error: use of deleted function ‘PolicyMutex<TTASEventMutex<GenericPolicy> >::PolicyMutex(const PolicyMutex<TTASEventMutex<GenericPolicy> >&)’
In file included from /git/MS-8.0.4rc_dbg/storage/innobase/include/ut0mutex.h:66:0,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/ut0mem.h:40,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/mem0mem.h:38,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/dyn0buf.h:39,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/log0log.h:45,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/fsp0file.h:38,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/fsp0space.h:38,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/fsp0fsp.h:39,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/gis/gis0sea.cc:36:
/git/MS-8.0.4rc_dbg/storage/innobase/include/ib0mutex.h:932:8: note: ‘PolicyMutex<TTASEventMutex<GenericPolicy> >::PolicyMutex(const PolicyMutex<TTASEventMutex<GenericPolicy> >&)’ is implicitly deleted because the default definition would be ill-formed:
 struct PolicyMutex
        ^~~~~~~~~~~
/git/MS-8.0.4rc_dbg/storage/innobase/include/ib0mutex.h:932:8: error: ‘TTASEventMutex<Policy>::TTASEventMutex(const TTASEventMutex<Policy>&) [with Policy = GenericPolicy]’ is private within this context
/git/MS-8.0.4rc_dbg/storage/innobase/include/ib0mutex.h:911:2: note: declared private here
  TTASEventMutex(const TTASEventMutex&);
  ^~~~~~~~~~~~~~
make[2]: *** [storage/innobase/CMakeFiles/innobase.dir/gis/gis0sea.cc.o] Error 1
make[1]: *** [storage/innobase/CMakeFiles/innobase.dir/all] Error 2
make: *** [all] Error 2

How to repeat:
Centos 7.4.1708 x64, gcc 7.2, binutils 2.2x(2.28/2.29)

git clone --recursive --depth=1 https://github.com/mysql/mysql-server.git -b 8.0 MS-8.0.4rc 
cp -R MS-8.0.4rc MS-8.0.4rc_dbg
cd MS-8.0.4rc_dbg
mkdir /tmp/boost1
cmake . -DCMAKE_BUILD_TYPE=Debug -DWITH_SSL=system -DBUILD_CONFIG=mysql_release -DFEATURE_SET=community -DDEBUG_EXTNAME=OFF -DENABLE_DOWNLOADS=1 -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/tmp/boost1 -DENABLE_DTRACE=0 -DWITH_PERFSCHEMA_STORAGE_ENGINE=1 -DWITH_ZLIB=bundled

-DWITH_ZLIB=bundled is to prevent bug 89373.

Note; Ubuntu 17.10 with same gcc and binutils version does not fail.
[26 Jan 2018 6:11] Roel Van de Paar
Happens with gcc 6 also

bash-4.2$ gcc --version
gcc (GCC) 6.3.1 20170216 (Red Hat 6.3.1-3)

bash-4.2$ ld --version
GNU ld version 2.27-12.el7.1

[ 35%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/gis/gis0rtree.cc.o
[ 35%] Building CXX object storage/innobase/CMakeFiles/innobase.dir/gis/gis0sea.cc.o
In file included from /git/MS-8.0.4rc_dbg/storage/innobase/include/ut0ut.ic:36:0,
                 from /git/MS-8.0.4rc_dbg/storage/innobase/include/ut0ut.h:583,
...
[26 Jan 2018 9:05] Roel Van de Paar
Same with gcc 5.3.1 binutils 2.25 on Centos 7

bash-4.2$ gcc --version
gcc (GCC) 5.3.1 20160406 (Red Hat 5.3.1-6)

bash-4.2$ ld --version
GNU ld version 2.25.1-10.el7
[31 Jan 2018 4:21] MySQL Verification Team
Hello Roel,

Thank you for the report and feedback.
I tried to reproduced on freshly built centOS7 with gcc7.2/binutils-2.25* but not seeing the issue. Anything else required to trigger this issue? Joining the build log shortly.

Thanks,
Umesh
[31 Jan 2018 4:22] MySQL Verification Team
8.0.4-rc build details on CentOS7

Attachment: 89428_8.0.4-rc.build (application/octet-stream, text), 312.43 KiB.

[31 Jan 2018 19:39] Roel Van de Paar
Umesh can you please try with binutils 2.29 and/or 2.28
[1 Feb 2018 12:09] MySQL Verification Team
Hi Roel,

Again built fresh CentOS7 instance(imported appliance), installed GCC 7.2 and GNU Binutils 2.28 and tried to build once again 8.0.4-rc with the provided cmake but no issues observed again. 

Thanks,
Umesh
[1 Feb 2018 20:31] Roel Van de Paar
OK, thank you for the testing. Not sure what is going wrong here. Will update if I find more.
[1 Feb 2018 20:57] MySQL Verification Team
Are you doing builds in the source tree?  Best don't do that.   
For each build rm -rf the directory and do build completely clean,  similar to :

rm -rf bld
mkdir bld
cd bld
cmake ..   <other options>
[1 Feb 2018 22:44] Roel Van de Paar
Hi Shane! Yes, completely clean builds.