Skip to content

Commit a5ee727

Browse files
author
Tor Didriksen
committed
WL#5825 Using C++ Standard Library with MySQL code
The goal of this worklog is to allow the use of the C++ Standard Library inside the code and to enable exceptions and RTTI for the MyQL code base. The goal is *not* to start using the the standard C++ library throughout the code base, just to ensure that it is possible.
1 parent 8c9d908 commit a5ee727

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+1398
-1376
lines changed

.bzr-mysql/default.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[MYSQL]
22
post_commit_to = "commits@lists.mysql.com"
33
post_push_to = "commits@lists.mysql.com"
4-
tree_name = "mysql-trunk"
4+
tree_name = "mysql-trunk-wl5825-stl"

BUILD/SETUP.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ debug_cflags="$debug_cflags -DSAFE_MUTEX"
151151
error_inject="--with-error-inject "
152152
#
153153
# Base C++ flags for all builds
154-
base_cxxflags="-felide-constructors -fno-exceptions -fno-rtti"
154+
base_cxxflags="-felide-constructors"
155155
#
156156
# Flags for optimizing builds.
157157
# Be as fast as we can be without losing our ability to backtrace.

BUILD/build_mccge.sh

+5-7
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,7 @@ extended_usage()
431431
432432
In all cases it is possible to override the definition of CC and CXX
433433
by calling the script as follows:
434-
CC="/usr/local/bin/gcc" CXX="/usr/local/bin/gcc" BUILD/build_mccge.sh
434+
CC="/usr/local/bin/gcc" CXX="/usr/local/bin/g++" BUILD/build_mccge.sh
435435
436436
Feedback profiler on gcc
437437
------------------------
@@ -1368,10 +1368,10 @@ set_icc_special_options()
13681368
set_cc_and_cxx_for_gcc()
13691369
{
13701370
if test "x$CC" = "x" ; then
1371-
CC="gcc -static-libgcc -fno-exceptions"
1371+
CC="gcc -static-libgcc"
13721372
fi
13731373
if test "x$CXX" = "x" ; then
1374-
CXX="gcc -static-libgcc -fno-exceptions"
1374+
CXX="g++ -static-libgcc"
13751375
fi
13761376
}
13771377

@@ -1388,10 +1388,10 @@ set_cc_and_cxx_for_icc()
13881388
set_cc_and_cxx_for_open64()
13891389
{
13901390
if test "x$CC" = "x" ; then
1391-
CC="opencc -static-libgcc -fno-exceptions"
1391+
CC="opencc -static-libgcc"
13921392
fi
13931393
if test "x$CXX" = "x" ; then
1394-
CXX="openCC -static-libgcc -fno-exceptions"
1394+
CXX="openCC -static-libgcc"
13951395
fi
13961396
}
13971397

@@ -1689,7 +1689,6 @@ set_solaris_configs()
16891689
fi
16901690
if test "x$cpu_base_type" = "xx86" ; then
16911691
compiler_flags="$compiler_flags -nofstore"
1692-
base_cxx_flags="$base_cxx_flags -features=no%except"
16931692
if test "x$fast_flag" = "xyes" ; then
16941693
compiler_flags="$compiler_flags -xregs=frameptr"
16951694
compiler_flags="$compiler_flags -xO4"
@@ -1705,7 +1704,6 @@ set_solaris_configs()
17051704
#Using SPARC cpu with SunStudio (Forte) compiler
17061705
ASFLAGS="$ASFLAGS -xarch=sparc"
17071706
LDFLAGS="$LDFLAGS -xarch=sparc"
1708-
base_cxxflags="$base_cxxflags -noex"
17091707
base_cflags="$base_cflags -xstrconst"
17101708
compiler_flags="$compiler_flags -xarch=sparc"
17111709
if test "x$fast_flag" = "xyes" ; then

BUILD/compile-alpha-debug

-27
This file was deleted.

BUILD/compile-darwin-mwcc

-65
This file was deleted.

BUILD/compile-dist

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ fi
4444
# Default to gcc for CC and CXX
4545
if test -z "$CXX" ; then
4646
export CXX
47-
CXX=gcc
47+
CXX=g++
4848
# Set some required compile options
4949
if test -z "$CXXFLAGS" ; then
5050
export CXXFLAGS
51-
CXXFLAGS="-felide-constructors -fno-exceptions -fno-rtti"
51+
CXXFLAGS="-felide-constructors"
5252
fi
5353
fi
5454

BUILD/compile-irix-mips64-mipspro

-94
This file was deleted.

BUILD/compile-pentium-icc

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ extra_flags="$fast_cflags -unroll2 -ip -mp -restrict"
3333
# IPO link: can not find "-lstdc++_shared"
3434
# icpc: error: problem during multi-file optimization compilation (code 1)
3535
extra_flags="$extra_flags -no-ipo"
36-
base_cxxflags="-fno-exceptions -fno-rtti"
3736
extra_configs="$pentium_configs $static_link"
3837

3938
. "$path/FINISH.sh"

BUILD/compile-pentium-icc-valgrind-max

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ extra_flags="$pentium_cflags $debug_cflags $valgrind_flags"
4343

4444
c_warnings="-Wall -Wcheck -wd161,444,279,810,981,1292,1469,1572"
4545
cxx_warnings="$c_warnings -wd869,874"
46-
base_cxxflags="-fno-exceptions -fno-rtti"
4746
extra_configs="$pentium_configs $debug_configs $valgrind_configs"
4847

4948
. "$path/FINISH.sh"

BUILD/compile-pentium-icc-yassl

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ extra_flags="$fast_cflags -unroll2 -ip -mp -restrict"
3333
# IPO link: can not find "-lstdc++_shared"
3434
# icpc: error: problem during multi-file optimization compilation (code 1)
3535
extra_flags="$extra_flags -no-ipo"
36-
base_cxxflags="-fno-exceptions -fno-rtti"
3736
extra_configs="$pentium_configs $static_link --with-yassl"
3837

3938
. "$path/FINISH.sh"

BUILD/compile-pentium-pgcc

-33
This file was deleted.

BUILD/compile-solaris-amd64

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ compiler_flags="-g -O3 -fno-omit-frame-pointer"
4040

4141
export CC CXX CFLAGS CXXFLAGS LDFLAGS LIBS
4242
CC="gcc"
43-
CXX="gcc"
43+
CXX="g++"
4444
CFLAGS="$warning_flags $compiler_flags"
4545
CXXFLAGS=""
4646
LDFLAGS="-O3 -g -static-libgcc"

BUILD/compile-solaris-amd64-forte

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ASFLAGS="$EXTRA_64_BIT"
3838
CC=cc-5.0
3939
CFLAGS="-Xa -xstrconst $STD"
4040
CXX=CC
41-
CXXFLAGS="-noex $STD"
41+
CXXFLAGS="$STD"
4242
LIBS=-lmtmalloc
4343
./configure \
4444
--prefix=/usr/local/mysql \

BUILD/compile-solaris-amd64-forte-debug

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ASFLAGS="$EXTRA_64_BIT"
4040
CC=cc-5.0
4141
CFLAGS="-Xa -xstrconst $STD"
4242
CXX=CC
43-
CXXFLAGS="-noex $STD"
43+
CXXFLAGS="$STD"
4444
./configure \
4545
--prefix=/usr/local/mysql \
4646
--localstatedir=/usr/local/mysql/data \

BUILD/compile-solaris-sparc

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ PATH=$PATH:/usr/ccs/bin:/usr/local/bin
2525
path=`dirname $0`
2626
. "$path/autorun.sh"
2727

28-
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa" CXX=gcc CXXFLAGS="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g" LIBS="-lmtmalloc" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client
28+
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa" CXX=g++ CXXFLAGS="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -O3 -fno-omit-frame-pointer -mcpu=v8 -Wa,-xarch=v8plusa -g" LIBS="-lmtmalloc" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client
2929

3030
make -j 4

BUILD/compile-solaris-sparc-debug

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ make -k clean || true
2121
path=`dirname $0`
2222
. "$path/autorun.sh"
2323

24-
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -O3 -fno-omit-frame-pointer" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-debug
24+
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -O3 -fno-omit-frame-pointer" CXX=g++ CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -O3 -fno-omit-frame-pointer" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-debug
2525

2626
make -j 4

BUILD/compile-solaris-sparc-forte

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ EXTRA="-fast" # Remove comment to target current machine
4545

4646
STD="-mt -D_FORTEC_ $EXTRA $EXTRA_64_BIT"
4747
CC=cc-5.0 CFLAGS="-Xa -xstrconst $STD" \
48-
CXX=CC CXXFLAGS="-noex $STD" LIBS="-lmtmalloc" \
48+
CXX=CC CXXFLAGS="$STD" LIBS="-lmtmalloc" \
4949
./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --prefix=$PREFIX
5050

5151
make -j 4

BUILD/compile-solaris-sparc-purify

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ make -k maintainer-clean || true
5252
path=`dirname $0`
5353
. "$path/autorun.sh"
5454

55-
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -DHAVE_purify -DEXTRA_DEBUG -O2" CXX=gcc CXXLD=g++ CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -DHAVE_purify -DEXTRA_DEBUG -O2" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-embedded-server --with-innodb $EXTRA_CONFIG_FLAGS
55+
CFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wimplicit-int -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -DHAVE_purify -DEXTRA_DEBUG -O2" CXX=g++ CXXLD=g++ CXXFLAGS="-g -Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -DHAVE_purify -DEXTRA_DEBUG -O2" ./configure --prefix=/usr/local/mysql --enable-assembler --with-extra-charsets=complex --enable-thread-safe-client --with-embedded-server --with-innodb $EXTRA_CONFIG_FLAGS
5656

5757
make -j 4
5858

0 commit comments

Comments
 (0)