facebook / rocksdb

A library that provides an embeddable, persistent key-value store for fast storage.
http://rocksdb.org
GNU General Public License v2.0
28.65k stars 6.33k forks source link

Latest Commits on Master fails for iOS builds #4064

Open mbalex99 opened 6 years ago

mbalex99 commented 6 years ago

Note: Please use Issues only for bug reports. For questions, discussions, feature requests, etc. post to dev group: https://www.facebook.com/groups/rocksdb.dev

Expected behavior

It builds for iOS successfully

Actual behavior

  GEN      util/build_version.cc
mkdir -p ios-x86/db/
g++  -faligned-new -DHAVE_ALIGNED_NEW -fno-rtti -W -Wextra -Wall -Wsign-compare -Wshadow -Wunused-parameter -Werror -I. -I./include -std=c++11  -DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX  -DOS_MACOSX -DIOS_CROSS_COMPILE -DROCKSDB_LITE -Wshorten-64-to-32  -isystem ./third-party/gtest-1.7.0/fused-src -O2 -fno-omit-frame-pointer -momit-leaf-frame-pointer -DNDEBUG -DNDEBUG -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.3.sdk -arch i686 -arch x86_64 -c db/column_family.cc -o ios-x86/db/column_family.o
mkdir -p ios-arm/db/
xcrun -sdk iphoneos g++  -faligned-new -DHAVE_ALIGNED_NEW -fno-rtti -W -Wextra -Wall -Wsign-compare -Wshadow -Wunused-parameter -Werror -I. -I./include -std=c++11  -DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX  -DOS_MACOSX -DIOS_CROSS_COMPILE -DROCKSDB_LITE -Wshorten-64-to-32  -isystem ./third-party/gtest-1.7.0/fused-src -O2 -fno-omit-frame-pointer -momit-leaf-frame-pointer -DNDEBUG -DNDEBUG -Woverloaded-virtual -Wnon-virtual-dtor -Wno-missing-field-initializers -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.3.sdk -arch armv6 -arch armv7 -arch armv7s -arch arm64 -c db/column_family.cc -o ios-arm/db/column_family.o
In file included from db/column_family.cc:22:
In file included from ./db/compaction_picker.h:18:
In file included from ./db/compaction.h:11:
./db/version_set.h:726:5: error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on iOS 11 or newer
      [-Waligned-allocation-unavailable]
    delete metadata;
    ^
./db/version_set.h:726:5: note: if you supply your own aligned allocation functions, use -Wno-aligned-allocation-unavailable to silence this diagnostic
In file included from db/column_family.cc:24:
In file included from ./db/db_impl.h:23:
In file included from ./db/compaction_job.h:25:
./db/job_context.h:179:7: error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on iOS 11 or newer
      [-Waligned-allocation-unavailable]
      delete m;
      ^
./db/job_context.h:179:7: note: if you supply your own aligned allocation functions, use -Wno-aligned-allocation-unavailable to silence this diagnostic
In file included from db/column_family.cc:24:
./db/db_impl.h:773:9: error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on iOS 11 or newer
      [-Waligned-allocation-unavailable]
        delete m;
        ^
./db/db_impl.h:773:9: note: if you supply your own aligned allocation functions, use -Wno-aligned-allocation-unavailable to silence this diagnostic
db/column_family.cc:64:7: error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on iOS 11 or newer
      [-Waligned-allocation-unavailable]
      delete cfd_;
      ^
db/column_family.cc:64:7: note: if you supply your own aligned allocation functions, use -Wno-aligned-allocation-unavailable to silence this diagnostic
db/column_family.cc:343:5: error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on iOS 11 or newer
      [-Waligned-allocation-unavailable]
    delete td;
    ^
db/column_family.cc:343:5: note: if you supply your own aligned allocation functions, use -Wno-aligned-allocation-unavailable to silence this diagnostic
db/column_family.cc:534:5: error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on iOS 11 or newer
      [-Waligned-allocation-unavailable]
    delete mem_->Unref();
    ^
db/column_family.cc:534:5: note: if you supply your own aligned allocation functions, use -Wno-aligned-allocation-unavailable to silence this diagnostic
db/column_family.cc:539:5: error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on iOS 11 or newer
      [-Waligned-allocation-unavailable]
    delete m;
    ^
db/column_family.cc:539:5: note: if you supply your own aligned allocation functions, use -Wno-aligned-allocation-unavailable to silence this diagnostic
db/column_family.cc:899:10: error: aligned allocation function of type 'void *(std::size_t, std::align_val_t)' is only available on iOS 11 or newer
      [-Waligned-allocation-unavailable]
  return new MemTable(internal_comparator_, ioptions_, mutable_cf_options,
         ^
db/column_family.cc:899:10: note: if you supply your own aligned allocation functions, use -Wno-aligned-allocation-unavailable to silence this diagnostic
db/column_family.cc:899:10: error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on iOS 11 or newer
      [-Waligned-allocation-unavailable]
  return new MemTable(internal_comparator_, ioptions_, mutable_cf_options,
         ^
db/column_family.cc:899:10: note: if you supply your own aligned allocation functions, use -Wno-aligned-allocation-unavailable to silence this diagnostic
db/column_family.cc:906:5: error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on iOS 11 or newer
      [-Waligned-allocation-unavailable]
    delete mem_->Unref();
    ^
db/column_family.cc:906:5: note: if you supply your own aligned allocation functions, use -Wno-aligned-allocation-unavailable to silence this diagnostic
db/column_family.cc:1217:18: error: aligned allocation function of type 'void *(std::size_t, std::align_val_t)' is only available on iOS 11 or newer
      [-Waligned-allocation-unavailable]
      dummy_cfd_(new ColumnFamilyData(0, "", nullptr, nullptr, nullptr,
                 ^
db/column_family.cc:1217:18: note: if you supply your own aligned allocation functions, use -Wno-aligned-allocation-unavailable to silence this diagnostic
db/column_family.cc:1217:18: error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on iOS 11 or newer
      [-Waligned-allocation-unavailable]
      dummy_cfd_(new ColumnFamilyData(0, "", nullptr, nullptr, nullptr,
                 ^
db/column_family.cc:1217:18: note: if you supply your own aligned allocation functions, use -Wno-aligned-allocation-unavailable to silence this diagnostic
db/column_family.cc:1239:5: error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on iOS 11 or newer
      [-Waligned-allocation-unavailable]
    delete cfd;
    ^
db/column_family.cc:1239:5: note: if you supply your own aligned allocation functions, use -Wno-aligned-allocation-unavailable to silence this diagnostic
db/column_family.cc:1244:3: error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on iOS 11 or newer
      [-Waligned-allocation-unavailable]
  delete dummy_cfd_;
  ^
db/column_family.cc:1244:3: note: if you supply your own aligned allocation functions, use -Wno-aligned-allocation-unavailable to silence this diagnostic
db/column_family.cc:1292:31: error: aligned allocation function of type 'void *(std::size_t, std::align_val_t)' is only available on iOS 11 or newer
      [-Waligned-allocation-unavailable]
  ColumnFamilyData* new_cfd = new ColumnFamilyData(
                              ^
db/column_family.cc:1292:31: note: if you supply your own aligned allocation functions, use -Wno-aligned-allocation-unavailable to silence this diagnostic
db/column_family.cc:1292:31: error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on iOS 11 or newer
      [-Waligned-allocation-unavailable]
  ColumnFamilyData* new_cfd = new ColumnFamilyData(
                              ^
db/column_family.cc:1292:31: note: if you supply your own aligned allocation functions, use -Wno-aligned-allocation-unavailable to silence this diagnostic
db/column_family.cc:1320:5: error: aligned deallocation function of type 'void (void *, std::align_val_t) noexcept' is only available on iOS 11 or newer
      [-Waligned-allocation-unavailable]
    delete cfd;
    ^
db/column_family.cc:1320:5: note: if you supply your own aligned allocation functions, use -Wno-aligned-allocation-unavailable to silence this diagnostic
17 errors generated.
make: *** [db/column_family.o] Error 1

Steps to reproduce the behavior

  1. Clone from master, latest commit: https://github.com/facebook/rocksdb/commit/17339dc2f39a87a9cf097e056a59560b0795ff6e
  2. run TARGET_OS=IOS make static_lib

This occurs for Xcode 9, 9.2, 9.3, 9.4 and 10 beta 1

However this commit onto master works without an issue: c60df9d9e7629fe208a9b848293a5599f83d5e77

riversand963 commented 6 years ago

@mbalex99 We have made some changes related to alignment of data structures recently. Would you mind telling us which commit broke your build? Thanks!

petermattis commented 6 years ago

346d1069c3031468cf5cb06299f018a873c9fb33 seems to have caused a similar failure on Mac OS X:

Undefined symbols for architecture x86_64:
  "operator delete(void*, std::align_val_t)", referenced from:
      rocksdb::LRUCacheShard::~LRUCacheShard() in lru_cache.o
      rocksdb::StatisticsImpl::~StatisticsImpl() in statistics.o
      std::__1::__shared_ptr_emplace<rocksdb::StatisticsImpl, std::__1::allocator<rocksdb::StatisticsImpl> >::~__shared_ptr_emplace() in statistics.o

Commenting out the setting of -faligned-new in the Makefile can temporarily work around the problem.

ajkr commented 6 years ago

We need to change "build_tools/build_detect_platform" to check aligned new is actually implemented before setting -DHAVE_ALIGNED_NEW.

edit: Or it could go in the Makefile. We just need to test whether compilation using aligned new succeeds.