Commit a9acc8e6 authored by unknown's avatar unknown

- backported gcc 3.0 linking fix from 4.0

 - some cosmetical fixups (typos, comments)


client/mysqlbinlog.cc:
   - fix for gcc 3.0
configure.in:
   - fix for gcc 3.0
   - some cosmetic modifications (typos, comments)
include/global.h:
   - fix for gcc 3.0
   - some cosmetical fixes (typos, comments)
sql/mysqld.cc:
   - fix for gcc 3.0
parent 41f7307a
...@@ -470,3 +470,5 @@ int main(int argc, char** argv) ...@@ -470,3 +470,5 @@ int main(int argc, char** argv)
#else #else
#include "log_event.cc" #include "log_event.cc"
#endif #endif
FIX_GCC_LINKING_PROBLEM
...@@ -319,7 +319,7 @@ then ...@@ -319,7 +319,7 @@ then
# mysqld doesn't use run-time-type-checking, so we disable it. # mysqld doesn't use run-time-type-checking, so we disable it.
CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti" CXXFLAGS="$CXXFLAGS -fno-implicit-templates -fno-exceptions -fno-rtti"
# If you are using 'gcc' 3.0 (not g++) to compile C++ programs, # If you are using 'gcc' 3.0 (not g++) to compile C++ programs on Linux,
# we will gets some problems when linking static programs. # we will gets some problems when linking static programs.
# The following code is used to fix this problem. # The following code is used to fix this problem.
...@@ -327,8 +327,7 @@ then ...@@ -327,8 +327,7 @@ then
then then
if $CXX -v 2>&1 | grep 'version 3' > /dev/null 2>&1 if $CXX -v 2>&1 | grep 'version 3' > /dev/null 2>&1
then then
CXXFLAGS="$CXXFLAGS -DUSE_MYSYS_NEW" CXXFLAGS="$CXXFLAGS -DUSE_MYSYS_NEW -DDEFINE_CXA_PURE_VIRTUAL"
CXXLDFLAGS="$CXXLDFLAGS -Wl,--defsym -Wl,__cxa_pure_virtual=0"
fi fi
fi fi
fi fi
...@@ -368,6 +367,7 @@ AC_PATH_PROG(HOSTNAME, hostname, hostname) ...@@ -368,6 +367,7 @@ AC_PATH_PROG(HOSTNAME, hostname, hostname)
# Check for a GNU tar named 'gtar', or 'gnutar' (MacOS X) and # Check for a GNU tar named 'gtar', or 'gnutar' (MacOS X) and
# fall back to 'tar' otherwise and hope that it's a GNU tar as well # fall back to 'tar' otherwise and hope that it's a GNU tar as well
AC_CHECK_PROGS(TAR, gnutar gtar tar) AC_CHECK_PROGS(TAR, gnutar gtar tar)
dnl We use a path for perl so the script startup works dnl We use a path for perl so the script startup works
dnl We make sure to use perl, not perl5, in hopes that the RPMs will dnl We make sure to use perl, not perl5, in hopes that the RPMs will
dnl not depend on the perl5 binary being installed (probably a bug in RPM) dnl not depend on the perl5 binary being installed (probably a bug in RPM)
...@@ -654,15 +654,13 @@ AC_ARG_WITH(mysqld-user, ...@@ -654,15 +654,13 @@ AC_ARG_WITH(mysqld-user,
) )
AC_SUBST(MYSQLD_USER) AC_SUBST(MYSQLD_USER)
# If we should allove LOAD DATA LOCAL # If we should allow LOAD DATA LOCAL
AC_MSG_CHECKING(if we should should enable LOAD DATA LOCAL by default) AC_MSG_CHECKING(if we should should enable LOAD DATA LOCAL by default)
AC_ARG_ENABLE(local-infile, AC_ARG_ENABLE(local-infile,
[ --enable-local-infile [ --enable-local-infile Enable LOAD DATA LOCAL INFILE (default: disabled)],
Enable LOAD DATA LOCAL INFILE (default: disabled)],
[ ENABLED_LOCAL_INFILE=$enableval ], [ ENABLED_LOCAL_INFILE=$enableval ],
[ ENABLED_LOCAL_INFILE=no ] [ ENABLED_LOCAL_INFILE=no ]
) )
if test "$ENABLED_LOCAL_INFILE" = "yes" if test "$ENABLED_LOCAL_INFILE" = "yes"
then then
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
...@@ -724,7 +722,7 @@ MYSQL_CHECK_ZLIB_WITH_COMPRESS($with_named_zlib) ...@@ -724,7 +722,7 @@ MYSQL_CHECK_ZLIB_WITH_COMPRESS($with_named_zlib)
#-------------------------------------------------------------------- #--------------------------------------------------------------------
AC_ARG_WITH(libwrap, AC_ARG_WITH(libwrap,
[ --with-libwrap[=DIR] Compile in libwrap (tcp_wrappers) support],[ [ --with-libwrap[=DIR] Compile in libwrap (tcp_wrappers) support],[
case "$with_libwrap" in case "$with_libwrap" in
no) : ;; no) : ;;
yes|*) yes|*)
...@@ -1346,6 +1344,7 @@ else ...@@ -1346,6 +1344,7 @@ else
DEBUG_OPTIMIZE_CXX="" DEBUG_OPTIMIZE_CXX=""
OPTIMIZE_CXXFLAGS="-O" OPTIMIZE_CXXFLAGS="-O"
fi fi
AC_ARG_WITH(debug, AC_ARG_WITH(debug,
[ --without-debug Build a production version without debugging code], [ --without-debug Build a production version without debugging code],
[with_debug=$withval], [with_debug=$withval],
...@@ -1578,13 +1577,15 @@ ac_save_CXXFLAGS="$CXXFLAGS" ...@@ -1578,13 +1577,15 @@ ac_save_CXXFLAGS="$CXXFLAGS"
AC_CACHE_CHECK([style of gethost* routines], mysql_cv_gethost_style, AC_CACHE_CHECK([style of gethost* routines], mysql_cv_gethost_style,
AC_LANG_SAVE AC_LANG_SAVE
AC_LANG_CPLUSPLUS AC_LANG_CPLUSPLUS
# Do not treat warnings as errors if we are linking agaist other libc
# Do not treat warnings as errors if we are linking against other libc
# this is to work around gcc not being permissive on non-system includes # this is to work around gcc not being permissive on non-system includes
# with respect to ANSI C++ # with respect to ANSI C++
if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no" if test "$ac_cv_prog_gxx" = "yes" -a "$with_other_libc" = "no"
then then
CXXFLAGS="$CXXFLAGS -Werror" CXXFLAGS="$CXXFLAGS -Werror"
fi fi
AC_TRY_COMPILE( AC_TRY_COMPILE(
[#undef inline [#undef inline
#if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT) #if !defined(SCO) && !defined(__osf__) && !defined(_REENTRANT)
......
...@@ -135,6 +135,13 @@ double my_ulonglong2double(unsigned long long A); ...@@ -135,6 +135,13 @@ double my_ulonglong2double(unsigned long long A);
#define __LONG_MAX__ 2147483647 #define __LONG_MAX__ 2147483647
#endif #endif
/* Fix problem when linking c++ programs with gcc 3.x */
#ifdef DEFINE_CXA_PURE_VIRTUAL
#define FIX_GCC_LINKING_PROBLEM extern "C" { int __cxa_pure_virtual() {return 0;} }
#else
#define FIX_GCC_LINKING_PROBLEM
#endif
/* egcs 1.1.2 has a problem with memcpy on Alpha */ /* egcs 1.1.2 has a problem with memcpy on Alpha */
#if defined(__GNUC__) && defined(__alpha__) && ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) #if defined(__GNUC__) && defined(__alpha__) && ! (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95))
#define BAD_MEMCPY #define BAD_MEMCPY
...@@ -270,7 +277,7 @@ int __void__; ...@@ -270,7 +277,7 @@ int __void__;
#define LINT_INIT(var) #define LINT_INIT(var)
#endif #endif
/* Define som useful general macros */ /* Define some useful general macros */
#if defined(__cplusplus) && defined(__GNUC__) #if defined(__cplusplus) && defined(__GNUC__)
#define max(a, b) ((a) >? (b)) #define max(a, b) ((a) >? (b))
#define min(a, b) ((a) <? (b)) #define min(a, b) ((a) <? (b))
...@@ -296,7 +303,7 @@ typedef unsigned short ushort; ...@@ -296,7 +303,7 @@ typedef unsigned short ushort;
#define rint(A) floor((A)+0.5) #define rint(A) floor((A)+0.5)
#endif #endif
/* Define som general constants */ /* Define some general constants */
#ifndef TRUE #ifndef TRUE
#define TRUE (1) /* Logical true */ #define TRUE (1) /* Logical true */
#define FALSE (0) /* Logical false */ #define FALSE (0) /* Logical false */
...@@ -316,9 +323,11 @@ typedef unsigned short ushort; ...@@ -316,9 +323,11 @@ typedef unsigned short ushort;
/* From old s-system.h */ /* From old s-system.h */
/* Support macros for non ansi & other old compilers. Since such /*
things are no longer supported we do nothing. We keep then since Support macros for non ansi & other old compilers. Since such
some of our code may still be needed to upgrade old customers. */ things are no longer supported we do nothing. We keep then since
some of our code may still be needed to upgrade old customers.
*/
#define _VARARGS(X) X #define _VARARGS(X) X
#define _STATIC_VARARGS(X) X #define _STATIC_VARARGS(X) X
#define _PC(X) X #define _PC(X) X
...@@ -440,12 +449,16 @@ typedef SOCKET_SIZE_TYPE size_socket; ...@@ -440,12 +449,16 @@ typedef SOCKET_SIZE_TYPE size_socket;
/* #define FN_NO_CASE_SENCE */ /* #define FN_NO_CASE_SENCE */
/* #define FN_UPPER_CASE TRUE */ /* #define FN_UPPER_CASE TRUE */
/* Io buffer size; Must be a power of 2 and a multiple of 512. May be /*
smaller what the disk page size. This influences the speed of the Io buffer size; Must be a power of 2 and a multiple of 512. May be
isam btree library. eg to big to slow. */ smaller what the disk page size. This influences the speed of the
isam btree library. eg to big to slow.
*/
#define IO_SIZE 4096 #define IO_SIZE 4096
/* How much overhead does malloc have. The code often allocates /*
something like 1024-MALLOC_OVERHEAD bytes */ How much overhead does malloc have. The code often allocates
something like 1024-MALLOC_OVERHEAD bytes
*/
#ifdef SAFEMALLOC #ifdef SAFEMALLOC
#define MALLOC_OVERHEAD (8+24+4) #define MALLOC_OVERHEAD (8+24+4)
#else #else
...@@ -563,8 +576,10 @@ extern double my_atof(const char*); ...@@ -563,8 +576,10 @@ extern double my_atof(const char*);
#define FLT_MAX ((float)3.40282346638528860e+38) #define FLT_MAX ((float)3.40282346638528860e+38)
#endif #endif
/* Max size that must be added to a so that we know Size to make /*
adressable obj. */ Max size that must be added to a so that we know Size to make
adressable obj.
*/
typedef long my_ptrdiff_t; typedef long my_ptrdiff_t;
#define MY_ALIGN(A,L) (((A) + (L) - 1) & ~((L) - 1)) #define MY_ALIGN(A,L) (((A) + (L) - 1) & ~((L) - 1))
#define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double)) #define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double))
...@@ -635,8 +650,10 @@ typedef long longlong; ...@@ -635,8 +650,10 @@ typedef long longlong;
#endif #endif
#ifdef USE_RAID #ifdef USE_RAID
/* The following is done with a if to not get problems with pre-processors /*
with late define evaluation */ The following is done with a if to not get problems with pre-processors
with late define evaluation
*/
#if SIZEOF_OFF_T == 4 #if SIZEOF_OFF_T == 4
#define SYSTEM_SIZEOF_OFF_T 4 #define SYSTEM_SIZEOF_OFF_T 4
#else #else
...@@ -700,8 +717,10 @@ typedef char bool; /* Ordinary boolean values 0 1 */ ...@@ -700,8 +717,10 @@ typedef char bool; /* Ordinary boolean values 0 1 */
#define INT32(v) (int32) (v) #define INT32(v) (int32) (v)
#define MYF(v) (myf) (v) #define MYF(v) (myf) (v)
/* Defines to make it possible to prioritize register assignments. No /*
longer needed with moder compilers */ Defines to make it possible to prioritize register assignments. No
longer that important with modern compilers.
*/
#ifndef USING_X #ifndef USING_X
#define reg1 register #define reg1 register
#define reg2 register #define reg2 register
...@@ -902,9 +921,11 @@ typedef union { ...@@ -902,9 +921,11 @@ typedef union {
#endif /* sint2korr */ #endif /* sint2korr */
/* Define-funktions for reading and storing in machine format from/to /*
short/long to/from some place in memory V should be a (not Define-funktions for reading and storing in machine format from/to
register) variable, M is a pointer to byte */ short/long to/from some place in memory V should be a (not
register) variable, M is a pointer to byte
*/
#ifdef WORDS_BIGENDIAN #ifdef WORDS_BIGENDIAN
......
...@@ -4289,4 +4289,6 @@ template class I_List<THD>; ...@@ -4289,4 +4289,6 @@ template class I_List<THD>;
template class I_List_iterator<THD>; template class I_List_iterator<THD>;
template class I_List<i_string>; template class I_List<i_string>;
template class I_List<i_string_pair>; template class I_List<i_string_pair>;
FIX_GCC_LINKING_PROBLEM
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment