Bug #59607 Remove the fno-implicit-templates compilation flag
Submitted: 19 Jan 2011 10:02 Modified: 5 Apr 2011 0:44
Reporter: Tor Didriksen Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.6 OS:Any
Assigned to: Tor Didriksen CPU Architecture:Any

[19 Jan 2011 10:02] Tor Didriksen
Description:
The fno-implicit-templates compilation flag actually makes
mysqld bigger, so let's remove it.

It also forces us to write un-necessary code like:
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
template class List<String>;
template class List_iterator<String>;
#endif

It also forces us to play extra tricks in some CMakeFile's
extra/yassl/CMakeLists.txt:  #Remove -fno-implicit-templates 
unittest/gunit/CMakeLists.txt:  # Remove -fno-implicit-templates, gunit sources cannot be compiled with it.

How to repeat:
Compile with/without fno-implicit-templates
optimized, with gcc (GCC) 4.4.2 
size with fno...    47278223
size without fno... 47023929

Running nm on the binares, I see that with fno-implicit
we get explicit instantiations of lots of functons

000000000053ce60 W List_iterator<Alter_drop>::ref()
000000000053cd20 W List_iterator<Alter_drop>::init(List<Alter_drop>&)
000000000053db00 W List_iterator<Alter_drop>::after(Alter_drop*)
000000000053cde0 W List_iterator<Alter_drop>::remove()
000000000053cdd0 W List_iterator<Alter_drop>::rewind()
000000000053cd60 W List_iterator<Alter_drop>::replace(Alter_drop*)
000000000053cd70 W List_iterator<Alter_drop>::replace(List<Alter_drop>&)
000000000053ccc0 W List_iterator<Alter_drop>::List_iterator(List<Alter_drop>&)
000000000053cd00 W List_iterator<Alter_drop>::List_iterator()
000000000053cca0 W List_iterator<Alter_drop>::List_iterator(List<Alter_drop>&)
000000000053cce0 W List_iterator<Alter_drop>::List_iterator()
000000000053cd40 W List_iterator<Alter_drop>::operator++(int)
....
....

All this stuff is optimized away when removing the flag.

Suggested fix:
Remove it.
[5 Apr 2011 0:44] Paul DuBois
Code cleanup. No changelog entry needed.

CHANGESET - http://lists.mysql.com/commits/134595