Skip to content

Commit

Permalink
ENABLE MYROCKS COMPILATION - Fix clang-5+ and gcc-5+ compilation issu…
Browse files Browse the repository at this point in the history
…es (facebook#1076) (facebook#1076)

Summary:
1. Suppress warnings only if compiler supports "-Wno-xxxxxx".
2. Fix issues described at https://jira.percona.com/browse/PS-6054 and https://jira.percona.com/browse/PS-6058
3. Fix linking issues for clang-7 and clang-8:
```
/usr/bin/ld.gold: error: /usr/lib/llvm-8/lib/clang/8.0.1/lib/linux/libclang_rt.fuzzer-x86_64.a(FuzzerDataFlowTrace.cpp.o): invalid section group 9 refers to earlier section 3
/usr/bin/ld.gold: error: /usr/lib/llvm-8/lib/clang/8.0.1/lib/linux/libclang_rt.fuzzer-x86_64.a(FuzzerDataFlowTrace.cpp.o): invalid section group 10 refers to earlier section 4
/usr/bin/ld.gold: error: /usr/lib/llvm-8/lib/clang/8.0.1/lib/linux/libclang_rt.fuzzer-x86_64.a(FuzzerDataFlowTrace.cpp.o): invalid section group 11 refers to earlier section 5
```
4. Fix `-Werror=ignored-qualifiers` warnings e.g.
```
/fb-8.0.17/storage/rocksdb/ha_rocksdb.cc:882:70: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
  882 |       static_cast<const rocksdb::InfoLogLevel>(rocksdb_info_log_level));
```
5. Fix a `-Wundefined-reinterpret-cast` warning:
```
/fb-8.0.17/storage/rocksdb/ha_rocksdb.cc:3777:11: error: dereference of type 'myrocks::Rdb_transaction **' that was reinterpret_cast from type 'void **' has undefined behavior [-Werror,-Wundefined-reinterpret-cast]
  return *reinterpret_cast<Rdb_transaction **>(
```
6. Fix a `-Werror=attributes` warning:
```
/fb-8.0.17/include/my_compiler.h:100:40: error: ‘nonnull’ attribute only applies to function types [-Werror=attributes]
  100 | #define MY_ATTRIBUTE(A) __attribute__(A)
```
7. Fix
```
/fb-8.0.17/sql/dd/impl/types/schema_impl.cc:100:1: error: base class ‘class dd::Weak_object’ should be explicitly initialized in the copy constructor [-Werror=extra]
 Schema_impl::Schema_impl(const Schema_impl &src)
```
Pull Request resolved: facebook#1076

Reviewed By: lloyd

Differential Revision: D19301431

Pulled By: lth
  • Loading branch information
inikep committed Apr 12, 2022
1 parent dc6a904 commit 53a5e58
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,7 @@ INCLUDE(mysql_add_executable)
INCLUDE(curl)
INCLUDE(rapidjson)
INCLUDE(fprofile)
INCLUDE(prepend_append_cflags_if_supported)
INCLUDE(gloves)
INCLUDE(fido2)

Expand Down
2 changes: 1 addition & 1 deletion mysql-test/t/func_group.test
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ SELECT 1 FROM t1 GROUP BY (SELECT SLEEP(0) FROM t1 ORDER BY AVG(DISTINCT a) );
DROP TABLE t1;

#
# Bug #30715: Assertion failed: item_field->field->real_maybe_null(), file
# Bug #30715: Assertion failed: item_field->field->is_nullable(), file
# .\opt_sum.cc, line
#

Expand Down
1 change: 1 addition & 0 deletions sql/rpl_gtid.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <mutex> // std::adopt_lock_t
#include <string>

#undef ZSTD // defined in storage/rocksdb/CMakeLists.txt
#include "libbinlogevents/include/compression/base.h"
#include "libbinlogevents/include/gtids/global.h"
#include "libbinlogevents/include/uuid.h"
Expand Down
2 changes: 0 additions & 2 deletions storage/rocksdb/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
RETURN() # MyRocks is disabled

# TODO: Copyrights

# This is a strong requirement coming from RocksDB. No conditional checks here.
Expand Down
16 changes: 8 additions & 8 deletions storage/rocksdb/rdb_psi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ my_core::PSI_thread_key rdb_background_psi_thread_key,
rdb_drop_idx_psi_thread_key, rdb_is_psi_thread_key, rdb_mc_psi_thread_key;

my_core::PSI_thread_info all_rocksdb_threads[] = {
{&rdb_background_psi_thread_key, "background", PSI_FLAG_SINGLETON, 0,
PSI_DOCUMENT_ME},
{&rdb_drop_idx_psi_thread_key, "drop index", PSI_FLAG_SINGLETON, 0,
PSI_DOCUMENT_ME},
{&rdb_is_psi_thread_key, "index stats calculation", PSI_FLAG_SINGLETON, 0,
PSI_DOCUMENT_ME},
{&rdb_mc_psi_thread_key, "manual compaction", PSI_FLAG_SINGLETON, 0,
PSI_DOCUMENT_ME},
{&rdb_background_psi_thread_key, "background", "background",
PSI_FLAG_SINGLETON, 0, PSI_DOCUMENT_ME},
{&rdb_drop_idx_psi_thread_key, "drop index", "drop_idx", PSI_FLAG_SINGLETON,
0, PSI_DOCUMENT_ME},
{&rdb_is_psi_thread_key, "index stats calculation", "is_psi",
PSI_FLAG_SINGLETON, 0, PSI_DOCUMENT_ME},
{&rdb_mc_psi_thread_key, "manual compaction", "mc_psi", PSI_FLAG_SINGLETON,
0, PSI_DOCUMENT_ME},
};

my_core::PSI_mutex_key rdb_psi_open_tbls_mutex_key, rdb_signal_bg_psi_mutex_key,
Expand Down

0 comments on commit 53a5e58

Please sign in to comment.