Skip to content

Commit 74373e7

Browse files
WL#2286 - Compile MySQL w/YASSL support
Fix GCC 4.0 link failure. Better CXX_VERSION guessing.
1 parent c45df76 commit 74373e7

27 files changed

Lines changed: 67 additions & 49 deletions

config/ac-macros/misc.m4

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,3 +710,30 @@ fi
710710
])
711711

712712

713+
AC_DEFUN([MYSQL_CHECK_CXX_VERSION], [
714+
case $SYSTEM_TYPE in
715+
*netware*)
716+
CXX_VERSION=`$CXX -version | grep -i version`
717+
;;
718+
*)
719+
CXX_VERSION=`$CXX --version | sed 1q`
720+
if test $? -ne "0" -o -z "$CXX_VERSION"
721+
then
722+
CXX_VERSION=`$CXX -V 2>&1|sed 1q` # trying harder for Sun and SGI
723+
fi
724+
if test $? -ne "0" -o -z "$CXX_VERSION"
725+
then
726+
CXX_VERSION=`$CXX -v 2>&1|sed 1q` # even harder for Alpha
727+
fi
728+
if test $? -ne "0" -o -z "$CXX_VERSION"
729+
then
730+
CXX_VERSION=""
731+
fi
732+
esac
733+
if test "$CXX_VERSION"
734+
then
735+
AC_MSG_CHECKING("C++ compiler version");
736+
AC_MSG_RESULT("$CXX $CXX_VERSION")
737+
fi
738+
AC_SUBST(CXX_VERSION)
739+
])

configure.in

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -195,25 +195,8 @@ then
195195
else
196196
CC_VERSION=""
197197
fi
198-
case $SYSTEM_TYPE in
199-
*netware*)
200-
CXX_VERSION=`$CXX -version | grep -i version`
201-
;;
202-
*)
203-
CXX_VERSION=`$CXX --version | sed 1q`
204-
CXX_VERSION=${CXX_VERSION:-`$CXX -V|sed 1q`} # trying harder for Sun and SGI
205-
CXX_VERSION=${CXX_VERSION:-`$CXX -V 2>&1|sed 1q`} # even harder for Alpha
206-
;;
207-
esac
208-
if test $? -eq "0"
209-
then
210-
AC_MSG_CHECKING("C++ compiler version");
211-
AC_MSG_RESULT("$CXX $CXX_VERSION")
212-
else
213-
CXX_VERSION=""
214-
fi
215-
AC_SUBST(CXX_VERSION)
216198
AC_SUBST(CC_VERSION)
199+
MYSQL_CHECK_CXX_VERSION
217200

218201
# Fix for sgi gcc / sgiCC which tries to emulate gcc
219202
if test "$CC" = "sgicc"
@@ -367,18 +350,18 @@ then
367350
# Disable exceptions as they seams to create problems with gcc and threads.
368351
# mysqld doesn't use run-time-type-checking, so we disable it.
369352
CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti"
370-
CXXFLAGS="$CXXFLAGS -DEXPLICIT_TEMPLATE_INSTANTIATION"
353+
AC_DEFINE([HAVE_EXPLICIT_TEMPLATE_INSTANTIATION],
354+
[1], [Defined by configure. Explicit template instantiation.])
371355
fi
372356

373357
case $CXX_VERSION in
374358
MIPSpro*)
375-
CXXFLAGS="$CXXFLAGS -no_prelink -DEXPLICIT_TEMPLATE_INSTANTIATION"
376-
;;
377-
Compaq*)
378-
CXXFLAGS="$CXXFLAGS -nopt -DEXPLICIT_TEMPLATE_INSTANTIATION"
359+
AR=$CXX
360+
ARFLAGS="-ar -o"
379361
;;
380-
Forte*)
381-
CXXFLAGS="$CXXFLAGS -instance=explicit -DEXPLICIT_TEMPLATE_INSTANTIATION"
362+
*Forte*)
363+
AR=$CXX
364+
ARFLAGS="-xar -o"
382365
esac
383366

384367
# Avoid bug in fcntl on some versions of linux

extra/yassl/src/crypto_wrapper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ x509* PemToDer(const char* fname, CertType type)
971971
} // namespace
972972

973973

974-
#ifdef EXPLICIT_TEMPLATE_INSTANTIATION
974+
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
975975
namespace yaSSL {
976976
template void ysDelete<DiffieHellman::DHImpl>(DiffieHellman::DHImpl*);
977977
template void ysDelete<Integer::IntegerImpl>(Integer::IntegerImpl*);
@@ -989,6 +989,6 @@ template void ysDelete<RMD::RMDImpl>(RMD::RMDImpl*);
989989
template void ysDelete<SHA::SHAImpl>(SHA::SHAImpl*);
990990
template void ysDelete<MD5::MD5Impl>(MD5::MD5Impl*);
991991
}
992-
#endif // EXPLICIT_TEMPLATE_INSTANTIATION
992+
#endif // HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
993993

994994
#endif // !USE_CRYPTOPP_LIB

extra/yassl/src/template_instnt.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "ripemd.hpp"
99
#include "openssl/ssl.h"
1010

11-
#ifdef EXPLICIT_TEMPLATE_INSTANTIATION
11+
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
1212
#if !defined(USE_CRYPTOPP_LIB)
1313
namespace TaoCrypt {
1414
template class HMAC<MD5>;

extra/yassl/src/yassl_int.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* draft along with type conversion functions.
2525
*/
2626

27+
#include "runtime.hpp"
2728
#include "yassl_int.hpp"
2829
#include "handshake.hpp"
2930
#include "timer.hpp"
@@ -1975,7 +1976,7 @@ X509_NAME* X509::GetSubject()
19751976

19761977
} // namespace
19771978

1978-
#ifdef EXPLICIT_TEMPLATE_INSTANTIATION
1979+
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
19791980
namespace mySTL {
19801981
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);
19811982
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);

extra/yassl/taocrypt/include/runtime.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ extern "C" {
3535
#include <assert.h>
3636

3737
/* Disallow inline __cxa_pure_virtual() */
38-
static int __cxa_pure_virtual() __attribute__((noinline));
38+
static int __cxa_pure_virtual() __attribute__((noinline, used));
3939
static int __cxa_pure_virtual()
4040
{
4141
// oops, pure virtual called!

extra/yassl/taocrypt/include/types.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
#ifndef TAO_CRYPT_TYPES_HPP
2626
#define TAO_CRYPT_TYPES_HPP
2727

28+
#ifdef HAVE_CONFIG_H
29+
#include "config.h"
30+
#endif
31+
2832
namespace TaoCrypt {
2933

3034
// define this if running on a big-endian CPU

extra/yassl/taocrypt/src/algebra.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ void AbstractRing::SimultaneousExponentiate(Integer *results,
319319

320320
} // namespace
321321

322-
#ifdef EXPLICIT_TEMPLATE_INSTANTIATION
322+
#ifdef HAVE_EXPLICIT_TEMPLATE_INSTANTIATION
323323
namespace mySTL {
324324
template TaoCrypt::WindowSlider* uninit_copy<TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*>(TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*);
325325
template void destroy<TaoCrypt::WindowSlider*>(TaoCrypt::WindowSlider*, TaoCrypt::WindowSlider*);

extra/yassl/taocrypt/src/dh.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
/* dh.cpp implements Diffie-Hellman support
2424
*/
2525

26+
#include "runtime.hpp"
2627
#include "dh.hpp"
2728
#include "asn.hpp"
2829

extra/yassl/taocrypt/src/dsa.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
*/
2121

2222

23+
#include "runtime.hpp"
2324
#include "dsa.hpp"
2425
#include "sha.hpp"
2526
#include "asn.hpp"

0 commit comments

Comments
 (0)