summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2014-09-13 21:32:49 +0200
committerSergei Golubchik <sergii@pisem.net>2014-09-13 21:32:49 +0200
commite3deed438aa952d632abadfe0c8100ea7a3bb70b (patch)
tree5ed322982f6bcdf7aaf8fde2203666094d0eb645 /storage
parent77a0c9b161a231eb125ed464da4cc0de70a6b9df (diff)
downloadmariadb-git-e3deed438aa952d632abadfe0c8100ea7a3bb70b.tar.gz
ft-index: restore a chunk that was lost in the merge
and other fixes for gcc-4.9.1 on sid
Diffstat (limited to 'storage')
-rw-r--r--storage/tokudb/ft-index/CMakeLists.txt25
-rw-r--r--storage/tokudb/ft-index/ft/bndata.cc2
-rw-r--r--storage/tokudb/ft-index/ft/log_upgrade.cc2
-rw-r--r--storage/tokudb/ft-index/ft/logger.cc10
4 files changed, 32 insertions, 7 deletions
diff --git a/storage/tokudb/ft-index/CMakeLists.txt b/storage/tokudb/ft-index/CMakeLists.txt
index 095f68aa610..ce10c0a0219 100644
--- a/storage/tokudb/ft-index/CMakeLists.txt
+++ b/storage/tokudb/ft-index/CMakeLists.txt
@@ -6,6 +6,31 @@ project(TokuDB)
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
+## Versions of gcc >= 4.9.0 require special version of 'ar' and 'ranlib' for
+## link-time optimizations to work properly.
+##
+## From https://gcc.gnu.org/gcc-4.9/changes.html:
+##
+## When using a linker plugin, compiling with the -flto option now
+## generates slim objects files (.o) which only contain intermediate
+## language representation for LTO. Use -ffat-lto-objects to create
+## files which contain additionally the object code. To generate
+## static libraries suitable for LTO processing, use gcc-ar and
+## gcc-ranlib; to list symbols from a slim object file use
+## gcc-nm. (Requires that ar, ranlib and nm have been compiled with
+## plugin support.)
+if ((CMAKE_CXX_COMPILER_ID STREQUAL GNU) AND
+ NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9.0"))
+ find_program(gcc_ar "gcc-ar")
+ if (gcc_ar)
+ set(CMAKE_AR "${gcc_ar}")
+ endif ()
+ find_program(gcc_ranlib "gcc-ranlib")
+ if (gcc_ranlib)
+ set(CMAKE_RANLIB "${gcc_ranlib}")
+ endif ()
+endif()
+
include(TokuFeatureDetection)
include(TokuSetupCompiler)
include(TokuSetupCTest)
diff --git a/storage/tokudb/ft-index/ft/bndata.cc b/storage/tokudb/ft-index/ft/bndata.cc
index 8d33ca860fa..b68a05c119a 100644
--- a/storage/tokudb/ft-index/ft/bndata.cc
+++ b/storage/tokudb/ft-index/ft/bndata.cc
@@ -341,7 +341,7 @@ void bn_data::move_leafentries_to(
uint32_t i = 0;
for (i = lbi; i < ube; i++) {
- KLPAIR curr_kl;
+ KLPAIR curr_kl= 0;
m_buffer.fetch(i, &curr_kl);
size_t kl_size = klpair_size(curr_kl);
diff --git a/storage/tokudb/ft-index/ft/log_upgrade.cc b/storage/tokudb/ft-index/ft/log_upgrade.cc
index e5a36a88cff..31dbdb04d7e 100644
--- a/storage/tokudb/ft-index/ft/log_upgrade.cc
+++ b/storage/tokudb/ft-index/ft/log_upgrade.cc
@@ -321,7 +321,7 @@ toku_maybe_upgrade_log(const char *env_dir, const char *log_dir, LSN * lsn_of_cl
r = 0; //Logs are up to date
else {
FOOTPRINT(4);
- LSN last_lsn;
+ LSN last_lsn= ZERO_LSN;
TXNID last_xid;
r = verify_clean_shutdown_of_log_version(log_dir, version_of_logs_on_disk, &last_lsn, &last_xid);
if (r != 0) {
diff --git a/storage/tokudb/ft-index/ft/logger.cc b/storage/tokudb/ft-index/ft/logger.cc
index 198cb51fb39..4d1872d19a5 100644
--- a/storage/tokudb/ft-index/ft/logger.cc
+++ b/storage/tokudb/ft-index/ft/logger.cc
@@ -151,8 +151,8 @@ static bool is_a_logfile_any_version (const char *name, uint64_t *number_result,
// added for #2424, improved for #2521
static bool is_a_logfile (const char *name, long long *number_result) {
bool rval;
- uint64_t result;
- uint32_t version;
+ uint64_t result= 0;
+ uint32_t version= 0;
rval = is_a_logfile_any_version(name, &result, &version);
if (rval && version != TOKU_LOG_VERSION)
rval = false;
@@ -234,7 +234,7 @@ toku_logger_open_with_last_xid(const char *directory, TOKULOGGER logger, TXNID l
if (logger->is_open) return EINVAL;
int r;
- TXNID last_xid_if_clean_shutdown;
+ TXNID last_xid_if_clean_shutdown= TXNID_NONE;
r = toku_logfilemgr_init(logger->logfilemgr, directory, &last_xid_if_clean_shutdown);
if ( r!=0 )
return r;
@@ -1011,8 +1011,8 @@ int toku_fread_TXNID (FILE *f, TXNID *txnid, struct x1764 *checksum, uint32_t
}
int toku_fread_TXNID_PAIR (FILE *f, TXNID_PAIR *txnid, struct x1764 *checksum, uint32_t *len) {
- TXNID parent;
- TXNID child;
+ TXNID parent= TXNID_NONE;
+ TXNID child= TXNID_NONE;
int r;
r = toku_fread_TXNID(f, &parent, checksum, len); if (r != 0) { return r; }
r = toku_fread_TXNID(f, &child, checksum, len); if (r != 0) { return r; }