Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On FreeBSD 10.0-STABLE leveldb within eleveldb cannot be built with clang (use gcc from Ports to circumvent) [JIRA: RIAK-1808] #97

Open
jj1bdx opened this issue Feb 22, 2014 · 6 comments

Comments

@jj1bdx
Copy link
Contributor

jj1bdx commented Feb 22, 2014

Tested on

  • Commit 63733a9
  • Compiled on FreeBSD 10.0-STABLE r261910 amd64 with Erlang/OTP R16B03-1

Synopsis summary:

  • FreeBSD 10.x clang compiler seems to fail to process some include files in leveldb/
  • Note that running cd c_src && ./build_deps.sh switches the compiler to g++ (GNU cc) and no error will occur (because my system has gcc 4.6.4 installed from the Ports)
  • Building with env CC=gcc46 CXX=g++46 gmake clean will build runnable binaries

The compilation log of gmake clean:

./rebar compile
==> getopt (compile)
Compiled src/getopt.erl
==> goldrush (compile)
Compiled src/glc.erl
Compiled src/glc_lib.erl
Compiled src/gr_app.erl
Compiled src/glc_ops.erl
Compiled src/gr_context.erl
Compiled src/gr_counter_sup.erl
Compiled src/glc_code.erl
Compiled src/gr_manager_sup.erl
Compiled src/gr_manager.erl
Compiled src/gr_counter.erl
Compiled src/gr_param_sup.erl
Compiled src/gr_sup.erl
Compiled src/gre.erl
Compiled src/gr_param.erl
==> lager (compile)
Compiled src/lager_util.erl
Compiled src/lager_transform.erl
Compiled src/lager_app.erl
Compiled src/lager_backend_throttle.erl
Compiled src/lager.erl
Compiled src/lager_config.erl
Compiled src/lager_console_backend.erl
Compiled src/error_logger_lager_h.erl
Compiled src/lager_crash_log.erl
Compiled src/lager_default_formatter.erl
Compiled src/lager_handler_watcher.erl
Compiled src/lager_handler_watcher_sup.erl
Compiled src/lager_msg.erl
Compiled src/lager_file_backend.erl
Compiled src/lager_format.erl
Compiled src/lager_sup.erl
Compiled src/lager_stdlib.erl
Compiled src/lager_trunc_io.erl
==> neotoma (compile)
Compiled src/neotoma.erl
Compiled src/neotoma_parse.erl
==> cuttlefish (compile)
Compiled src/cuttlefish_advanced.erl
Compiled src/cuttlefish_bytesize.erl
Compiled src/cuttlefish.erl
Compiled src/cuttlefish_duration.erl
Compiled src/cuttlefish_error.erl
Compiled src/cuttlefish_conf.erl
Compiled src/cuttlefish_datatypes.erl
Compiled src/cuttlefish_flag.erl
Compiled src/cuttlefish_mapping.erl
Compiled src/cuttlefish_rebar_plugin.erl
Compiled src/cuttlefish_escript.erl
Compiled src/cuttlefish_generator.erl
Compiled src/cuttlefish_translation.erl
Compiled src/cuttlefish_schema.erl
Compiled src/cuttlefish_validator.erl
Compiled src/cuttlefish_util.erl
Compiled src/cuttlefish_vmargs.erl
Compiled src/cuttlefish_variable.erl
Compiled src/cuttlefish_unit.erl
Compiled src/lager_stderr_backend.erl
Compiled src/cuttlefish_duration_parse.erl
Compiled src/conf_parse.erl
==> getopt (escriptize)
==> goldrush (escriptize)
==> lager (escriptize)
==> neotoma (escriptize)
==> cuttlefish (escriptize)
==> eleveldb (compile)
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... ./install-sh -c -d
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... x86_64-unknown-freebsd10.0
checking host system type... x86_64-unknown-freebsd10.0
checking for style of include used by make... GNU
checking for gcc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking dependency style of cc... gcc3
checking for a sed that does not truncate output... /usr/local/bin/gsed
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/local/bin/nm -B
checking the name lister (/usr/local/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 196608
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... no
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/local/bin/nm -B output from cc object... ok
checking how to run the C preprocessor... cc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if cc supports -fno-rtti -fno-exceptions... yes
checking for cc option to produce PIC... -fPIC -DPIC
checking if cc PIC flag -fPIC -DPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking if cc supports -c -o file.o... (cached) yes
checking whether the cc linker (/usr/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... no
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... no
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking whether we are using the GNU C++ compiler... yes
checking whether c++ accepts -g... yes
checking dependency style of c++... gcc3
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether c++ accepts -g... (cached) yes
checking dependency style of c++... (cached) gcc3
checking how to run the C++ preprocessor... c++ -E
checking for ld used by c++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking whether the c++ linker (/usr/bin/ld) supports shared libraries... no
checking for c++ option to produce PIC... -fPIC -DPIC
checking if c++ PIC flag -fPIC -DPIC works... yes
checking if c++ static flag -static works... yes
checking if c++ supports -c -o file.o... yes
checking if c++ supports -c -o file.o... (cached) yes
checking whether the c++ linker (/usr/bin/ld) supports shared libraries... no
checking dynamic linker characteristics... no
checking how to hardcode library paths into programs... immediate
checking whether byte ordering is bigendian... no
checking for stdint.h... (cached) yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking windows.h usability... no
checking windows.h presence... no
checking for windows.h... no
checking byteswap.h usability... no
checking byteswap.h presence... no
checking for byteswap.h... no
checking sys/byteswap.h usability... no
checking sys/byteswap.h presence... no
checking for sys/byteswap.h... no
checking sys/endian.h usability... yes
checking sys/endian.h presence... yes
checking for sys/endian.h... yes
checking for mmap... yes
checking for 'gtest-config'... checking for gtest-config... no
no
checking for pkg-config... /usr/local/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for gflags... no
checking if the compiler supports __builtin_expect... yes
checking if the compiler supports __builtin_ctzll... yes
checking for zlibVersion in -lz... yes
checking for lzo1x_1_15_compress in -llzo2... no
checking for lzf_compress in -llzf... no
checking for fastlz_compress in -lfastlz... no
checking for qlz_compress in -lquicklz... no
configure: creating ./config.status
config.status: creating Makefile
config.status: creating snappy-stubs-public.h
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
gmake[1]: Entering directory `/home/kenji/src/eleveldb/c_src/snappy-1.0.4'
gmake  all-am
gmake[2]: Entering directory `/home/kenji/src/eleveldb/c_src/snappy-1.0.4'
/bin/sh ./libtool --tag=CXX   --mode=compile c++ -DHAVE_CONFIG_H -I.     -Wall -O3 -fPIC -MT snappy.lo -MD -MP -MF .deps/snappy.Tpo -c -o snappy.lo snappy.cc
libtool: compile:  c++ -DHAVE_CONFIG_H -I. -Wall -O3 -fPIC -MT snappy.lo -MD -MP -MF .deps/snappy.Tpo -c snappy.cc  -fPIC -DPIC -o snappy.o
snappy.cc:516:13: warning: unused function 'ComputeTable' [-Wunused-function]
static void ComputeTable() {
            ^
1 warning generated.
mv -f .deps/snappy.Tpo .deps/snappy.Plo
/bin/sh ./libtool --tag=CXX   --mode=compile c++ -DHAVE_CONFIG_H -I.     -Wall -O3 -fPIC -MT snappy-sinksource.lo -MD -MP -MF .deps/snappy-sinksource.Tpo -c -o snappy-sinksource.lo snappy-sinksource.cc
libtool: compile:  c++ -DHAVE_CONFIG_H -I. -Wall -O3 -fPIC -MT snappy-sinksource.lo -MD -MP -MF .deps/snappy-sinksource.Tpo -c snappy-sinksource.cc  -fPIC -DPIC -o snappy-sinksource.o
mv -f .deps/snappy-sinksource.Tpo .deps/snappy-sinksource.Plo
/bin/sh ./libtool --tag=CXX   --mode=compile c++ -DHAVE_CONFIG_H -I.     -Wall -O3 -fPIC -MT snappy-stubs-internal.lo -MD -MP -MF .deps/snappy-stubs-internal.Tpo -c -o snappy-stubs-internal.lo snappy-stubs-internal.cc
libtool: compile:  c++ -DHAVE_CONFIG_H -I. -Wall -O3 -fPIC -MT snappy-stubs-internal.lo -MD -MP -MF .deps/snappy-stubs-internal.Tpo -c snappy-stubs-internal.cc  -fPIC -DPIC -o snappy-stubs-internal.o
mv -f .deps/snappy-stubs-internal.Tpo .deps/snappy-stubs-internal.Plo
/bin/sh ./libtool --tag=CXX   --mode=compile c++ -DHAVE_CONFIG_H -I.     -Wall -O3 -fPIC -MT snappy-c.lo -MD -MP -MF .deps/snappy-c.Tpo -c -o snappy-c.lo snappy-c.cc
libtool: compile:  c++ -DHAVE_CONFIG_H -I. -Wall -O3 -fPIC -MT snappy-c.lo -MD -MP -MF .deps/snappy-c.Tpo -c snappy-c.cc  -fPIC -DPIC -o snappy-c.o
mv -f .deps/snappy-c.Tpo .deps/snappy-c.Plo
/bin/sh ./libtool --tag=CXX   --mode=link c++  -Wall -O3 -fPIC -version-info 2:2:1  -o libsnappy.la -rpath /home/kenji/src/eleveldb/c_src/system/lib snappy.lo snappy-sinksource.lo snappy-stubs-internal.lo snappy-c.lo  
libtool: link: ar cru .libs/libsnappy.a  snappy.o snappy-sinksource.o snappy-stubs-internal.o snappy-c.o
libtool: link: ranlib .libs/libsnappy.a
libtool: link: ( cd ".libs" && rm -f "libsnappy.la" && ln -s "../libsnappy.la" "libsnappy.la" )
c++ -DHAVE_CONFIG_H -I.      -Wall -O3 -fPIC -MT snappy_unittest-snappy_unittest.o -MD -MP -MF .deps/snappy_unittest-snappy_unittest.Tpo -c -o snappy_unittest-snappy_unittest.o `test -f 'snappy_unittest.cc' || echo './'`snappy_unittest.cc
snappy_unittest.cc:165:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^
In file included from snappy_unittest.cc:39:
./snappy-test.h:148:8: warning: unused function 'ReadFileToStringOrDie' [-Wunused-function]
  void ReadFileToStringOrDie(const string& filename, string* data) {
       ^
2 warnings generated.
mv -f .deps/snappy_unittest-snappy_unittest.Tpo .deps/snappy_unittest-snappy_unittest.Po
c++ -DHAVE_CONFIG_H -I.      -Wall -O3 -fPIC -MT snappy_unittest-snappy-test.o -MD -MP -MF .deps/snappy_unittest-snappy-test.Tpo -c -o snappy_unittest-snappy-test.o `test -f 'snappy-test.cc' || echo './'`snappy-test.cc
snappy-test.cc:356:15: warning: unused variable 'source_bytes_consumed' [-Wunused-variable]
  const uLong source_bytes_consumed = *sourceLen - comp_stream_.avail_in;
              ^
snappy-test.cc:400:16: warning: unused variable 'orig_destLen' [-Wunused-variable]
  const uLongf orig_destLen = *destLen;
               ^
In file included from snappy-test.cc:31:
./snappy-test.h:125:8: warning: unused function 'Init' [-Wunused-function]
  void Init() { }
       ^
./snappy-test.h:152:8: warning: unused function 'WriteStringToFileOrDie' [-Wunused-function]
  void WriteStringToFileOrDie(const string& str, const char* filename) {
       ^
./snappy-test.h:449:13: warning: unused function 'RunSpecifiedBenchmarks' [-Wunused-function]
static void RunSpecifiedBenchmarks() {
            ^
./snappy-test.h:495:13: warning: unused function 'CompressFile' [-Wunused-function]
static void CompressFile(const char* fname);
            ^
./snappy-test.h:496:13: warning: unused function 'UncompressFile' [-Wunused-function]
static void UncompressFile(const char* fname);
            ^
./snappy-test.h:497:13: warning: unused function 'MeasureFile' [-Wunused-function]
static void MeasureFile(const char* fname);
            ^
8 warnings generated.
mv -f .deps/snappy_unittest-snappy-test.Tpo .deps/snappy_unittest-snappy-test.Po
/bin/sh ./libtool --tag=CXX   --mode=link c++  -Wall -O3 -fPIC   -o snappy_unittest snappy_unittest-snappy_unittest.o snappy_unittest-snappy-test.o libsnappy.la -lz    
libtool: link: c++ -Wall -O3 -fPIC -o snappy_unittest snappy_unittest-snappy_unittest.o snappy_unittest-snappy-test.o  ./.libs/libsnappy.a -lz
gmake[2]: Leaving directory `/home/kenji/src/eleveldb/c_src/snappy-1.0.4'
gmake[1]: Leaving directory `/home/kenji/src/eleveldb/c_src/snappy-1.0.4'
gmake[1]: Entering directory `/home/kenji/src/eleveldb/c_src/snappy-1.0.4'
gmake[2]: Entering directory `/home/kenji/src/eleveldb/c_src/snappy-1.0.4'
test -z "/home/kenji/src/eleveldb/c_src/system/lib" || ./install-sh -c -d "/home/kenji/src/eleveldb/c_src/system/lib"
 /bin/sh ./libtool   --mode=install /usr/bin/install -c   libsnappy.la '/home/kenji/src/eleveldb/c_src/system/lib'
libtool: install: /usr/bin/install -c .libs/libsnappy.lai /home/kenji/src/eleveldb/c_src/system/lib/libsnappy.la
libtool: install: /usr/bin/install -c .libs/libsnappy.a /home/kenji/src/eleveldb/c_src/system/lib/libsnappy.a
libtool: install: chmod 644 /home/kenji/src/eleveldb/c_src/system/lib/libsnappy.a
libtool: install: ranlib /home/kenji/src/eleveldb/c_src/system/lib/libsnappy.a
----------------------------------------------------------------------
Libraries have been installed in:
   /home/kenji/src/eleveldb/c_src/system/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,-rpath -Wl,LIBDIR' linker flag

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
test -z "/home/kenji/src/eleveldb/c_src/system/share/doc/snappy" || ./install-sh -c -d "/home/kenji/src/eleveldb/c_src/system/share/doc/snappy"
 /usr/bin/install -c -m 644 ChangeLog COPYING INSTALL NEWS README format_description.txt '/home/kenji/src/eleveldb/c_src/system/share/doc/snappy'
test -z "/home/kenji/src/eleveldb/c_src/system/include" || ./install-sh -c -d "/home/kenji/src/eleveldb/c_src/system/include"
 /usr/bin/install -c -m 644 snappy.h snappy-sinksource.h snappy-stubs-public.h snappy-c.h '/home/kenji/src/eleveldb/c_src/system/include'
gmake[2]: Leaving directory `/home/kenji/src/eleveldb/c_src/snappy-1.0.4'
gmake[1]: Leaving directory `/home/kenji/src/eleveldb/c_src/snappy-1.0.4'
gmake[1]: Entering directory `/home/kenji/src/eleveldb/c_src/leveldb'
c++  -L/home/kenji/src/eleveldb/c_src/system/lib -lpthread -lsnappy -shared -Wl,-soname -Wl,libleveldb.so.1  -Wall -O3 -fPIC -I /home/kenji/src/eleveldb/c_src/system/include -I. -I./include -fno-builtin-memcmp -D_REENTRANT -DOS_FREEBSD -DLEVELDB_PLATFORM_POSIX -DSNAPPY -O2 -g -DNDEBUG     -fPIC db/builder.cc db/c.cc db/db_impl.cc db/db_iter.cc db/dbformat.cc db/filename.cc db/log_reader.cc db/log_writer.cc db/memtable.cc db/repair.cc db/table_cache.cc db/version_edit.cc db/version_set.cc db/write_batch.cc table/block.cc table/block_builder.cc table/filter_block.cc table/format.cc table/iterator.cc table/merger.cc table/table.cc table/table_builder.cc table/two_level_iterator.cc util/arena.cc util/bloom.cc util/bloom2.cc util/cache.cc util/cache2.cc util/coding.cc util/comparator.cc util/crc32c.cc util/db_list.cc util/env.cc util/env_posix.cc util/filter_policy.cc util/flexcache.cc util/hash.cc util/histogram.cc util/hot_threads.cc util/logging.cc util/murmurhash.cc util/options.cc util/perf_count.cc util/status.cc util/throttle.cc  port/port_posix.cc -o libleveldb.so.1.9
c++: warning: argument unused during compilation: '-fno-builtin-memcmp'
In file included from db/log_reader.cc:8:
./include/leveldb/env.h:158:11: error: unknown type name 'pthread_t'; did you mean 'pthread'?
  virtual pthread_t StartThread(void (*function)(void* arg), void* arg) = 0;
          ^~~~~~~~~
          pthread
/usr/include/stdio.h:143:9: note: 'pthread' declared here
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from db/log_reader.cc:8:
./include/leveldb/env.h:365:3: error: unknown type name 'pthread_t'; did you mean 'pthread'?
  pthread_t StartThread(void (*f)(void*), void* a) {
  ^~~~~~~~~
  pthread
/usr/include/stdio.h:143:9: note: 'pthread' declared here
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from db/log_reader.cc:8:
./include/leveldb/env.h:365:13: error: incomplete result type 'pthread' in function definition
  pthread_t StartThread(void (*f)(void*), void* a) {
            ^
/usr/include/stdio.h:143:9: note: forward declaration of 'pthread'
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from db/log_reader.cc:8:
./include/leveldb/env.h:366:21: error: calling 'StartThread' with incomplete return type 'pthread'
    return target_->StartThread(f, a);
           ~~~~~~~~~^~~~~~~~~~~~~~~~~
./include/leveldb/env.h:158:21: note: 'StartThread' declared here
  virtual pthread_t StartThread(void (*function)(void* arg), void* arg) = 0;
                    ^
/usr/include/stdio.h:143:9: note: forward declaration of 'pthread'
        struct pthread *_fl_owner;      /* current owner */
               ^
4 errors generated.
In file included from db/log_writer.cc:5:
In file included from ./db/log_writer.h:12:
./include/leveldb/env.h:158:11: error: unknown type name 'pthread_t'; did you mean 'pthread'?
  virtual pthread_t StartThread(void (*function)(void* arg), void* arg) = 0;
          ^~~~~~~~~
          pthread
/usr/include/stdio.h:143:9: note: 'pthread' declared here
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from db/log_writer.cc:5:
In file included from ./db/log_writer.h:12:
./include/leveldb/env.h:365:3: error: unknown type name 'pthread_t'; did you mean 'pthread'?
  pthread_t StartThread(void (*f)(void*), void* a) {
  ^~~~~~~~~
  pthread
/usr/include/stdio.h:143:9: note: 'pthread' declared here
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from db/log_writer.cc:5:
In file included from ./db/log_writer.h:12:
./include/leveldb/env.h:365:13: error: incomplete result type 'pthread' in function definition
  pthread_t StartThread(void (*f)(void*), void* a) {
            ^
/usr/include/stdio.h:143:9: note: forward declaration of 'pthread'
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from db/log_writer.cc:5:
In file included from ./db/log_writer.h:12:
./include/leveldb/env.h:366:21: error: calling 'StartThread' with incomplete return type 'pthread'
    return target_->StartThread(f, a);
           ~~~~~~~~~^~~~~~~~~~~~~~~~~
./include/leveldb/env.h:158:21: note: 'StartThread' declared here
  virtual pthread_t StartThread(void (*function)(void* arg), void* arg) = 0;
                    ^
/usr/include/stdio.h:143:9: note: forward declaration of 'pthread'
        struct pthread *_fl_owner;      /* current owner */
               ^
4 errors generated.
db/repair.cc:171:8: warning: private field 'owns_cache_' is not used [-Wunused-private-field]
  bool owns_cache_;
       ^
db/repair.cc:172:8: warning: private field 'has_level_dirs_' is not used [-Wunused-private-field]
  bool has_level_dirs_;
       ^
2 warnings generated.
db/version_set.cc:80:13: warning: unused function 'IntSetToString' [-Wunused-function]
std::string IntSetToString(const std::set<uint64_t>& s) {
            ^
1 warning generated.
In file included from table/format.cc:7:
./include/leveldb/env.h:158:11: error: unknown type name 'pthread_t'; did you mean 'pthread'?
  virtual pthread_t StartThread(void (*function)(void* arg), void* arg) = 0;
          ^~~~~~~~~
          pthread
/usr/include/stdio.h:143:9: note: 'pthread' declared here
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from table/format.cc:7:
./include/leveldb/env.h:365:3: error: unknown type name 'pthread_t'; did you mean 'pthread'?
  pthread_t StartThread(void (*f)(void*), void* a) {
  ^~~~~~~~~
  pthread
/usr/include/stdio.h:143:9: note: 'pthread' declared here
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from table/format.cc:7:
./include/leveldb/env.h:365:13: error: incomplete result type 'pthread' in function definition
  pthread_t StartThread(void (*f)(void*), void* a) {
            ^
/usr/include/stdio.h:143:9: note: forward declaration of 'pthread'
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from table/format.cc:7:
./include/leveldb/env.h:366:21: error: calling 'StartThread' with incomplete return type 'pthread'
    return target_->StartThread(f, a);
           ~~~~~~~~~^~~~~~~~~~~~~~~~~
./include/leveldb/env.h:158:21: note: 'StartThread' declared here
  virtual pthread_t StartThread(void (*function)(void* arg), void* arg) = 0;
                    ^
/usr/include/stdio.h:143:9: note: forward declaration of 'pthread'
        struct pthread *_fl_owner;      /* current owner */
               ^
4 errors generated.
In file included from table/table.cc:9:
./include/leveldb/env.h:158:11: error: unknown type name 'pthread_t'; did you mean 'pthread'?
  virtual pthread_t StartThread(void (*function)(void* arg), void* arg) = 0;
          ^~~~~~~~~
          pthread
/usr/include/stdio.h:143:9: note: 'pthread' declared here
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from table/table.cc:9:
./include/leveldb/env.h:365:3: error: unknown type name 'pthread_t'; did you mean 'pthread'?
  pthread_t StartThread(void (*f)(void*), void* a) {
  ^~~~~~~~~
  pthread
/usr/include/stdio.h:143:9: note: 'pthread' declared here
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from table/table.cc:9:
./include/leveldb/env.h:365:13: error: incomplete result type 'pthread' in function definition
  pthread_t StartThread(void (*f)(void*), void* a) {
            ^
/usr/include/stdio.h:143:9: note: forward declaration of 'pthread'
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from table/table.cc:9:
./include/leveldb/env.h:366:21: error: calling 'StartThread' with incomplete return type 'pthread'
    return target_->StartThread(f, a);
           ~~~~~~~~~^~~~~~~~~~~~~~~~~
./include/leveldb/env.h:158:21: note: 'StartThread' declared here
  virtual pthread_t StartThread(void (*function)(void* arg), void* arg) = 0;
                    ^
/usr/include/stdio.h:143:9: note: forward declaration of 'pthread'
        struct pthread *_fl_owner;      /* current owner */
               ^
4 errors generated.
In file included from util/cache2.cc:16:
./include/leveldb/env.h:158:11: error: unknown type name 'pthread_t'; did you mean 'pthread'?
  virtual pthread_t StartThread(void (*function)(void* arg), void* arg) = 0;
          ^~~~~~~~~
          pthread
/usr/include/stdio.h:143:9: note: 'pthread' declared here
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from util/cache2.cc:16:
./include/leveldb/env.h:365:3: error: unknown type name 'pthread_t'; did you mean 'pthread'?
  pthread_t StartThread(void (*f)(void*), void* a) {
  ^~~~~~~~~
  pthread
/usr/include/stdio.h:143:9: note: 'pthread' declared here
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from util/cache2.cc:16:
./include/leveldb/env.h:365:13: error: incomplete result type 'pthread' in function definition
  pthread_t StartThread(void (*f)(void*), void* a) {
            ^
/usr/include/stdio.h:143:9: note: forward declaration of 'pthread'
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from util/cache2.cc:16:
./include/leveldb/env.h:366:21: error: calling 'StartThread' with incomplete return type 'pthread'
    return target_->StartThread(f, a);
           ~~~~~~~~~^~~~~~~~~~~~~~~~~
./include/leveldb/env.h:158:21: note: 'StartThread' declared here
  virtual pthread_t StartThread(void (*function)(void* arg), void* arg) = 0;
                    ^
/usr/include/stdio.h:143:9: note: forward declaration of 'pthread'
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from util/cache2.cc:17:
./util/cache2.h:53:5: error: unknown type name 'time_t'
    time_t GetFileTimeout() {return(m_FileTimeout);};
    ^
./util/cache2.h:54:25: error: unknown type name 'time_t'
    void SetFileTimeout(time_t Timeout) {m_FileTimeout=Timeout;};
                        ^
./util/cache2.h:74:5: error: unknown type name 'time_t'
    time_t m_FileTimeout;       //!< seconds to allow file to stay cached.  default 4 days.
    ^
7 errors generated.
In file included from util/env.cc:5:
./include/leveldb/env.h:158:11: error: unknown type name 'pthread_t'; did you mean 'pthread'?
  virtual pthread_t StartThread(void (*function)(void* arg), void* arg) = 0;
          ^~~~~~~~~
          pthread
/usr/include/stdio.h:143:9: note: 'pthread' declared here
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from util/env.cc:5:
./include/leveldb/env.h:365:3: error: unknown type name 'pthread_t'; did you mean 'pthread'?
  pthread_t StartThread(void (*f)(void*), void* a) {
  ^~~~~~~~~
  pthread
/usr/include/stdio.h:143:9: note: 'pthread' declared here
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from util/env.cc:5:
./include/leveldb/env.h:365:13: error: incomplete result type 'pthread' in function definition
  pthread_t StartThread(void (*f)(void*), void* a) {
            ^
/usr/include/stdio.h:143:9: note: forward declaration of 'pthread'
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from util/env.cc:5:
./include/leveldb/env.h:366:21: error: calling 'StartThread' with incomplete return type 'pthread'
    return target_->StartThread(f, a);
           ~~~~~~~~~^~~~~~~~~~~~~~~~~
./include/leveldb/env.h:158:21: note: 'StartThread' declared here
  virtual pthread_t StartThread(void (*function)(void* arg), void* arg) = 0;
                    ^
/usr/include/stdio.h:143:9: note: forward declaration of 'pthread'
        struct pthread *_fl_owner;      /* current owner */
               ^
4 errors generated.
util/env_posix.cc:811:19: warning: unused variable 'ts' [-Wunused-variable]
  struct timespec ts;
                  ^
util/env_posix.cc:788:8: warning: function 'leveldb::<anonymous namespace>::PosixEnv::BGThread' has internal linkage but is not defined [-Wundefined-internal]
  void BGThread();
       ^
util/env_posix.cc:790:39: note: used here
    reinterpret_cast<PosixEnv*>(arg)->BGThread();
                                      ^
2 warnings generated.
In file included from util/options.cc:11:
./include/leveldb/env.h:158:11: error: unknown type name 'pthread_t'; did you mean 'pthread'?
  virtual pthread_t StartThread(void (*function)(void* arg), void* arg) = 0;
          ^~~~~~~~~
          pthread
/usr/include/stdio.h:143:9: note: 'pthread' declared here
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from util/options.cc:11:
./include/leveldb/env.h:365:3: error: unknown type name 'pthread_t'; did you mean 'pthread'?
  pthread_t StartThread(void (*f)(void*), void* a) {
  ^~~~~~~~~
  pthread
/usr/include/stdio.h:143:9: note: 'pthread' declared here
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from util/options.cc:11:
./include/leveldb/env.h:365:13: error: incomplete result type 'pthread' in function definition
  pthread_t StartThread(void (*f)(void*), void* a) {
            ^
/usr/include/stdio.h:143:9: note: forward declaration of 'pthread'
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from util/options.cc:11:
./include/leveldb/env.h:366:21: error: calling 'StartThread' with incomplete return type 'pthread'
    return target_->StartThread(f, a);
           ~~~~~~~~~^~~~~~~~~~~~~~~~~
./include/leveldb/env.h:158:21: note: 'StartThread' declared here
  virtual pthread_t StartThread(void (*function)(void* arg), void* arg) = 0;
                    ^
/usr/include/stdio.h:143:9: note: forward declaration of 'pthread'
        struct pthread *_fl_owner;      /* current owner */
               ^
In file included from util/options.cc:13:
./util/cache2.h:53:5: error: unknown type name 'time_t'
    time_t GetFileTimeout() {return(m_FileTimeout);};
    ^
./util/cache2.h:54:25: error: unknown type name 'time_t'
    void SetFileTimeout(time_t Timeout) {m_FileTimeout=Timeout;};
                        ^
./util/cache2.h:74:5: error: unknown type name 'time_t'
    time_t m_FileTimeout;       //!< seconds to allow file to stay cached.  default 4 days.
    ^
7 errors generated.
gmake[1]: *** [libleveldb.so.1.9] Error 1
gmake[1]: Leaving directory `/home/kenji/src/eleveldb/c_src/leveldb'
ERROR: Command [compile] failed!
gmake: *** [compile] Error 1
@matthewvon
Copy link
Contributor

Is this issue resolved?

@jj1bdx
Copy link
Contributor Author

jj1bdx commented May 15, 2015

This issue hasn't been resolved

@Basho-JIRA Basho-JIRA changed the title On FreeBSD 10.0-STABLE leveldb within eleveldb cannot be built with clang (use gcc from Ports to circumvent) On FreeBSD 10.0-STABLE leveldb within eleveldb cannot be built with clang (use gcc from Ports to circumvent) [JIRA: RIAK-1808] May 15, 2015
@jonmeredith
Copy link
Contributor

Thanks Kenji - reopening so we remember.

@jonmeredith jonmeredith reopened this May 15, 2015
@jj1bdx
Copy link
Contributor Author

jj1bdx commented May 15, 2015

@jonmeredith: I found that some part of eleveldb still used a hardcoded g++ for compiling C++ code today. On FreeBSD a gcc exec binary is called g++48 (or with other numbers for other versions), and since 10.0-RELEASE, there's no stock g++ anymore in the base distribution (it's clang-based c++). FYI.

@jj1bdx
Copy link
Contributor Author

jj1bdx commented May 29, 2015

@jonmeredith See basho/leveldb#156 for a proposed fix.

@essen
Copy link

essen commented Jun 20, 2015

Seeing this same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants