[MDEV-13974] Build failure in rocksdb/rdb_datadic.cc Created: 2017-10-01  Updated: 2017-10-11  Resolved: 2017-10-11

Status: Closed
Project: MariaDB Server
Component/s: Platform FreeBSD, Storage Engine - RocksDB
Affects Version/s: 10.2.9
Fix Version/s: 10.2.10

Type: Bug Priority: Critical
Reporter: Bernard Spil Assignee: Varun Gupta (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Environment:

FreeBSD 11.0-RELEASE-p6
Clang 3.8
cmake 3.9.2


Attachments: File patch-storage_rocksdb_rdb__datadic.h    
Issue Links:
Duplicate
is duplicated by MDEV-13945 RocksDB fails to build on macOS (llvm?) Closed
Relates
relates to MDEV-13945 RocksDB fails to build on macOS (llvm?) Closed
Sprint: 10.2.10

 Description   

While building RocksDB I get a fatal compilation error

/usr/bin/c++ -DHAVE_CONFIG_H -DLZ4 -DMYSQL_DYNAMIC_PLUGIN -DOS_FREEBSD -DROCKSDB_JEMALLOC -DROCKSDB_LIB_IO_POSIX -DROCKSDB_MALLOC_USABLE_SIZE -DROCKSDB_PLATFORM_POSIX -DROCKSDB_SUPPORT_THREAD_LOCAL -DSNAPPY -DZLIB -DZSTD -Drocksdb_EXPORTS -Iinclude -Isql -Ipcre -Istorage/rocksdb/rocksdb -Istorage/rocksdb/rocksdb/include -isystem storage/rocksdb/rocksdb/third-party/gtest-1.7.0/fused-src -Istorage/rocksdb/rocksdb/util -I/usr/include -I/usr/local/include -O2 -pipe -fstack-protector -isystem /usr/local/include -fno-strict-aliasing -DWITH_INNODB_DISALLOW_WRITES -fno-rtti -DDBUG_OFF -fPIC -std=c++11 -MD -MT storage/rocksdb/CMakeFiles/rocksdb.dir/rdb_datadic.cc.o -MF storage/rocksdb/CMakeFiles/rocksdb.dir/rdb_datadic.cc.o.d -o storage/rocksdb/CMakeFiles/rocksdb.dir/rdb_datadic.cc.o -c storage/rocksdb/rdb_datadic.cc

In file included from storage/rocksdb/rdb_datadic.cc:26:
In file included from storage/rocksdb/./rdb_datadic.h:35:
storage/rocksdb/./ha_rocksdb.h:1066:3: warning: declaration does not declare anything [-Wmissing-declarations]
  MY_ATTRIBUTE((__nonnull__, __warn_unused_result__));
  ^
storage/rocksdb/rdb_mariadb_port.h:18:27: note: expanded from macro 'MY_ATTRIBUTE'
#  define MY_ATTRIBUTE(A) __attribute__(A)
                          ^
In file included from storage/rocksdb/rdb_datadic.cc:26:
In file included from storage/rocksdb/./rdb_datadic.h:36:
storage/rocksdb/./properties_collector.h:84:27: warning: 'AddUserKey' overrides a member function but is not marked 'override'
      [-Winconsistent-missing-override]
  virtual rocksdb::Status AddUserKey(const rocksdb::Slice &key,
                          ^
storage/rocksdb/rocksdb/include/rocksdb/table_properties.h:89:18: note: overridden virtual function is here
  virtual Status AddUserKey(const Slice& key, const Slice& value,
                 ^
storage/rocksdb/rdb_datadic.cc:371:19: error: no member named 'strtoul' in namespace 'std'; did you mean simply 'strtoul'?
  *ttl_duration = std::strtoull(ttl_duration_str.c_str(), nullptr, 0);
                  ^~~~~
/usr/include/stdlib.h:113:3: note: 'strtoul' declared here
         strtoul(const char * __restrict, char ** __restrict, int);
         ^
2 warnings and 1 error generated.

Adding `#include <cstdlib>` to `storage/rocksdb/rdb_datadic.h` solves the issue on FreeBSD 11.0. Not sure if this should be enclosed in a #ifdef _FreeBSD_ block



 Comments   
Comment by Bernard Spil [ 2017-10-01 ]

This built succesfully with all options enabled.
See build log here

Comment by Elena Stepanova [ 2017-10-01 ]

Same failure was reported in MDEV-13945, so it's not limited to MacOS.

Comment by Sergei Golubchik [ 2017-10-10 ]

ok to push

Generated at Thu Feb 08 08:09:50 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.