cruppstahl / upscaledb

A very fast lightweight embedded database engine with a built-in query language.
https://upscaledb.com
Apache License 2.0
569 stars 71 forks source link

build failure with clang #99

Open ilovezfs opened 7 years ago

ilovezfs commented 7 years ago

Testing 98b4105fe852704da3d32ab72cb8a4317cbb1f6c on macOS, the build fails with clang.

If I recompile protobuf with gcc 7, and also build upscaledb with gcc 7, then the build succeeds.

Full clang build log: https://gist.github.com/ilovezfs/378687cd13c350ddabdc6eb531102417

The failure is

bash-3.2$ make -j1 V=1
(CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/sh /private/tmp/upscaledb-20170801-55163-1a296hv/missing autoheader)
rm -f stamp-h1
touch config.h.in
cd . && /bin/sh ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in 3rdparty
Making all in liblzf
make[3]: Nothing to be done for `all'.
Making all in murmurhash3
make[3]: Nothing to be done for `all'.
Making all in libfor
make[3]: Nothing to be done for `all'.
Making all in libvbyte
make[3]: Nothing to be done for `all'.
Making all in json
make[3]: Nothing to be done for `all'.
make[3]: Nothing to be done for `all-am'.
Making all in src
Making all in 2protoserde
make[3]: Nothing to be done for `all'.
Making all in 2protobuf
make[3]: Nothing to be done for `all'.
Making all in 5server
make[3]: Nothing to be done for `all'.
/bin/sh ../libtool  --tag=CXX   --mode=compile /usr/bin/clang++ -DHAVE_CONFIG_H -I. -I..  -I../include -I../include   -DUPS_ENABLE_ENCRYPTION -DUPS_ENABLE_REMOTE -I/usr/local/Cellar/upscaledb/HEAD-98b4105/libexec/libuv/include -I/usr/local/opt/openssl/include -F/usr/local/Frameworks   -I/usr/local/Cellar/upscaledb/HEAD-98b4105/libexec/libuv/include -Os -w -pipe -march=native -mmacosx-version-min=10.11 -I/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/include/darwin -DNDEBUG -c -o 3blob_manager/blob_manager_disk.lo 3blob_manager/blob_manager_disk.cc
libtool: compile:  /usr/bin/clang++ -DHAVE_CONFIG_H -I. -I.. -I../include -I../include -DUPS_ENABLE_ENCRYPTION -DUPS_ENABLE_REMOTE -I/usr/local/Cellar/upscaledb/HEAD-98b4105/libexec/libuv/include -I/usr/local/opt/openssl/include -F/usr/local/Frameworks -I/usr/local/Cellar/upscaledb/HEAD-98b4105/libexec/libuv/include -Os -w -pipe -march=native -mmacosx-version-min=10.11 -I/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/include -I/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/include/darwin -DNDEBUG -c 3blob_manager/blob_manager_disk.cc  -fno-common -DPIC -o 3blob_manager/.libs/blob_manager_disk.o
In file included from 3blob_manager/blob_manager_disk.cc:30:
./2device/device_disk.h:114:13: error: call to deleted constructor of 'upscaledb::DiskDevice::State'
      State state = std::move(m_state);
            ^       ~~~~~~~~~~~~~~~~~~
./2device/device_disk.h:58:7: note: 'State' has been explicitly marked deleted here
      State(const State&) = delete;
      ^
./2device/device_disk.h:155:13: error: call to deleted constructor of 'upscaledb::DiskDevice::State'
      State state = std::move(m_state);
            ^       ~~~~~~~~~~~~~~~~~~
./2device/device_disk.h:58:7: note: 'State' has been explicitly marked deleted here
      State(const State&) = delete;
      ^
In file included from 3blob_manager/blob_manager_disk.cc:21:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:625:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:3615:9: error: call to deleted constructor of 'upscaledb::DiskDevice::State'
    _Tp __t(_VSTD::move(__x));
        ^   ~~~~~~~~~~~~~~~~
./2device/device_disk.h:81:10: note: in instantiation of function template specialization 'std::__1::swap<upscaledb::DiskDevice::State>' requested here
                  std::swap(oldState, newState);
                       ^
./2device/device_disk.h:58:7: note: 'State' has been explicitly marked deleted here
      State(const State&) = delete;
      ^
In file included from 3blob_manager/blob_manager_disk.cc:21:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:625:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/type_traits:3616:9: error: overload resolution selected deleted operator '='
    __x = _VSTD::move(__y);
    ~~~ ^ ~~~~~~~~~~~~~~~~
./2device/device_disk.h:59:14: note: candidate function has been explicitly deleted
      State& operator=(const State&) = delete;
             ^
./2device/device_disk.h:62:14: note: candidate function not viable: no known conversion from 'upscaledb::DiskDevice::State' to 'upscaledb::DiskDevice::State &&' for 1st argument
      State& operator=(State&& ) = default;
             ^
4 errors generated.
make[3]: *** [3blob_manager/blob_manager_disk.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
bash-3.2$
ilovezfs commented 7 years ago

Note that this failure occurs after first hacking around #96 with

diff --git a/3rdparty/libvbyte/vbyte.cc b/3rdparty/libvbyte/vbyte.cc
index 6faf792..46255b8 100644
--- a/3rdparty/libvbyte/vbyte.cc
+++ b/3rdparty/libvbyte/vbyte.cc
@@ -24,10 +24,6 @@ typedef signed char int8_t;
 #  include <stdint.h>
 #endif

-#if defined(__AVX__) || defined(__AVX2__) || defined(__SSE4__)
-#  define USE_MASKEDVBYTE 1
-#endif
-
 #include "vbyte.h"
 #include "varintdecode.h"
cruppstahl commented 7 years ago

I think that the --std=c++11 flag is not set correctly, and the compiler does not recognize the c++11 syntax. I will try to push a fix tonight.