From fb9a02589280024d1453a1a86bcea84e38c8172e Mon Sep 17 00:00:00 2001 From: anand76 Date: Wed, 21 Sep 2022 14:43:44 -0700 Subject: [PATCH] Fix platform 10 build with folly (#10708) Summary: Change the library order in PLATFORM_LDFLAGS to enable fbcode platform 10 build with folly. This PR also has a few fixes for platform 10 compiler errors. Pull Request resolved: https://github.com/facebook/rocksdb/pull/10708 Test Plan: ROCKSDB_FBCODE_BUILD_WITH_PLATFORM010=1 USE_COROUTINES=1 make -j64 check ROCKSDB_FBCODE_BUILD_WITH_PLATFORM010=1 USE_FOLLY=1 make -j64 check Reviewed By: ajkr Differential Revision: D39666590 Pulled By: anand1976 fbshipit-source-id: 256a1127ef561399cd6299a6a392ca29bd68ca44 --- Makefile | 2 +- db/db_impl/db_impl.cc | 8 ++++---- table/plain/plain_table_builder.cc | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 0b507b591..4d46f8b1e 100644 --- a/Makefile +++ b/Makefile @@ -509,7 +509,7 @@ ifneq ($(strip $(FOLLY_PATH)),) # Add -ldl at the end as gcc resolves a symbol in a library by searching only in libraries specified later # in the command line - PLATFORM_LDFLAGS += $(BOOST_PATH)/lib/libboost_context.a $(BOOST_PATH)/lib/libboost_filesystem.a $(BOOST_PATH)/lib/libboost_atomic.a $(BOOST_PATH)/lib/libboost_program_options.a $(BOOST_PATH)/lib/libboost_regex.a $(BOOST_PATH)/lib/libboost_system.a $(BOOST_PATH)/lib/libboost_thread.a $(DBL_CONV_PATH)/lib/libdouble-conversion.a $(FOLLY_PATH)/lib/libfolly.a $(FMT_LIB_PATH)/libfmt.a $(GLOG_LIB_PATH)/libglog.so $(GFLAGS_PATH)/lib/libgflags.so.2.2 -ldl + PLATFORM_LDFLAGS += $(FOLLY_PATH)/lib/libfolly.a $(BOOST_PATH)/lib/libboost_context.a $(BOOST_PATH)/lib/libboost_filesystem.a $(BOOST_PATH)/lib/libboost_atomic.a $(BOOST_PATH)/lib/libboost_program_options.a $(BOOST_PATH)/lib/libboost_regex.a $(BOOST_PATH)/lib/libboost_system.a $(BOOST_PATH)/lib/libboost_thread.a $(DBL_CONV_PATH)/lib/libdouble-conversion.a $(FMT_LIB_PATH)/libfmt.a $(GLOG_LIB_PATH)/libglog.so $(GFLAGS_PATH)/lib/libgflags.so.2.2 $(LIBEVENT_PATH)/lib/libevent-2.1.so -ldl PLATFORM_LDFLAGS += -Wl,-rpath=$(GFLAGS_PATH)/lib -Wl,-rpath=$(GLOG_LIB_PATH) -Wl,-rpath=$(LIBEVENT_PATH)/lib -Wl,-rpath=$(LIBSODIUM_PATH)/lib -Wl,-rpath=$(LIBEVENT_PATH)/lib endif PLATFORM_CCFLAGS += -DUSE_FOLLY -DFOLLY_NO_CONFIG diff --git a/db/db_impl/db_impl.cc b/db/db_impl/db_impl.cc index 8e68eaee1..a7c6ff316 100644 --- a/db/db_impl/db_impl.cc +++ b/db/db_impl/db_impl.cc @@ -1438,11 +1438,11 @@ Status DBImpl::FlushWAL(bool sync) { // future writes IOStatusCheck(io_s); // whether sync or not, we should abort the rest of function upon error - return std::move(io_s); + return static_cast(io_s); } if (!sync) { ROCKS_LOG_DEBUG(immutable_db_options_.info_log, "FlushWAL sync=false"); - return std::move(io_s); + return static_cast(io_s); } } if (!sync) { @@ -1551,7 +1551,7 @@ Status DBImpl::ApplyWALToManifest(VersionEdit* synced_wals) { Status DBImpl::LockWAL() { log_write_mutex_.Lock(); auto cur_log_writer = logs_.back().writer; - auto status = cur_log_writer->WriteBuffer(); + IOStatus status = cur_log_writer->WriteBuffer(); if (!status.ok()) { ROCKS_LOG_ERROR(immutable_db_options_.info_log, "WAL flush error %s", status.ToString().c_str()); @@ -1559,7 +1559,7 @@ Status DBImpl::LockWAL() { // future writes WriteStatusCheck(status); } - return std::move(status); + return static_cast(status); } Status DBImpl::UnlockWAL() { diff --git a/table/plain/plain_table_builder.cc b/table/plain/plain_table_builder.cc index f3f349717..a93cf4c49 100644 --- a/table/plain/plain_table_builder.cc +++ b/table/plain/plain_table_builder.cc @@ -277,7 +277,7 @@ Status PlainTableBuilder::Finish() { IOStatus s = WriteBlock(property_block_builder.Finish(), file_, &offset_, &property_block_handle); if (!s.ok()) { - return std::move(s); + return static_cast(s); } meta_index_builer.Add(kPropertiesBlockName, property_block_handle);