Commit b80f1abd authored by unknown's avatar unknown

Changed -O6 to -O3

Portability fix for Innodb


BUILD/compile-pentium-max:
  Change mode to -rwxrwxr-x
BUILD/SETUP.sh:
  Changed -O6 to -O3
Docs/manual.texi:
  Changed -O6 to -O3
configure.in:
  Changed -O6 to -O3
  Added test of pthread_yield (For Innodb)
innobase/os/os0thread.c:
  Fix portability problem with RedHat 6.1
scripts/safe_mysqld.sh:
  Fix option --mysqld-version
sql/gen_lex_hash.cc:
  Smaller array
support-files/mysql.spec.sh:
  Changed -O6 to -O3
parent 83ac3fd6
...@@ -43,8 +43,8 @@ alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet ...@@ -43,8 +43,8 @@ alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet
pentium_cflags="-mpentiumpro" pentium_cflags="-mpentiumpro"
sparc_cflags="" sparc_cflags=""
fast_cflags="-O6 -fno-omit-frame-pointer" fast_cflags="-O3 -fno-omit-frame-pointer"
reckless_cflags="-O6 -fomit-frame-pointer -ffixed-ebp" reckless_cflags="-O3 -fomit-frame-pointer -ffixed-ebp"
debug_cflags="-DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -DSAFEMALLOC -DSAFE_MUTEX -O2" debug_cflags="-DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -DSAFEMALLOC -DSAFE_MUTEX -O2"
base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti" base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti"
......
File mode changed from 100644 to 100755
...@@ -6152,13 +6152,13 @@ the compiler you are using: ...@@ -6152,13 +6152,13 @@ the compiler you are using:
@tindex environment variable, CXXFLAGS @tindex environment variable, CXXFLAGS
@multitable @columnfractions .20 .80 @multitable @columnfractions .20 .80
@item gcc 2.7.2.1 @tab @item gcc 2.7.2.1 @tab
CC=gcc CXX=gcc CXXFLAGS="-O6 -felide-constructors" CC=gcc CXX=gcc CXXFLAGS="-O3 -felide-constructors"
@item egcs 1.0.3a @tab @item egcs 1.0.3a @tab
CC=gcc CXX=gcc CXXFLAGS="-O6 -felide-constructors -fno-exceptions -fno-rtti" CC=gcc CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti"
@item gcc 2.95.2 @tab @item gcc 2.95.2 @tab
CFLAGS="-O6 -mpentiumpro" CXX=gcc CXXFLAGS="-O6 -mpentiumpro -felide-constructors -fno-exceptions -fno-rtti" CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro -felide-constructors -fno-exceptions -fno-rtti"
@item pgcc 2.90.29 or newer @tab @item pgcc 2.90.29 or newer @tab
CFLAGS="-O6 -mpentiumpro -mstack-align-double" CXX=gcc CXXFLAGS="-O6 -mpentiumpro -mstack-align-double -felide-constructors -fno-exceptions -fno-rtti" CFLAGS="-O3 -mpentiumpro -mstack-align-double" CXX=gcc CXXFLAGS="-O3 -mpentiumpro -mstack-align-double -felide-constructors -fno-exceptions -fno-rtti"
@end multitable @end multitable
In most cases you can get a reasonably optimal @strong{MySQL} binary by In most cases you can get a reasonably optimal @strong{MySQL} binary by
...@@ -6173,7 +6173,7 @@ The full configure line would in other words be something like the ...@@ -6173,7 +6173,7 @@ The full configure line would in other words be something like the
following for all recent gcc versions: following for all recent gcc versions:
@example @example
CFLAGS="-O6 -mpentiumpro" CXX=gcc CXXFLAGS="-O6 -mpentiumpro -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static CFLAGS="-O3 -mpentiumpro" CXX=gcc CXXFLAGS="-O3 -mpentiumpro -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static
@end example @end example
The binaries we provide on the @strong{MySQL} Web site at The binaries we provide on the @strong{MySQL} Web site at
...@@ -6498,9 +6498,9 @@ and @code{CXX}. For example: ...@@ -6498,9 +6498,9 @@ and @code{CXX}. For example:
@example @example
shell> CC=gcc shell> CC=gcc
shell> CFLAGS=-O6 shell> CFLAGS=-O3
shell> CXX=gcc shell> CXX=gcc
shell> CXXFLAGS=-O6 shell> CXXFLAGS=-O3
shell> export CC CFLAGS CXX CXXFLAGS shell> export CC CFLAGS CXX CXXFLAGS
@end example @end example
...@@ -7017,8 +7017,8 @@ SPARC! ...@@ -7017,8 +7017,8 @@ SPARC!
The recommended @code{configure} line when using @code{gcc} 2.95.2 is: The recommended @code{configure} line when using @code{gcc} 2.95.2 is:
@example @example
CC=gcc CFLAGS="-O6" \ CC=gcc CFLAGS="-O3" \
CXX=gcc CXXFLAGS="-O6 -felide-constructors -fno-exceptions -fno-rtti" \ CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local/mysql --with-low-memory --enable-assembler ./configure --prefix=/usr/local/mysql --with-low-memory --enable-assembler
@end example @end example
...@@ -7231,9 +7231,9 @@ experience problems with core dumps under load, you should use the ...@@ -7231,9 +7231,9 @@ experience problems with core dumps under load, you should use the
following @code{configure} command: following @code{configure} command:
@example @example
CC=gcc CFLAGS="-O6 -fomit-frame-pointer -DHAVE_CURSES_H" \ CC=gcc CFLAGS="-O3 -fomit-frame-pointer -DHAVE_CURSES_H" \
CXX=gcc \ CXX=gcc \
CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti -DHAVE_CURSES_H" \ CXXFLAGS="-O3 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti -DHAVE_CURSES_H" \
./configure --prefix=/usr/local/mysql ./configure --prefix=/usr/local/mysql
@end example @end example
...@@ -7668,7 +7668,7 @@ CC=ccc CFLAGS="-fast" CXX=cxx CXXFLAGS="-fast -noexceptions -nortti" ./configure ...@@ -7668,7 +7668,7 @@ CC=ccc CFLAGS="-fast" CXX=cxx CXXFLAGS="-fast -noexceptions -nortti" ./configure
If you want to use egcs the following configure line worked for us: If you want to use egcs the following configure line worked for us:
@example @example
CFLAGS="-O6 -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --disable-shared CFLAGS="-O3 -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --disable-shared
@end example @end example
Some known problems when running @strong{MySQL} on Linux-Alpha: Some known problems when running @strong{MySQL} on Linux-Alpha:
...@@ -8484,7 +8484,7 @@ the definition in @file{pthread.h}. Here's the diff: ...@@ -8484,7 +8484,7 @@ the definition in @file{pthread.h}. Here's the diff:
After this, the following configure line should work: After this, the following configure line should work:
@example @example
CFLAGS="-fomit-frame-pointer -O6 -fpic" CXX=gcc CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti -O6" ./configure --prefix=/usr/local/mysql --disable-shared CFLAGS="-fomit-frame-pointer -O3 -fpic" CXX=gcc CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti -O3" ./configure --prefix=/usr/local/mysql --disable-shared
@end example @end example
Here is some information that a HPUX Version 11.x user sent us about compiling Here is some information that a HPUX Version 11.x user sent us about compiling
...@@ -9217,19 +9217,19 @@ and are configured with the following compilers and options: ...@@ -9217,19 +9217,19 @@ and are configured with the following compilers and options:
@code{CC=gcc CXX=gcc CXXFLAGS="-O3 -felide-constructors" ./configure --prefix=/usr/local/mysql --disable-shared --with-extra-charsets=complex --enable-assembler} @code{CC=gcc CXX=gcc CXXFLAGS="-O3 -felide-constructors" ./configure --prefix=/usr/local/mysql --disable-shared --with-extra-charsets=complex --enable-assembler}
@item SunOS 5.5.1 sun4u with @code{egcs} 1.0.3a @item SunOS 5.5.1 sun4u with @code{egcs} 1.0.3a
@code{CC=gcc CFLAGS="-O6 -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-low-memory --with-extra-charsets=complex} @code{CC=gcc CFLAGS="-O3 -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-low-memory --with-extra-charsets=complex}
@item SunOS 5.6 sun4u with @code{egcs} 2.90.27 @item SunOS 5.6 sun4u with @code{egcs} 2.90.27
@code{CC=gcc CFLAGS="-O6 -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-low-memory --with-extra-charsets=complex} @code{CC=gcc CFLAGS="-O3 -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-low-memory --with-extra-charsets=complex}
@item SunOS 5.6 i86pc with @code{gcc} 2.8.1 @item SunOS 5.6 i86pc with @code{gcc} 2.8.1
@code{CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-low-memory --with-extra-charsets=complex} @code{CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-low-memory --with-extra-charsets=complex}
@item Linux 2.0.33 i386 with @code{pgcc} 2.90.29 (@code{egcs} 1.0.3a) @item Linux 2.0.33 i386 with @code{pgcc} 2.90.29 (@code{egcs} 1.0.3a)
@code{CFLAGS="-O6 -mpentium -mstack-align-double -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -mpentium -mstack-align-double -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static --with-extra-charsets=complex} @code{CFLAGS="-O3 -mpentium -mstack-align-double -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -mpentium -mstack-align-double -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static --with-extra-charsets=complex}
@item Linux 2.2.x with x686 with @code{gcc} 2.95.2 @item Linux 2.2.x with x686 with @code{gcc} 2.95.2
@code{CFLAGS="-O6 -mpentiumpro -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O6 -mpentiumpro -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static --disable-shared --with-extra-charset=complex} @code{CFLAGS="-O3 -mpentiumpro -fomit-frame-pointer" CXX=gcc CXXFLAGS="-O3 -mpentiumpro -fomit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --enable-assembler --with-mysqld-ldflags=-all-static --disable-shared --with-extra-charset=complex}
@item SCO 3.2v5.0.4 i386 with @code{gcc} 2.7-95q4 @item SCO 3.2v5.0.4 i386 with @code{gcc} 2.7-95q4
@code{CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex} @code{CC=gcc CXX=gcc CXXFLAGS=-O3 ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex}
...@@ -28250,7 +28250,7 @@ other operating systems and workloads. ...@@ -28250,7 +28250,7 @@ other operating systems and workloads.
You get the fastest executable when you link with @code{-static}. You get the fastest executable when you link with @code{-static}.
On Linux, you will get the fastest code when compiling with @code{pgcc} On Linux, you will get the fastest code when compiling with @code{pgcc}
and @code{-O6}. To compile @file{sql_yacc.cc} with these options, you and @code{-O3}. To compile @file{sql_yacc.cc} with these options, you
need about 200M memory because @code{gcc/pgcc} needs a lot of memory to need about 200M memory because @code{gcc/pgcc} needs a lot of memory to
make all functions inline. You should also set @code{CXX=gcc} when make all functions inline. You should also set @code{CXX=gcc} when
configuring @strong{MySQL} to avoid inclusion of the @code{libstdc++} configuring @strong{MySQL} to avoid inclusion of the @code{libstdc++}
...@@ -48577,7 +48577,7 @@ lists the @code{mysqld} version as @code{mysql ... -debug} in this case. ...@@ -48577,7 +48577,7 @@ lists the @code{mysqld} version as @code{mysql ... -debug} in this case.
If you are using gcc or egcs, the recommended configure line is: If you are using gcc or egcs, the recommended configure line is:
@example @example
CC=gcc CFLAGS="-O6" CXX=gcc CXXFLAGS="-O6 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-debug --with-extra-charsets=complex CC=gcc CFLAGS="-O2" CXX=gcc CXXFLAGS="-O2 -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-debug --with-extra-charsets=complex
@end example @end example
This will avoid problems with the @code{libstdc++} library and with C++ This will avoid problems with the @code{libstdc++} library and with C++
...@@ -691,7 +691,7 @@ int main() ...@@ -691,7 +691,7 @@ int main()
# Some system specific hacks # Some system specific hacks
# #
MAX_C_OPTIMIZE="-O6" MAX_C_OPTIMIZE="-O3"
case $SYSTEM_TYPE in case $SYSTEM_TYPE in
*solaris2.7*) *solaris2.7*)
...@@ -1333,7 +1333,7 @@ AC_CHECK_FUNCS(alarm bmove \ ...@@ -1333,7 +1333,7 @@ AC_CHECK_FUNCS(alarm bmove \
sigset sigthreadmask pthread_sigmask pthread_setprio pthread_setprio_np \ sigset sigthreadmask pthread_sigmask pthread_setprio pthread_setprio_np \
pthread_setschedparam pthread_attr_setprio pthread_attr_setschedparam \ pthread_setschedparam pthread_attr_setprio pthread_attr_setschedparam \
pthread_attr_create pthread_getsequence_np pthread_attr_setstacksize \ pthread_attr_create pthread_getsequence_np pthread_attr_setstacksize \
pthread_condattr_create rwlock_init pthread_rwlock_rdlock \ pthread_condattr_create rwlock_init pthread_rwlock_rdlock pthread_yield\
dlopen dlerror fchmod getpass getpassphrase initgroups mlockall) dlopen dlerror fchmod getpass getpassphrase initgroups mlockall)
# Sanity check: We chould not have any fseeko symbol unless # Sanity check: We chould not have any fseeko symbol unless
......
...@@ -135,10 +135,12 @@ void ...@@ -135,10 +135,12 @@ void
os_thread_yield(void) os_thread_yield(void)
/*=================*/ /*=================*/
{ {
#ifdef __WIN__ #if defined(__WIN__)
Sleep(0); Sleep(0);
#else #elif defined(HAVE_PTHREAD_YIELD)
pthread_yield(); pthread_yield();
#else
os_thread_sleep(0);
#endif #endif
} }
......
...@@ -52,7 +52,15 @@ parse_arguments() { ...@@ -52,7 +52,15 @@ parse_arguments() {
--core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core_file_size=;;"` ;; --core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core_file_size=;;"` ;;
--timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;; --timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;;
--mysqld=*) MYSQLD=`echo "$arg" | sed -e "s;--mysqld=;;"` ;; --mysqld=*) MYSQLD=`echo "$arg" | sed -e "s;--mysqld=;;"` ;;
--mysqld-version=*) MYSQLD=mysqld-`echo "$arg" | sed -e "s;--mysqld-version=;;"` ;; --mysqld-version=*)
tmp=`echo "$arg" | sed -e "s;--mysqld-version=;;"`
if test -n "$tmp"
then
MYSQLD="mysqld-$tmp"
else
MYSQLD="mysqld"
fi
;;
*) *)
if test -n "$pick_args" if test -n "$pick_args"
then then
...@@ -73,7 +81,7 @@ then ...@@ -73,7 +81,7 @@ then
MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are
ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is
DATADIR=$MY_BASEDIR_VERSION/data DATADIR=$MY_BASEDIR_VERSION/data
if test -z "defaults" if test -z "$defaults"
then then
defaults="--defaults-extra-file=$MY_BASEDIR_VERSION/data/my.cnf" defaults="--defaults-extra-file=$MY_BASEDIR_VERSION/data/my.cnf"
fi fi
......
...@@ -472,7 +472,7 @@ int main(int argc,char **argv) ...@@ -472,7 +472,7 @@ int main(int argc,char **argv)
int error; int error;
MY_INIT(argv[0]); MY_INIT(argv[0]);
start_value=4997167L; best_t1=4533271L; best_t2=7512314L; best_type=4; start_value=323040L; best_t1=8119093L; best_t2=4787828L; best_type=4; /* mode=4651 add=3 type: 0 */
if (get_options(argc,(char **) argv)) if (get_options(argc,(char **) argv))
exit(1); exit(1);
......
...@@ -151,11 +151,11 @@ BuildMySQL() { ...@@ -151,11 +151,11 @@ BuildMySQL() {
# support assembler speedups. # support assembler speedups.
sh -c "PATH=\"${MYSQL_BUILD_PATH:-/bin:/usr/bin}\" \ sh -c "PATH=\"${MYSQL_BUILD_PATH:-/bin:/usr/bin}\" \
CC=\"${MYSQL_BUILD_CC:-egcs}\" \ CC=\"${MYSQL_BUILD_CC:-egcs}\" \
CFLAGS=\"${MYSQL_BUILD_CFLAGS:- -O6 -fno-omit-frame-pointer}\" \ CFLAGS=\"${MYSQL_BUILD_CFLAGS:- -O3}\" \
CXX=\"${MYSQL_BUILD_CXX:-egcs}\" \ CXX=\"${MYSQL_BUILD_CXX:-egcs}\" \
CXXFLAGS=\"${MYSQL_BUILD_CXXFLAGS:- -O6 \ CXXFLAGS=\"${MYSQL_BUILD_CXXFLAGS:- -O3 \
-felide-constructors -fno-exceptions -fno-rtti \ -felide-constructors -fno-exceptions -fno-rtti \
-fno-omit-frame-pointer}\" \ }\" \
./configure \ ./configure \
$* \ $* \
--enable-assembler \ --enable-assembler \
......
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