summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@donna.mysql.fi>2001-04-13 22:09:33 +0300
committerunknown <monty@donna.mysql.fi>2001-04-13 22:09:33 +0300
commit6efc95d5a0145eabcc389f2bce922cc1f89da35b (patch)
tree334db2402b4aee273ded1ee0710570238dbc373a
parent00b254969dd99527dc1897f354e4f55490980670 (diff)
downloadmariadb-git-6efc95d5a0145eabcc389f2bce922cc1f89da35b.tar.gz
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
-rw-r--r--BUILD/SETUP.sh4
-rwxr-xr-x[-rw-r--r--]BUILD/compile-pentium-max0
-rw-r--r--Docs/manual.texi38
-rw-r--r--configure.in4
-rw-r--r--innobase/os/os0thread.c6
-rw-r--r--scripts/safe_mysqld.sh12
-rw-r--r--sql/gen_lex_hash.cc2
-rw-r--r--support-files/mysql.spec.sh6
8 files changed, 41 insertions, 31 deletions
diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh
index d1de9ab12e7..1f45c5c18cb 100644
--- a/BUILD/SETUP.sh
+++ b/BUILD/SETUP.sh
@@ -43,8 +43,8 @@ alpha_cflags="-mcpu=ev6 -Wa,-mev6" # Not used yet
pentium_cflags="-mpentiumpro"
sparc_cflags=""
-fast_cflags="-O6 -fno-omit-frame-pointer"
-reckless_cflags="-O6 -fomit-frame-pointer -ffixed-ebp"
+fast_cflags="-O3 -fno-omit-frame-pointer"
+reckless_cflags="-O3 -fomit-frame-pointer -ffixed-ebp"
debug_cflags="-DEXTRA_DEBUG -DFORCE_INIT_OF_VARS -DSAFEMALLOC -DSAFE_MUTEX -O2"
base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti"
diff --git a/BUILD/compile-pentium-max b/BUILD/compile-pentium-max
index 5fb4c1f89d2..5fb4c1f89d2 100644..100755
--- a/BUILD/compile-pentium-max
+++ b/BUILD/compile-pentium-max
diff --git a/Docs/manual.texi b/Docs/manual.texi
index d3811a14b2e..bd9ff1b73ac 100644
--- a/Docs/manual.texi
+++ b/Docs/manual.texi
@@ -6152,13 +6152,13 @@ the compiler you are using:
@tindex environment variable, CXXFLAGS
@multitable @columnfractions .20 .80
@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
-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
-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
-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
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
following for all recent gcc versions:
@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
The binaries we provide on the @strong{MySQL} Web site at
@@ -6498,9 +6498,9 @@ and @code{CXX}. For example:
@example
shell> CC=gcc
-shell> CFLAGS=-O6
+shell> CFLAGS=-O3
shell> CXX=gcc
-shell> CXXFLAGS=-O6
+shell> CXXFLAGS=-O3
shell> export CC CFLAGS CXX CXXFLAGS
@end example
@@ -7017,8 +7017,8 @@ SPARC!
The recommended @code{configure} line when using @code{gcc} 2.95.2 is:
@example
-CC=gcc CFLAGS="-O6" \
-CXX=gcc CXXFLAGS="-O6 -felide-constructors -fno-exceptions -fno-rtti" \
+CC=gcc CFLAGS="-O3" \
+CXX=gcc CXXFLAGS="-O3 -felide-constructors -fno-exceptions -fno-rtti" \
./configure --prefix=/usr/local/mysql --with-low-memory --enable-assembler
@end example
@@ -7231,9 +7231,9 @@ experience problems with core dumps under load, you should use the
following @code{configure} command:
@example
-CC=gcc CFLAGS="-O6 -fomit-frame-pointer -DHAVE_CURSES_H" \
+CC=gcc CFLAGS="-O3 -fomit-frame-pointer -DHAVE_CURSES_H" \
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
@end example
@@ -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:
@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
Some known problems when running @strong{MySQL} on Linux-Alpha:
@@ -8484,7 +8484,7 @@ the definition in @file{pthread.h}. Here's the diff:
After this, the following configure line should work:
@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
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:
@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
-@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
-@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
@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)
-@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
-@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
@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.
You get the fastest executable when you link with @code{-static}.
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
make all functions inline. You should also set @code{CXX=gcc} when
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.
If you are using gcc or egcs, the recommended configure line is:
@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
This will avoid problems with the @code{libstdc++} library and with C++
diff --git a/configure.in b/configure.in
index f230f454690..807de749b73 100644
--- a/configure.in
+++ b/configure.in
@@ -691,7 +691,7 @@ int main()
# Some system specific hacks
#
-MAX_C_OPTIMIZE="-O6"
+MAX_C_OPTIMIZE="-O3"
case $SYSTEM_TYPE in
*solaris2.7*)
@@ -1333,7 +1333,7 @@ AC_CHECK_FUNCS(alarm bmove \
sigset sigthreadmask pthread_sigmask pthread_setprio pthread_setprio_np \
pthread_setschedparam pthread_attr_setprio pthread_attr_setschedparam \
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)
# Sanity check: We chould not have any fseeko symbol unless
diff --git a/innobase/os/os0thread.c b/innobase/os/os0thread.c
index 9185542e0aa..78b159cf808 100644
--- a/innobase/os/os0thread.c
+++ b/innobase/os/os0thread.c
@@ -135,10 +135,12 @@ void
os_thread_yield(void)
/*=================*/
{
-#ifdef __WIN__
+#if defined(__WIN__)
Sleep(0);
-#else
+#elif defined(HAVE_PTHREAD_YIELD)
pthread_yield();
+#else
+ os_thread_sleep(0);
#endif
}
diff --git a/scripts/safe_mysqld.sh b/scripts/safe_mysqld.sh
index cc06d20668f..6c006e96768 100644
--- a/scripts/safe_mysqld.sh
+++ b/scripts/safe_mysqld.sh
@@ -52,7 +52,15 @@ parse_arguments() {
--core-file-size=*) core_file_size=`echo "$arg" | sed -e "s;--core_file_size=;;"` ;;
--timezone=*) TZ=`echo "$arg" | sed -e "s;--timezone=;;"` ; export TZ; ;;
--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"
then
@@ -73,7 +81,7 @@ then
MY_BASEDIR_VERSION=$MY_PWD # Where bin, share and data are
ledir=$MY_BASEDIR_VERSION/bin # Where mysqld is
DATADIR=$MY_BASEDIR_VERSION/data
- if test -z "defaults"
+ if test -z "$defaults"
then
defaults="--defaults-extra-file=$MY_BASEDIR_VERSION/data/my.cnf"
fi
diff --git a/sql/gen_lex_hash.cc b/sql/gen_lex_hash.cc
index edd61d03e27..d51618b578a 100644
--- a/sql/gen_lex_hash.cc
+++ b/sql/gen_lex_hash.cc
@@ -472,7 +472,7 @@ int main(int argc,char **argv)
int error;
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))
exit(1);
diff --git a/support-files/mysql.spec.sh b/support-files/mysql.spec.sh
index 3fd602dd818..410eae8975a 100644
--- a/support-files/mysql.spec.sh
+++ b/support-files/mysql.spec.sh
@@ -151,11 +151,11 @@ BuildMySQL() {
# support assembler speedups.
sh -c "PATH=\"${MYSQL_BUILD_PATH:-/bin:/usr/bin}\" \
CC=\"${MYSQL_BUILD_CC:-egcs}\" \
- CFLAGS=\"${MYSQL_BUILD_CFLAGS:- -O6 -fno-omit-frame-pointer}\" \
+ CFLAGS=\"${MYSQL_BUILD_CFLAGS:- -O3}\" \
CXX=\"${MYSQL_BUILD_CXX:-egcs}\" \
- CXXFLAGS=\"${MYSQL_BUILD_CXXFLAGS:- -O6 \
+ CXXFLAGS=\"${MYSQL_BUILD_CXXFLAGS:- -O3 \
-felide-constructors -fno-exceptions -fno-rtti \
- -fno-omit-frame-pointer}\" \
+ }\" \
./configure \
$* \
--enable-assembler \