diff --git a/build.inc b/build.inc index 62d1b00..11f4d40 100644 --- a/build.inc +++ b/build.inc @@ -8,7 +8,7 @@ export WARN_DIS=" -Wno-unused-parameter " %if 0%{?suse_version} > 1140 export WARN_DIS="$WARN_DIS -Wno-unused-but-set-variable " %endif -export CFLAGS="$RPM_OPT_FLAGS -DPIC -fPIC -DUNDEF_HAVE_INITGROUPS -DFORCE_INIT_OF_VARS -fno-strict-aliasing $WARN_DIS" +export CFLAGS="$RPM_OPT_FLAGS -DPIC -fPIC -DUNDEF_HAVE_INITGROUPS -DFORCE_INIT_OF_VARS $WARN_DIS" export CXXFLAGS="$CFLAGS -fno-exceptions -fno-rtti" # Make the compile a function, since we do multiple builds BuildMySQL() { @@ -18,6 +18,7 @@ BuildMySQL() { mkdir _build$suffix pushd _build$suffix ../configure \ + --with-libevent \ --enable-assembler \ --without-readline \ --infodir=%{_infodir} \ diff --git a/mariadb-strict-aliasing.patch b/mariadb-strict-aliasing.patch new file mode 100644 index 0000000..a494320 --- /dev/null +++ b/mariadb-strict-aliasing.patch @@ -0,0 +1,74 @@ +--- storage/pbxt/src/Makefile.am.orig ++++ storage/pbxt/src/Makefile.am +@@ -40,17 +40,19 @@ libpbxt_la_SOURCES = $(non_mysql_interna + # These are the warning Drizzle uses: + # DRIZZLE_WARNINGS = -W -Wall -Wextra -pedantic -Wundef -Wredundant-decls -Wno-strict-aliasing -Wno-long-long -Wno-unused-parameter + +-libpbxt_la_CXXFLAGS = -shared $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN +-libpbxt_la_CFLAGS = -shared $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN -std=c99 ++libpbxt_la_CXXFLAGS = -shared $(AM_CXXFLAGS) -fno-strict-aliasing -DMYSQL_DYNAMIC_PLUGIN ++libpbxt_la_CFLAGS = -shared $(AM_CFLAGS) -fno-strict-aliasing -DMYSQL_DYNAMIC_PLUGIN -std=c99 + libpbxt_la_LDFLAGS = -module + + noinst_LTLIBRARIES = libpbxt_s.la libpbxt_s_embedded.la libpbxt_s_common.la + + libpbxt_s_common_la_SOURCES = $(non_mysql_internal_sources) ++libpbxt_s_common_la_CXXFLAGS = $(AM_CXXFLAGS) -fno-strict-aliasing + libpbxt_s_la_SOURCES = $(mysql_internal_sources) ++libpbxt_s_la_CXXFLAGS = $(AM_CXXFLAGS) -fno-strict-aliasing + libpbxt_s_la_LIBADD = libpbxt_s_common.la + libpbxt_s_embedded_la_SOURCES = $(mysql_internal_sources) +-libpbxt_s_embedded_la_CXXFLAGS = $(AM_CXXFLAGS) @plugin_embedded_defs@ ++libpbxt_s_embedded_la_CXXFLAGS = $(AM_CXXFLAGS) -fno-strict-aliasing @plugin_embedded_defs@ + libpbxt_s_embedded_la_LIBADD = libpbxt_s_common.la + + EXTRA_DIST = pbms_enabled.cc win_inttypes.h +--- storage/innodb_plugin/buf/buf0flu.c.orig ++++ storage/innodb_plugin/buf/buf0flu.c +@@ -112,7 +112,9 @@ buf_flush_insert_in_flush_rbt( + p_node = rbt_prev(buf_pool->flush_rbt, c_node); + + if (p_node != NULL) { +- prev = *rbt_value(buf_page_t*, p_node); ++ buf_page_t** value; ++ value = rbt_value(buf_page_t*, p_node); ++ prev = *value; + ut_a(prev != NULL); + } + +--- storage/sphinx/Makefile.am.orig ++++ storage/sphinx/Makefile.am +@@ -35,17 +35,17 @@ pkgplugin_LTLIBRARIES = @plugin_sphinx_s + + ha_sphinx_la_LDFLAGS = -module -avoid-version -rpath $(MYSQLLIBdir) \ + -L$(top_builddir)/libservices -lmysqlservices +-ha_sphinx_la_CXXFLAGS= $(AM_CXXFLAGS) -DMYSQL_DYNAMIC_PLUGIN ++ha_sphinx_la_CXXFLAGS= $(AM_CXXFLAGS) -fno-strict-aliasing -DMYSQL_DYNAMIC_PLUGIN + ha_sphinx_la_CFLAGS = $(AM_CFLAGS) -DMYSQL_DYNAMIC_PLUGIN + ha_sphinx_la_SOURCES = ha_sphinx.cc + + sphinx_la_LDFLAGS = -module -avoid-version +-sphinx_la_CXXFLAGS = $(AM_CXXFLAGS) ++sphinx_la_CXXFLAGS = $(AM_CXXFLAGS) -fno-strict-aliasing + sphinx_la_CFLAGS = $(AM_CFLAGS) + sphinx_la_SOURCES = snippets_udf.cc + + noinst_LTLIBRARIES = @plugin_sphinx_static_target@ +-libsphinx_la_CXXFLAGS = $(AM_CXXFLAGS) ++libsphinx_la_CXXFLAGS = $(AM_CXXFLAGS) -fno-strict-aliasing + libsphinx_la_CFLAGS = $(AM_CFLAGS) + libsphinx_la_SOURCES= ha_sphinx.cc + +--- storage/xtradb/buf/buf0flu.c.orig ++++ storage/xtradb/buf/buf0flu.c +@@ -113,7 +113,9 @@ buf_flush_insert_in_flush_rbt( + p_node = rbt_prev(buf_pool->flush_rbt, c_node); + + if (p_node != NULL) { +- prev = *rbt_value(buf_page_t*, p_node); ++ buf_page_t** value; ++ value = rbt_value(buf_page_t*, p_node); ++ prev = *value; + ut_a(prev != NULL); + } + diff --git a/mariadb.changes b/mariadb.changes index 7c844e7..eb4ef04 100644 --- a/mariadb.changes +++ b/mariadb.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Jul 16 23:14:42 UTC 2011 - crrodriguez@opensuse.org + +- Fix strict-aliasing warnings +- allow using the "pool of threads" feature that requires libevent + ------------------------------------------------------------------- Wed Jun 22 19:19:50 CEST 2011 - mhrusecky@suse.cz diff --git a/mariadb.spec b/mariadb.spec index 6db5aef..2d318d1 100644 --- a/mariadb.spec +++ b/mariadb.spec @@ -61,7 +61,7 @@ PreReq: %install_info_prereq %insserv_prereq %endif BuildRequires: gcc-c++ ncurses-devel openssl-devel procps readline-devel zlib-devel %if 0%{?suse_version} -BuildRequires: pwdutils tcpd-devel +BuildRequires: pwdutils tcpd-devel libevent-devel %endif %if 0%{?suse_version} > 1030 || 0%{?fedora_version} > 8 BuildRequires: fdupes @@ -79,7 +79,7 @@ Requires: %{name}-client perl-base Provides: mysql-Max = %{srv_vers} Provides: mysql = %{srv_vers} Conflicts: otherproviders(mysql) - +Patch1: mariadb-strict-aliasing.patch %description MariaDB is a backward compatible, drop-in replacement branch of the MySQL Database Server. It includes all major open source storage engines, including @@ -407,6 +407,7 @@ for i in `grep -Rl mysqlclient .`; do sed -i 's|mysqlclient|mariadbclient|g' $i done %endif +%patch1 #------------------------------------------------------------------------------- %build