List:Commits« Previous MessageNext Message »
From:Tor Didriksen Date:April 4 2011 9:23am
Subject:bzr push into mysql-trunk branch (tor.didriksen:3354 to 3355) Bug#11929733
View as plain text  
 3355 Tor Didriksen	2011-04-04
      Bug#11929733 - 59607: REMOVE THE FNO-IMPLICIT-TEMPLATES COMPILATION FLAG
      
      Explicit template instantiations introduces extra code maintenance,
      and actually yields code bloat with modern gcc compilers/linkers:
       - we instantiate code which is un-used
       - we disable optimization of common code for pointer-based templates
      
      The mysqld executable size shrinks with about 200Kb with this patch.

    removed:
      extra/yassl/src/template_instnt.cpp
      extra/yassl/taocrypt/src/template_instnt.cpp
    modified:
      cmake/ssl.cmake
      config.h.cmake
      configure.cmake
      extra/yassl/CMakeLists.txt
      extra/yassl/src/crypto_wrapper.cpp
      extra/yassl/src/yassl_int.cpp
      extra/yassl/taocrypt/CMakeLists.txt
      extra/yassl/taocrypt/src/algebra.cpp
      extra/yassl/taocrypt/src/integer.cpp
      sql/binlog.cc
      sql/field.cc
      sql/filesort.cc
      sql/item.cc
      sql/item_buff.cc
      sql/keycaches.cc
      sql/mysqld.cc
      sql/opt_range.cc
      sql/rpl_slave.cc
      sql/sql_acl.cc
      sql/sql_class.cc
      sql/sql_insert.cc
      sql/sql_select.cc
      sql/sql_show.cc
      sql/sys_vars.h
      sql/table.cc
      unittest/gunit/CMakeLists.txt
 3354 Vasil Dimov	2011-04-04 [merge]
      Merge mysql-5.5 -> mysql-trunk (empty)

=== modified file 'cmake/ssl.cmake'
--- a/cmake/ssl.cmake	2010-07-19 14:17:07 +0000
+++ b/cmake/ssl.cmake	2011-04-04 08:47:25 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Sun Microsystems, Inc
+# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
 # 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -27,16 +27,8 @@ MACRO (MYSQL_USE_BUNDLED_SSL)
   SET(SSL_INTERNAL_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL)
   SET(SSL_DEFINES "-DHAVE_YASSL -DYASSL_PURE_C -DYASSL_PREFIX -DHAVE_OPENSSL -DYASSL_THREAD_SAFE")
   CHANGE_SSL_SETTINGS("bundled")
-  #Remove -fno-implicit-templates 
-  #(yassl sources cannot  be compiled with  it)
-  SET(SAVE_CXX_FLAGS ${CMAKE_CXX_FLAGS})
-  IF(CMAKE_CXX_FLAGS)
-  STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS 
-    ${CMAKE_CXX_FLAGS})
-  ENDIF()
   ADD_SUBDIRECTORY(extra/yassl)
   ADD_SUBDIRECTORY(extra/yassl/taocrypt)
-  SET(CMAKE_CXX_FLAGS ${SAVE_CXX_FLAGS})
   GET_TARGET_PROPERTY(src yassl SOURCES)
   FOREACH(file ${src})
     SET(SSL_SOURCES ${SSL_SOURCES} ${CMAKE_SOURCE_DIR}/extra/yassl/${file})

=== modified file 'config.h.cmake'
--- a/config.h.cmake	2011-02-02 18:31:39 +0000
+++ b/config.h.cmake	2011-04-04 08:47:25 +0000
@@ -40,7 +40,6 @@
 #cmakedefine HAVE_FNMATCH_H 1
 #cmakedefine HAVE_FPU_CONTROL_H 1
 #cmakedefine HAVE_GRP_H 1
-#cmakedefine HAVE_EXPLICIT_TEMPLATE_INSTANTIATION 1
 #cmakedefine HAVE_IA64INTRIN_H 1
 #cmakedefine HAVE_IEEEFP_H 1
 #cmakedefine HAVE_INTTYPES_H 1

=== modified file 'configure.cmake'
--- a/configure.cmake	2011-02-02 18:31:39 +0000
+++ b/configure.cmake	2011-04-04 08:47:25 +0000
@@ -1,5 +1,4 @@
-
-# Copyright (C) 2009 Sun Microsystems,Inc
+# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
 # 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -67,15 +66,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
   # MySQL "canonical" GCC flags. At least -fno-rtti flag affects
   # ABI and cannot be simply removed. 
   SET(CMAKE_CXX_FLAGS 
-    "${CMAKE_CXX_FLAGS} -fno-implicit-templates -fno-exceptions -fno-rtti")
-  IF(CMAKE_CXX_FLAGS)
-    STRING(REGEX MATCH "fno-implicit-templates" NO_IMPLICIT_TEMPLATES
-      ${CMAKE_CXX_FLAGS})
-    IF (NO_IMPLICIT_TEMPLATES)
-      SET(HAVE_EXPLICIT_TEMPLATE_INSTANTIATION TRUE)
-    ENDIF()
-  ENDIF()
-
+    "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")
   IF (CMAKE_EXE_LINKER_FLAGS MATCHES " -static " 
      OR CMAKE_EXE_LINKER_FLAGS MATCHES " -static$")
      SET(HAVE_DLOPEN FALSE CACHE "Disable dlopen due to -static flag" FORCE)

=== modified file 'extra/yassl/CMakeLists.txt'
--- a/extra/yassl/CMakeLists.txt	2010-12-29 00:26:31 +0000
+++ b/extra/yassl/CMakeLists.txt	2011-04-04 08:47:25 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
 # 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -20,20 +20,11 @@ INCLUDE_DIRECTORIES(
  ${CMAKE_SOURCE_DIR}/extra/yassl/taocrypt/mySTL)
 
 ADD_DEFINITIONS(${SSL_DEFINES})
-IF(CMAKE_COMPILER_IS_GNUXX)
-  #Remove -fno-implicit-templates 
-  #(yassl sources cannot  be compiled with  it)
-  STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS
-${CMAKE_CXX_FLAGS})
-ENDIF()
+
 SET(YASSL_SOURCES  src/buffer.cpp src/cert_wrapper.cpp src/crypto_wrapper.cpp src/handshake.cpp src/lock.cpp 
 				src/log.cpp src/socket_wrapper.cpp src/ssl.cpp src/timer.cpp src/yassl_error.cpp 
 				src/yassl_imp.cpp src/yassl_int.cpp)
 
-IF(HAVE_EXPLICIT_TEMPLATE_INSTANTIATION)
-  SET(YASSL_SOURCES ${YASSL_SOURCES} src/template_instnt.cpp)
-ENDIF()
-
 ADD_CONVENIENCE_LIBRARY(yassl ${YASSL_SOURCES})
 RESTRICT_SYMBOL_EXPORTS(yassl)
 

=== modified file 'extra/yassl/src/crypto_wrapper.cpp'
--- a/extra/yassl/src/crypto_wrapper.cpp	2010-07-02 18:30:47 +0000
+++ b/extra/yassl/src/crypto_wrapper.cpp	2011-04-04 08:47:25 +0000
@@ -1,5 +1,4 @@
-/*
-   Copyright (C) 2000-2007 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -11,10 +10,8 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; see the file COPYING. If not, write to the
-   Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
-   MA  02110-1301  USA.
-*/
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 /*  The crypto wrapper source implements the policies for the cipher
  *  components used by SSL.
@@ -991,24 +988,4 @@ x509* PemToDer(FILE* file, CertType type
 } // namespace
 
 
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-namespace yaSSL {
-template void ysDelete<DiffieHellman::DHImpl>(DiffieHellman::DHImpl*);
-template void ysDelete<Integer::IntegerImpl>(Integer::IntegerImpl*);
-template void ysDelete<RSA::RSAImpl>(RSA::RSAImpl*);
-template void ysDelete<DSS::DSSImpl>(DSS::DSSImpl*);
-template void ysDelete<RandomPool::RandomImpl>(RandomPool::RandomImpl*);
-template void ysDelete<AES::AESImpl>(AES::AESImpl*);
-template void ysDelete<RC4::RC4Impl>(RC4::RC4Impl*);
-template void ysDelete<DES_EDE::DES_EDEImpl>(DES_EDE::DES_EDEImpl*);
-template void ysDelete<DES::DESImpl>(DES::DESImpl*);
-template void ysDelete<HMAC_RMD::HMAC_RMDImpl>(HMAC_RMD::HMAC_RMDImpl*);
-template void ysDelete<HMAC_SHA::HMAC_SHAImpl>(HMAC_SHA::HMAC_SHAImpl*);
-template void ysDelete<HMAC_MD5::HMAC_MD5Impl>(HMAC_MD5::HMAC_MD5Impl*);
-template void ysDelete<RMD::RMDImpl>(RMD::RMDImpl*);
-template void ysDelete<SHA::SHAImpl>(SHA::SHAImpl*);
-template void ysDelete<MD5::MD5Impl>(MD5::MD5Impl*);
-}
-#endif // HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-
 #endif // !USE_CRYPTOPP_LIB

=== removed file 'extra/yassl/src/template_instnt.cpp'
--- a/extra/yassl/src/template_instnt.cpp	2009-05-15 12:57:51 +0000
+++ b/extra/yassl/src/template_instnt.cpp	1970-01-01 00:00:00 +0000
@@ -1,110 +0,0 @@
-/*
-   Copyright (C) 2000-2007 MySQL AB
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; version 2 of the License.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; see the file COPYING. If not, write to the
-   Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
-   MA  02110-1301  USA.
-*/
-
-
-/*  Explicit template instantiation requests 
- */
-
-
-#include "runtime.hpp"
-#include "handshake.hpp"
-#include "yassl_int.hpp"
-#include "crypto_wrapper.hpp"
-#include "hmac.hpp"
-#include "md5.hpp"
-#include "sha.hpp"
-#include "ripemd.hpp"
-#include "openssl/ssl.h"
-
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-
-namespace mySTL {
-template class list<unsigned char*>;
-template yaSSL::del_ptr_zero for_each(mySTL::list<unsigned char*>::iterator, mySTL::list<unsigned char*>::iterator, yaSSL::del_ptr_zero);
-template pair<int, yaSSL::Message* (*)()>* uninit_copy<mySTL::pair<int, yaSSL::Message* (*)()>*, mySTL::pair<int, yaSSL::Message* (*)()>*>(mySTL::pair<int, yaSSL::Message* (*)()>*, mySTL::pair<int, yaSSL::Message* (*)()>*, mySTL::pair<int, yaSSL::Message* (*)()>*);
-template pair<int, yaSSL::HandShakeBase* (*)()>* uninit_copy<mySTL::pair<int, yaSSL::HandShakeBase* (*)()>*, mySTL::pair<int, yaSSL::HandShakeBase* (*)()>*>(mySTL::pair<int, yaSSL::HandShakeBase* (*)()>*, mySTL::pair<int, yaSSL::HandShakeBase* (*)()>*, mySTL::pair<int, yaSSL::HandShakeBase* (*)()>*);
-template void destroy<mySTL::pair<int, yaSSL::Message* (*)()>*>(mySTL::pair<int, yaSSL::Message* (*)()>*, mySTL::pair<int, yaSSL::Message* (*)()>*);
-template void destroy<mySTL::pair<int, yaSSL::HandShakeBase* (*)()>*>(mySTL::pair<int, yaSSL::HandShakeBase* (*)()>*, mySTL::pair<int, yaSSL::HandShakeBase* (*)()>*);
-template pair<int, yaSSL::ServerKeyBase* (*)()>* uninit_copy<mySTL::pair<int, yaSSL::ServerKeyBase* (*)()>*, mySTL::pair<int, yaSSL::ServerKeyBase* (*)()>*>(mySTL::pair<int, yaSSL::ServerKeyBase* (*)()>*, mySTL::pair<int, yaSSL::ServerKeyBase* (*)()>*, mySTL::pair<int, yaSSL::ServerKeyBase* (*)()>*);
-template void destroy<mySTL::pair<int, yaSSL::ServerKeyBase* (*)()>*>(mySTL::pair<int, yaSSL::ServerKeyBase* (*)()>*, mySTL::pair<int, yaSSL::ServerKeyBase* (*)()>*);
-template pair<int, yaSSL::ClientKeyBase* (*)()>* uninit_copy<mySTL::pair<int, yaSSL::ClientKeyBase* (*)()>*, mySTL::pair<int, yaSSL::ClientKeyBase* (*)()>*>(mySTL::pair<int, yaSSL::ClientKeyBase* (*)()>*, mySTL::pair<int, yaSSL::ClientKeyBase* (*)()>*, mySTL::pair<int, yaSSL::ClientKeyBase* (*)()>*);
-template class list<TaoCrypt::Signer*>;
-template class list<yaSSL::SSL_SESSION*>;
-template class list<yaSSL::input_buffer*>;
-template class list<yaSSL::output_buffer*>;
-template class list<yaSSL::x509*>;
-template class list<yaSSL::Digest*>;
-template class list<yaSSL::BulkCipher*>;
-template void destroy<mySTL::pair<int, yaSSL::ClientKeyBase* (*)()>*>(mySTL::pair<int, yaSSL::ClientKeyBase* (*)()>*, mySTL::pair<int, yaSSL::ClientKeyBase* (*)()>*);
-template yaSSL::del_ptr_zero for_each<mySTL::list<TaoCrypt::Signer*>::iterator, yaSSL::del_ptr_zero>(mySTL::list<TaoCrypt::Signer*>::iterator, mySTL::list<TaoCrypt::Signer*>::iterator, yaSSL::del_ptr_zero);
-template yaSSL::del_ptr_zero for_each<mySTL::list<yaSSL::SSL_SESSION*>::iterator, yaSSL::del_ptr_zero>(mySTL::list<yaSSL::SSL_SESSION*>::iterator, mySTL::list<yaSSL::SSL_SESSION*>::iterator, yaSSL::del_ptr_zero);
-template yaSSL::del_ptr_zero for_each<mySTL::list<yaSSL::input_buffer*>::iterator, yaSSL::del_ptr_zero>(mySTL::list<yaSSL::input_buffer*>::iterator, mySTL::list<yaSSL::input_buffer*>::iterator, yaSSL::del_ptr_zero);
-template yaSSL::del_ptr_zero for_each<mySTL::list<yaSSL::output_buffer*>::iterator, yaSSL::del_ptr_zero>(mySTL::list<yaSSL::output_buffer*>::iterator, mySTL::list<yaSSL::output_buffer*>::iterator, yaSSL::del_ptr_zero);
-template yaSSL::del_ptr_zero for_each<mySTL::list<yaSSL::x509*>::iterator, yaSSL::del_ptr_zero>(mySTL::list<yaSSL::x509*>::iterator, mySTL::list<yaSSL::x509*>::iterator, yaSSL::del_ptr_zero);
-template yaSSL::del_ptr_zero for_each<mySTL::list<yaSSL::Digest*>::iterator, yaSSL::del_ptr_zero>(mySTL::list<yaSSL::Digest*>::iterator, mySTL::list<yaSSL::Digest*>::iterator, yaSSL::del_ptr_zero);
-template yaSSL::del_ptr_zero for_each<mySTL::list<yaSSL::BulkCipher*>::iterator, yaSSL::del_ptr_zero>(mySTL::list<yaSSL::BulkCipher*>::iterator, mySTL::list<yaSSL::BulkCipher*>::iterator, yaSSL::del_ptr_zero);
-template bool list<yaSSL::ThreadError>::erase(list<yaSSL::ThreadError>::iterator);
-template void list<yaSSL::ThreadError>::push_back(yaSSL::ThreadError);
-template void list<yaSSL::ThreadError>::pop_front();
-template void list<yaSSL::ThreadError>::pop_back();
-template list<yaSSL::ThreadError>::~list();
-template pair<int, yaSSL::Message* (*)()>* GetArrayMemory<pair<int, yaSSL::Message* (*)()> >(size_t);
-template void FreeArrayMemory<pair<int, yaSSL::Message* (*)()> >(pair<int, yaSSL::Message* (*)()>*);
-template pair<int, yaSSL::HandShakeBase* (*)()>* GetArrayMemory<pair<int, yaSSL::HandShakeBase* (*)()> >(size_t);
-template void FreeArrayMemory<pair<int, yaSSL::HandShakeBase* (*)()> >(pair<int, yaSSL::HandShakeBase* (*)()>*);
-template pair<int, yaSSL::ServerKeyBase* (*)()>* GetArrayMemory<pair<int, yaSSL::ServerKeyBase* (*)()> >(size_t);
-template void FreeArrayMemory<pair<int, yaSSL::ServerKeyBase* (*)()> >(pair<int, yaSSL::ServerKeyBase* (*)()>*);
-template pair<int, yaSSL::ClientKeyBase* (*)()>* GetArrayMemory<pair<int, yaSSL::ClientKeyBase* (*)()> >(size_t);
-template void FreeArrayMemory<pair<int, yaSSL::ClientKeyBase* (*)()> >(pair<int, yaSSL::ClientKeyBase* (*)()>*);
-}
-
-namespace yaSSL {
-template void ysDelete<SSL_CTX>(yaSSL::SSL_CTX*);
-template void ysDelete<SSL>(yaSSL::SSL*);
-template void ysDelete<BIGNUM>(yaSSL::BIGNUM*);
-template void ysDelete<unsigned char>(unsigned char*);
-template void ysDelete<DH>(yaSSL::DH*);
-template void ysDelete<TaoCrypt::Signer>(TaoCrypt::Signer*);
-template void ysDelete<SSL_SESSION>(yaSSL::SSL_SESSION*);
-template void ysDelete<input_buffer>(input_buffer*);
-template void ysDelete<output_buffer>(output_buffer*);
-template void ysDelete<x509>(x509*);
-template void ysDelete<Auth>(Auth*);
-template void ysDelete<HandShakeBase>(HandShakeBase*);
-template void ysDelete<ServerKeyBase>(ServerKeyBase*);
-template void ysDelete<ClientKeyBase>(ClientKeyBase*);
-template void ysDelete<SSL_METHOD>(SSL_METHOD*);
-template void ysDelete<DiffieHellman>(DiffieHellman*);
-template void ysDelete<BulkCipher>(BulkCipher*);
-template void ysDelete<Digest>(Digest*);
-template void ysDelete<X509>(X509*);
-template void ysDelete<Message>(Message*);
-template void ysDelete<sslFactory>(sslFactory*);
-template void ysDelete<Sessions>(Sessions*);
-template void ysDelete<Errors>(Errors*);
-template void ysArrayDelete<unsigned char>(unsigned char*);
-template void ysArrayDelete<char>(char*);
-
-template int min<int>(int, int);
-template uint16 min<uint16>(uint16, uint16);
-template unsigned int min<unsigned int>(unsigned int, unsigned int);
-template unsigned long min<unsigned long>(unsigned long, unsigned long);
-}
-
-#endif // HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-

=== modified file 'extra/yassl/src/yassl_int.cpp'
--- a/extra/yassl/src/yassl_int.cpp	2011-03-29 08:01:07 +0000
+++ b/extra/yassl/src/yassl_int.cpp	2011-04-04 08:47:25 +0000
@@ -1,5 +1,4 @@
-/*
-   Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -11,11 +10,8 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; see the file COPYING. If not, write to the
-   Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
-   MA  02110-1301  USA.
-*/
-
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 /* yaSSL internal source implements SSL supporting types not specified in the
  * draft along with type conversion functions.
@@ -2568,14 +2564,3 @@ extern "C" void yaSSL_CleanUp()
     yaSSL::sessionsInstance = 0;
     yaSSL::errorsInstance = 0;
 }
-
-
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-namespace mySTL {
-template yaSSL::yassl_int_cpp_local1::SumData for_each<mySTL::list<yaSSL::input_buffer*>::iterator, yaSSL::yassl_int_cpp_local1::SumData>(mySTL::list<yaSSL::input_buffer*>::iterator, mySTL::list<yaSSL::input_buffer*>::iterator, yaSSL::yassl_int_cpp_local1::SumData);
-template yaSSL::yassl_int_cpp_local1::SumBuffer for_each<mySTL::list<yaSSL::output_buffer*>::iterator, yaSSL::yassl_int_cpp_local1::SumBuffer>(mySTL::list<yaSSL::output_buffer*>::iterator, mySTL::list<yaSSL::output_buffer*>::iterator, yaSSL::yassl_int_cpp_local1::SumBuffer);
-template mySTL::list<yaSSL::SSL_SESSION*>::iterator find_if<mySTL::list<yaSSL::SSL_SESSION*>::iterator, yaSSL::yassl_int_cpp_local2::sess_match>(mySTL::list<yaSSL::SSL_SESSION*>::iterator, mySTL::list<yaSSL::SSL_SESSION*>::iterator, yaSSL::yassl_int_cpp_local2::sess_match);
-template mySTL::list<yaSSL::ThreadError>::iterator find_if<mySTL::list<yaSSL::ThreadError>::iterator, yaSSL::yassl_int_cpp_local2::thr_match>(mySTL::list<yaSSL::ThreadError>::iterator, mySTL::list<yaSSL::ThreadError>::iterator, yaSSL::yassl_int_cpp_local2::thr_match);
-}
-#endif
-

=== modified file 'extra/yassl/taocrypt/CMakeLists.txt'
--- a/extra/yassl/taocrypt/CMakeLists.txt	2010-12-29 00:26:31 +0000
+++ b/extra/yassl/taocrypt/CMakeLists.txt	2011-04-04 08:47:25 +0000
@@ -1,4 +1,4 @@
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
 # 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -27,10 +27,6 @@ SET(TAOCRYPT_SOURCES		src/aes.cpp src/ae
 				include/md2.hpp include/md5.hpp include/misc.hpp include/modarith.hpp include/modes.hpp
 				include/random.hpp include/ripemd.hpp include/rsa.hpp include/sha.hpp)
 
-IF(HAVE_EXPLICIT_TEMPLATE_INSTANTIATION)
-  SET(TAOCRYPT_SOURCES ${TAOCRYPT_SOURCES} src/template_instnt.cpp)
-ENDIF()
-
 ADD_CONVENIENCE_LIBRARY(taocrypt ${TAOCRYPT_SOURCES})
 RESTRICT_SYMBOL_EXPORTS(taocrypt)
 

=== modified file 'extra/yassl/taocrypt/src/algebra.cpp'
--- a/extra/yassl/taocrypt/src/algebra.cpp	2010-07-02 18:30:47 +0000
+++ b/extra/yassl/taocrypt/src/algebra.cpp	2011-04-04 08:47:25 +0000
@@ -1,5 +1,4 @@
-/*
-   Copyright (C) 2000-2007 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -11,10 +10,8 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; see the file COPYING. If not, write to the
-   Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
-   MA  02110-1301  USA.
-*/
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 /* based on Wei Dai's algebra.cpp from CryptoPP */
 #undef  NDEBUG
@@ -326,14 +323,3 @@ void AbstractRing::SimultaneousExponenti
 
 
 } // namespace
-
-
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-namespace mySTL {
-template TaoCrypt::WindowSlider* uninit_copy<TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*>(TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*);
-template void destroy<TaoCrypt::WindowSlider*>(TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*);
-template TaoCrypt::WindowSlider* GetArrayMemory<TaoCrypt::WindowSlider>(size_t);
-template void FreeArrayMemory<TaoCrypt::WindowSlider>(TaoCrypt::WindowSlider*);
-}
-#endif
-

=== modified file 'extra/yassl/taocrypt/src/integer.cpp'
--- a/extra/yassl/taocrypt/src/integer.cpp	2010-07-02 18:30:47 +0000
+++ b/extra/yassl/taocrypt/src/integer.cpp	2011-04-04 08:47:25 +0000
@@ -1,5 +1,4 @@
-/*
-   Copyright (C) 2000-2007 MySQL AB
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -11,12 +10,8 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; see the file COPYING. If not, write to the
-   Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
-   MA  02110-1301  USA.
-*/
-
-
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
 /* based on Wei Dai's integer.cpp from CryptoPP */
 
@@ -3953,18 +3948,5 @@ Integer CRT(const Integer &xp, const Int
     // isn't operator overloading great?
     return p * (u * (xq-xp) % q) + xp;
 }
-
-
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-#ifndef TAOCRYPT_NATIVE_DWORD_AVAILABLE
-template hword DivideThreeWordsByTwo<hword, Word>(hword*, hword, hword, Word*);
-#endif
-template word DivideThreeWordsByTwo<word, DWord>(word*, word, word, DWord*);
-#ifdef SSE2_INTRINSICS_AVAILABLE
-template class AlignedAllocator<word>;
-#endif
-#endif
-
-
 } // namespace
 

=== removed file 'extra/yassl/taocrypt/src/template_instnt.cpp'
--- a/extra/yassl/taocrypt/src/template_instnt.cpp	2007-01-29 15:54:40 +0000
+++ b/extra/yassl/taocrypt/src/template_instnt.cpp	1970-01-01 00:00:00 +0000
@@ -1,82 +0,0 @@
-/*
-   Copyright (C) 2000-2007 MySQL AB
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; version 2 of the License.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; see the file COPYING. If not, write to the
-   Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
-   MA  02110-1301  USA.
-*/
-
-
-/*  Explicit template instantiation requests 
- */
-
-
-#include "runtime.hpp"
-#include "integer.hpp"
-#include "rsa.hpp"
-#include "sha.hpp"
-#include "md5.hpp"
-#include "hmac.hpp"
-#include "ripemd.hpp"
-#include "pwdbased.hpp"
-#include "algebra.hpp"
-#include "vector.hpp"
-#include "hash.hpp"
-
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-namespace TaoCrypt {
-
-#if defined(SSE2_INTRINSICS_AVAILABLE)
-template AlignedAllocator<unsigned int>::pointer StdReallocate<unsigned int, AlignedAllocator<unsigned int> >(AlignedAllocator<unsigned int>&, unsigned int*, AlignedAllocator<unsigned int>::size_type, AlignedAllocator<unsigned int>::size_type, bool);
-#endif
-
-template class RSA_Decryptor<RSA_BlockType2>;
-template class RSA_Encryptor<RSA_BlockType1>;
-template class RSA_Encryptor<RSA_BlockType2>;
-template void tcDelete<HASH>(HASH*);
-template void tcDelete<Integer>(Integer*);
-template void tcArrayDelete<byte>(byte*);
-template AllocatorWithCleanup<byte>::pointer StdReallocate<byte, AllocatorWithCleanup<byte> >(AllocatorWithCleanup<byte>&, byte*, AllocatorWithCleanup<byte>::size_type, AllocatorWithCleanup<byte>::size_type, bool);
-template void tcArrayDelete<word>(word*);
-template AllocatorWithCleanup<word>::pointer StdReallocate<word, AllocatorWithCleanup<word> >(AllocatorWithCleanup<word>&, word*, AllocatorWithCleanup<word>::size_type, AllocatorWithCleanup<word>::size_type, bool);
-
-#ifndef TAOCRYPT_SLOW_WORD64 // defined when word != word32
-template void tcArrayDelete<word32>(word32*);
-template AllocatorWithCleanup<word32>::pointer StdReallocate<word32, AllocatorWithCleanup<word32> >(AllocatorWithCleanup<word32>&, word32*, AllocatorWithCleanup<word32>::size_type, AllocatorWithCleanup<word32>::size_type, bool);
-#endif
-
-template void tcArrayDelete<char>(char*);
-
-template class PBKDF2_HMAC<SHA>;
-template class HMAC<MD5>;
-template class HMAC<SHA>;
-template class HMAC<RIPEMD160>;
-
-}
-
-namespace mySTL {
-template vector<TaoCrypt::Integer>* uninit_fill_n<vector<TaoCrypt::Integer>*, size_t, vector<TaoCrypt::Integer> >(vector<TaoCrypt::Integer>*, size_t, vector<TaoCrypt::Integer> const&);
-template void destroy<vector<TaoCrypt::Integer>*>(vector<TaoCrypt::Integer>*, vector<TaoCrypt::Integer>*);
-template TaoCrypt::Integer* uninit_copy<TaoCrypt::Integer*, TaoCrypt::Integer*>(TaoCrypt::Integer*, TaoCrypt::Integer*, TaoCrypt::Integer*);
-template TaoCrypt::Integer* uninit_fill_n<TaoCrypt::Integer*, size_t, TaoCrypt::Integer>(TaoCrypt::Integer*, size_t, TaoCrypt::Integer const&);
-template void destroy<TaoCrypt::Integer*>(TaoCrypt::Integer*, TaoCrypt::Integer*);
-template TaoCrypt::byte* GetArrayMemory<TaoCrypt::byte>(size_t);
-template void FreeArrayMemory<TaoCrypt::byte>(TaoCrypt::byte*);
-template TaoCrypt::Integer* GetArrayMemory<TaoCrypt::Integer>(size_t);
-template void FreeArrayMemory<TaoCrypt::Integer>(TaoCrypt::Integer*);
-template vector<TaoCrypt::Integer>* GetArrayMemory<vector<TaoCrypt::Integer> >(size_t);
-template void FreeArrayMemory<vector<TaoCrypt::Integer> >(vector<TaoCrypt::Integer>*);
-template void FreeArrayMemory<void>(void*);
-}
-
-#endif

=== modified file 'sql/binlog.cc'
--- a/sql/binlog.cc	2011-03-14 17:55:26 +0000
+++ b/sql/binlog.cc	2011-04-04 08:47:25 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -5379,24 +5379,6 @@ THD::binlog_prepare_pending_rows_event(T
   DBUG_RETURN(pending);        /* This is the current pending event */
 }
 
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-/*
-  Instantiate the versions we need, we have -fno-implicit-template as
-  compiling option.
-*/
-template Rows_log_event*
-THD::binlog_prepare_pending_rows_event(TABLE*, uint32, size_t, bool,
-				       Write_rows_log_event*);
-
-template Rows_log_event*
-THD::binlog_prepare_pending_rows_event(TABLE*, uint32, size_t, bool,
-				       Delete_rows_log_event *);
-
-template Rows_log_event* 
-THD::binlog_prepare_pending_rows_event(TABLE*, uint32, size_t, bool,
-				       Update_rows_log_event *);
-#endif
-
 /* Declare in unnamed namespace. */
 CPP_UNNAMED_NS_START
 

=== modified file 'sql/field.cc'
--- a/sql/field.cc	2011-03-22 11:44:40 +0000
+++ b/sql/field.cc	2011-04-04 08:47:25 +0000
@@ -40,15 +40,9 @@
 // Maximum allowed exponent value for converting string to decimal
 #define MAX_EXPONENT 1024
 
-/*****************************************************************************
-  Instansiate templates and static variables
-*****************************************************************************/
-
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-template class List<Create_field>;
-template class List_iterator<Create_field>;
-#endif
-
+/**
+  Static variables
+*/
 uchar Field_null::null[1]={1};
 const char field_separator=',';
 

=== modified file 'sql/filesort.cc'
--- a/sql/filesort.cc	2011-03-17 17:39:31 +0000
+++ b/sql/filesort.cc	2011-04-04 08:47:25 +0000
@@ -37,10 +37,6 @@
 #include "sql_select.h"
 #include "debug_sync.h"
 
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-template class Bounded_queue<uchar, uchar>;
-#endif
-
 	/* functions defined in this file */
 
 static void make_char_array(FILESORT_INFO *info, uint fields, uint length);

=== modified file 'sql/item.cc'
--- a/sql/item.cc	2011-04-02 19:42:50 +0000
+++ b/sql/item.cc	2011-04-04 08:47:25 +0000
@@ -8501,14 +8501,3 @@ void view_error_processor(THD *thd, void
   ((TABLE_LIST *)data)->hide_view_error(thd);
 }
 
-/*****************************************************************************
-** Instantiate templates
-*****************************************************************************/
-
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-template class List<Item>;
-template class List_iterator<Item>;
-template class List_iterator_fast<Item>;
-template class List_iterator_fast<Item_field>;
-template class List<List_item>;
-#endif

=== modified file 'sql/item_buff.cc'
--- a/sql/item_buff.cc	2010-08-16 06:58:42 +0000
+++ b/sql/item_buff.cc	2011-04-04 08:47:25 +0000
@@ -1,4 +1,4 @@
-/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -175,13 +175,3 @@ bool Cached_item_decimal::cmp()
   }
   return FALSE;
 }
-
-
-/*****************************************************************************
-** Instansiate templates
-*****************************************************************************/
-
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-template class List<Cached_item>;
-template class List_iterator<Cached_item>;
-#endif

=== modified file 'sql/keycaches.cc'
--- a/sql/keycaches.cc	2010-07-08 21:42:23 +0000
+++ b/sql/keycaches.cc	2011-04-04 08:47:25 +0000
@@ -157,7 +157,3 @@ bool process_key_caches(process_key_cach
   return 0;
 }
 
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-template class I_List_iterator<NAMED_ILINK>;
-#endif
-

=== modified file 'sql/mysqld.cc'
--- a/sql/mysqld.cc	2011-03-29 08:01:07 +0000
+++ b/sql/mysqld.cc	2011-04-04 08:47:25 +0000
@@ -8130,20 +8130,6 @@ void refresh_status(THD *thd)
   This section should go away soon
 *****************************************************************************/
 
-/*****************************************************************************
-  Instantiate templates
-*****************************************************************************/
-
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-/* Used templates */
-template class I_List<THD>;
-template class I_List_iterator<THD>;
-template class I_List<i_string>;
-template class I_List<i_string_pair>;
-template class I_List<Statement>;
-template class I_List_iterator<Statement>;
-#endif
-
 #ifdef HAVE_PSI_INTERFACE
 #ifdef HAVE_MMAP
 PSI_mutex_key key_PAGE_lock, key_LOCK_sync, key_LOCK_active, key_LOCK_pool;

=== modified file 'sql/opt_range.cc'
--- a/sql/opt_range.cc	2011-04-01 14:04:52 +0000
+++ b/sql/opt_range.cc	2011-04-04 08:47:25 +0000
@@ -11963,12 +11963,3 @@ void QUICK_GROUP_MIN_MAX_SELECT::dbug_du
 
 
 #endif /* !DBUG_OFF */
-
-/*****************************************************************************
-** Instantiate templates 
-*****************************************************************************/
-
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-template class List<QUICK_RANGE>;
-template class List_iterator<QUICK_RANGE>;
-#endif

=== modified file 'sql/rpl_slave.cc'
--- a/sql/rpl_slave.cc	2011-03-29 14:56:01 +0000
+++ b/sql/rpl_slave.cc	2011-04-04 08:47:25 +0000
@@ -5486,11 +5486,6 @@ bool rpl_master_erroneous_autoinc(THD *t
   return FALSE;
 }
 
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-template class I_List_iterator<i_string>;
-template class I_List_iterator<i_string_pair>;
-#endif
-
 /**
   a copy of active_mi->rli->slave_skip_counter, for showing in SHOW VARIABLES,
   INFORMATION_SCHEMA.GLOBAL_VARIABLES and @@sql_slave_skip_counter without

=== modified file 'sql/sql_acl.cc'
--- a/sql/sql_acl.cc	2011-03-23 22:51:19 +0000
+++ b/sql/sql_acl.cc	2011-04-04 08:47:25 +0000
@@ -7191,17 +7191,6 @@ bool sp_grant_privileges(THD *thd, const
 }
 
 
-/*****************************************************************************
-  Instantiate used templates
-*****************************************************************************/
-
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-template class List_iterator<LEX_COLUMN>;
-template class List_iterator<LEX_USER>;
-template class List<LEX_COLUMN>;
-template class List<LEX_USER>;
-#endif
-
 /**
   Validate if a user can proxy as another user
 

=== modified file 'sql/sql_class.cc'
--- a/sql/sql_class.cc	2011-03-24 08:00:03 +0000
+++ b/sql/sql_class.cc	2011-04-04 08:47:25 +0000
@@ -67,23 +67,6 @@ char empty_c_string[1]= {0};    /* used 
 
 const char * const THD::DEFAULT_WHERE= "field list";
 
-
-/*****************************************************************************
-** Instansiate templates
-*****************************************************************************/
-
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-/* Used templates */
-template class List<Key>;
-template class List_iterator<Key>;
-template class List<Key_part_spec>;
-template class List_iterator<Key_part_spec>;
-template class List<Alter_drop>;
-template class List_iterator<Alter_drop>;
-template class List<Alter_column>;
-template class List_iterator<Alter_column>;
-#endif
-
 /****************************************************************************
 ** User variables
 ****************************************************************************/

=== modified file 'sql/sql_insert.cc'
--- a/sql/sql_insert.cc	2011-02-15 17:14:15 +0000
+++ b/sql/sql_insert.cc	2011-04-04 08:47:25 +0000
@@ -4138,17 +4138,3 @@ void select_create::abort_result_set()
   }
   DBUG_VOID_RETURN;
 }
-
-
-/*****************************************************************************
-  Instansiate templates
-*****************************************************************************/
-
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-template class List_iterator_fast<List_item>;
-#ifndef EMBEDDED_LIBRARY
-template class I_List<Delayed_insert>;
-template class I_List_iterator<Delayed_insert>;
-template class I_List<delayed_row>;
-#endif /* EMBEDDED_LIBRARY */
-#endif /* HAVE_EXPLICIT_TEMPLATE_INSTANTIATION */

=== modified file 'sql/sql_select.cc'
--- a/sql/sql_select.cc	2011-04-01 14:04:52 +0000
+++ b/sql/sql_select.cc	2011-04-04 08:47:25 +0000
@@ -12015,13 +12015,6 @@ public:
   COND_CMP(Item *a,Item_func *b) :and_level(a),cmp_func(b) {}
 };
 
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-template class I_List<COND_CMP>;
-template class I_List_iterator<COND_CMP>;
-template class List<Item_func_match>;
-template class List_iterator<Item_func_match>;
-#endif
-
 
 /**
   Find the multiple equality predicate containing a field.

=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc	2011-03-28 08:10:39 +0000
+++ b/sql/sql_show.cc	2011-04-04 08:47:25 +0000
@@ -1751,10 +1751,6 @@ public:
   CSET_STRING query_string;
 };
 
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-template class I_List<thread_info>;
-#endif
-
 static const char *thread_state_info(THD *tmp)
 {
 #ifndef EMBEDDED_LIBRARY
@@ -7522,11 +7518,6 @@ ST_SCHEMA_TABLE schema_tables[]=
 };
 
 
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-template class List_iterator_fast<char>;
-template class List<char>;
-#endif
-
 int initialize_schema_table(st_plugin_int *plugin)
 {
   ST_SCHEMA_TABLE *schema_table;

=== modified file 'sql/sys_vars.h'
--- a/sql/sys_vars.h	2011-03-09 20:54:55 +0000
+++ b/sql/sys_vars.h	2011-04-04 08:47:25 +0000
@@ -1725,16 +1725,3 @@ public:
   virtual bool global_update(THD *thd, set_var *var);
 };
 
-/****************************************************************************
-  Used templates
-****************************************************************************/
-
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-template class List<set_var_base>;
-template class List_iterator_fast<set_var_base>;
-template class Sys_var_unsigned<uint, GET_UINT, SHOW_INT>;
-template class Sys_var_unsigned<ulong, GET_ULONG, SHOW_LONG>;
-template class Sys_var_unsigned<ha_rows, GET_HA_ROWS, SHOW_HA_ROWS>;
-template class Sys_var_unsigned<ulonglong, GET_ULL, SHOW_LONGLONG>;
-#endif
-

=== modified file 'sql/table.cc'
--- a/sql/table.cc	2011-03-28 08:10:39 +0000
+++ b/sql/table.cc	2011-04-04 08:47:25 +0000
@@ -5488,13 +5488,3 @@ bool is_simple_order(ORDER *order)
   }
   return TRUE;
 }
-
-
-/*****************************************************************************
-** Instansiate templates
-*****************************************************************************/
-
-#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
-template class List<String>;
-template class List_iterator<String>;
-#endif

=== modified file 'unittest/gunit/CMakeLists.txt'
--- a/unittest/gunit/CMakeLists.txt	2011-02-17 14:39:47 +0000
+++ b/unittest/gunit/CMakeLists.txt	2011-04-04 08:47:25 +0000
@@ -25,10 +25,6 @@ ELSE()
 ENDIF() 
 
 IF(CMAKE_COMPILER_IS_GNUCXX)
-  # Remove -fno-implicit-templates, gunit sources cannot be compiled with it.
-  STRING(REPLACE "-fno-implicit-templates" "" CMAKE_CXX_FLAGS
-    ${CMAKE_CXX_FLAGS})
-
   # MySQL is often compiled/linked with gcc rather than g++
   # (to avoid dependencies on libstdc++.so)
   # This does not work for googletest binaries.

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (tor.didriksen:3354 to 3355) Bug#11929733Tor Didriksen4 Apr