Bug #82358 Gis_wkb_vector<Gis_point> copy constructor is missing
Submitted: 27 Jul 2016 12:02 Modified: 4 Oct 2016 14:55
Reporter: Alexander Filyushov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.7.13 OS:Red Hat
Assigned to: CPU Architecture:Any

[27 Jul 2016 12:02] Alexander Filyushov
Description:
The problem occurs during build using Intel compiler (2016, 2017 beta). Even though it is claimed 'unsupported', this issue is the only I came across.

The build fails if using 'release' build type as libsql.a could not be linked due to undefined references to 'Gis_wkb_vector<Gis_point>::Gis_wkb_vector(Gis_wkb_vector<Gis_point> const&)', which was not instantiated explicitly and probably eliminated after inlining (release implies -O3 with various inlining opts enabled). Build passes if add -fno-inline to CFLAGS/CXXFLAGS.

How to repeat:
tar -xf mysql-5.7.13.tar.gz
mkdir build
cd build
cmake ../mysql-5.7.13 -DCMAKE_BUILD_TYPE=release -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc
make

Suggested fix:
Add the explicit instantiation to bottom of sql/spatial.cc:

template
Gis_wkb_vector<Gis_point>::Gis_wkb_vector(Gis_wkb_vector<Gis_point> const&);

(note similar lines for Gis_wkb_vector<Gis_polygon> above there, probably Gis_point was forgotten, and GCC did not complain for some reason)
[3 Aug 2016 8:47] Tor Didriksen
What happens if you use RelWithDebInfo rather than release?
Internally we never use build type == release,
so our cmake scripts aren't really prepared for that.
[3 Aug 2016 9:12] MySQL Verification Team
Hello Alexander,

Thank you for the report.
Verifying for the compiler issue based on internal discussion with Dev.
Also, please note that we only support and test "RelWithDebInfo" and "Debug". Documented here: http://dev.mysql.com/doc/refman/5.7/en/source-configuration-options.html#option_cmake_cmak...

For "release", we he have FR Bug #79550	

Thanks,
Umesh
[11 Aug 2016 4:21] Alexander Filyushov
Hi Tor,

RelWithDebInfo implies -O3 as well as pure Release. Therefore it has the same effect i.e. required symbol is not emitted unless inlining is turned off via -fno-inline or equivalent.
[11 Aug 2016 5:55] Tor Didriksen
Thanks, just wanted to verify.
The list of what to instantiate explicitly was indeed built up experimentally.
We will fix.
[4 Oct 2016 14:55] Paul DuBois
Posted by developer:
 
Noted in 5.7.17, 8.0.1 changelogs.

The Gis_wkb_vector<Gis_point> copy constructor was not explicitly
instantiated, causing build problems for the Intel compiler.