Opened 11 years ago

Closed 5 years ago

#631 closed defect (fixed)

Doesn't build with Sun C++ since C++11 switch

Reported by: Dagobert Michelsen Owned by: Olly Betts
Priority: normal Milestone: 1.4.14
Component: Build system Version: 1.3.1
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Operating System: Solaris

Description (last modified by Olly Betts)

After a few fixes, xapian-core compiles all the objects cleanly and then fails to link libxapian:

/bin/sh ./libtool  --tag=CXX    --mode=link /opt/solarisstudio12.4/bin/CC   -g -std=c++11 -Bsymbolic-functions -no-undefined  -version-info 3:0:0    -o libxapian-1.3.la -rpath /usr/local/lib api/compactor.lo api/constinfo.lo  api/decvalwtsource.lo api/documentvaluelist.lo  api/editdistance.lo api/emptypostlist.lo api/error.lo  api/errorhandler.lo api/expanddecider.lo api/keymaker.lo  api/leafpostlist.lo api/matchspy.lo api/omdatabase.lo  api/omdocument.lo api/omenquire.lo api/positioniterator.lo  api/postingiterator.lo api/postingsource.lo api/postlist.lo  api/query.lo api/queryinternal.lo api/registry.lo  api/replication.lo api/smallvector.lo api/snipper.lo  api/sortable-serialise.lo api/termiterator.lo api/termlist.lo  api/valueiterator.lo api/valuerangeproc.lo  api/valuesetmatchdecider.lo api/vectortermlist.lo  backends/alltermslist.lo backends/dbcheck.lo  backends/database.lo backends/databasereplicator.lo  backends/dbfactory.lo backends/slowvaluelist.lo  backends/valuelist.lo backends/dbfactory_remote.lo backends/contiguousalldocspostlist.lo  backends/flint_lock.lo   backends/chert/chert_alldocsmodifiedpostlist.lo  backends/chert/chert_alldocspostlist.lo  backends/chert/chert_alltermslist.lo  backends/chert/chert_btreebase.lo  backends/chert/chert_check.lo  backends/chert/chert_compact.lo  backends/chert/chert_cursor.lo  backends/chert/chert_database.lo  backends/chert/chert_databasereplicator.lo  backends/chert/chert_dbcheck.lo  backends/chert/chert_dbstats.lo  backends/chert/chert_document.lo  backends/chert/chert_metadata.lo  backends/chert/chert_modifiedpostlist.lo  backends/chert/chert_positionlist.lo  backends/chert/chert_postlist.lo  backends/chert/chert_record.lo  backends/chert/chert_spelling.lo  backends/chert/chert_spellingwordslist.lo  backends/chert/chert_synonym.lo  backends/chert/chert_table.lo  backends/chert/chert_termlist.lo  backends/chert/chert_termlisttable.lo  backends/chert/chert_valuelist.lo  backends/chert/chert_values.lo  backends/chert/chert_version.lo backends/glass/glass_alldocspostlist.lo  backends/glass/glass_alltermslist.lo  backends/glass/glass_changes.lo  backends/glass/glass_check.lo  backends/glass/glass_compact.lo  backends/glass/glass_cursor.lo  backends/glass/glass_database.lo  backends/glass/glass_databasereplicator.lo  backends/glass/glass_dbcheck.lo  backends/glass/glass_dbstats.lo  backends/glass/glass_document.lo  backends/glass/glass_freelist.lo  backends/glass/glass_inverter.lo  backends/glass/glass_metadata.lo  backends/glass/glass_positionlist.lo  backends/glass/glass_postlist.lo  backends/glass/glass_spelling.lo  backends/glass/glass_spellingwordslist.lo  backends/glass/glass_synonym.lo  backends/glass/glass_table.lo  backends/glass/glass_termlist.lo  backends/glass/glass_termlisttable.lo  backends/glass/glass_valuelist.lo  backends/glass/glass_values.lo  backends/glass/glass_version.lo  backends/inmemory/inmemory_alltermslist.lo  backends/inmemory/inmemory_database.lo  backends/inmemory/inmemory_document.lo  backends/inmemory/inmemory_positionlist.lo   backends/multi/multi_alltermslist.lo  backends/multi/multi_postlist.lo  backends/multi/multi_termlist.lo  backends/multi/multi_valuelist.lo backends/remote/remote-document.lo  backends/remote/net_postlist.lo  backends/remote/net_termlist.lo  backends/remote/remote-database.lo  common/bitstream.lo common/closefrom.lo common/debuglog.lo  common/errno_to_string.lo common/fileutils.lo  common/io_utils.lo common/keyword.lo common/msvc_dirent.lo  common/omassert.lo common/posixy_wrapper.lo  common/replicate_utils.lo common/safe.lo  common/serialise-double.lo common/socket_utils.lo  common/str.lo common/stringutils.lo common/compression_stream.lo   expand/bo1eweight.lo expand/esetinternal.lo  expand/expandweight.lo expand/ortermlist.lo  expand/tradeweight.lo geospatial/geoencode.lo  geospatial/latlongcoord.lo  geospatial/latlong_distance_keymaker.lo  geospatial/latlong_metrics.lo  geospatial/latlong_posting_source.lo languages/armenian.lo languages/basque.lo  languages/catalan.lo languages/danish.lo languages/dutch.lo  languages/english.lo languages/earlyenglish.lo  languages/finnish.lo languages/french.lo languages/german2.lo  languages/german.lo languages/hungarian.lo  languages/italian.lo languages/kraaij_pohlmann.lo  languages/lovins.lo languages/norwegian.lo languages/porter.lo  languages/portuguese.lo languages/romanian.lo  languages/russian.lo languages/spanish.lo languages/swedish.lo  languages/turkish.lo   languages/stem.lo languages/steminternal.lo matcher/remotesubmatch.lo  matcher/andmaybepostlist.lo matcher/andnotpostlist.lo  matcher/branchpostlist.lo matcher/collapser.lo  matcher/const_database_wrapper.lo  matcher/exactphrasepostlist.lo matcher/externalpostlist.lo  matcher/localsubmatch.lo matcher/maxpostlist.lo  matcher/mergepostlist.lo matcher/msetcmp.lo  matcher/msetpostlist.lo matcher/multiandpostlist.lo  matcher/multimatch.lo matcher/multixorpostlist.lo  matcher/nearpostlist.lo matcher/orpostlist.lo  matcher/phrasepostlist.lo matcher/selectpostlist.lo  matcher/synonympostlist.lo matcher/valuegepostlist.lo  matcher/valuerangepostlist.lo matcher/valuestreamdocument.lo  net/length.lo  net/progclient.lo  net/remoteconnection.lo  net/remoteserver.lo  net/remotetcpclient.lo  net/remotetcpserver.lo  net/replicatetcpclient.lo  net/replicatetcpserver.lo  net/serialise.lo net/tcpclient.lo  net/tcpserver.lo queryparser/cjk-tokenizer.lo  queryparser/queryparser.lo queryparser/queryparser_internal.lo  queryparser/termgenerator.lo  queryparser/termgenerator_internal.lo  unicode/description_append.lo unicode/unicode-data.lo  unicode/utf8itor.lo weight/bb2weight.lo weight/bm25weight.lo  weight/boolweight.lo weight/dlhweight.lo weight/dphweight.lo  weight/ifb2weight.lo weight/ineb2weight.lo  weight/inl2weight.lo weight/lmweight.lo weight/pl2weight.lo  weight/tradweight.lo weight/tfidfweight.lo weight/weight.lo  weight/weightinternal.lo -lm  -lm   -lz -lm  -luuid -lm  -lnsl -lsocket -lm -lm
libtool: link: /opt/solarisstudio12.4/bin/CC -G -zdefs -hlibxapian-1.3.so.3 -o .libs/libxapian-1.3.so.3.0.0   api/.libs/compactor.o api/.libs/constinfo.o api/.libs/decvalwtsource.o api/.libs/documentvaluelist.o api/.libs/editdistance.o api/.libs/emptypostlist.o api/.libs/error.o api/.libs/errorhandler.o api/.libs/expanddecider.o api/.libs/keymaker.o api/.libs/leafpostlist.o api/.libs/matchspy.o api/.libs/omdatabase.o api/.libs/omdocument.o api/.libs/omenquire.o api/.libs/positioniterator.o api/.libs/postingiterator.o api/.libs/postingsource.o api/.libs/postlist.o api/.libs/query.o api/.libs/queryinternal.o api/.libs/registry.o api/.libs/replication.o api/.libs/smallvector.o api/.libs/snipper.o api/.libs/sortable-serialise.o api/.libs/termiterator.o api/.libs/termlist.o api/.libs/valueiterator.o api/.libs/valuerangeproc.o api/.libs/valuesetmatchdecider.o api/.libs/vectortermlist.o backends/.libs/alltermslist.o backends/.libs/dbcheck.o backends/.libs/database.o backends/.libs/databasereplicator.o backends/.libs/dbfactory.o backends/.libs/slowvaluelist.o backends/.libs/valuelist.o backends/.libs/dbfactory_remote.o backends/.libs/contiguousalldocspostlist.o backends/.libs/flint_lock.o backends/chert/.libs/chert_alldocsmodifiedpostlist.o backends/chert/.libs/chert_alldocspostlist.o backends/chert/.libs/chert_alltermslist.o backends/chert/.libs/chert_btreebase.o backends/chert/.libs/chert_check.o backends/chert/.libs/chert_compact.o backends/chert/.libs/chert_cursor.o backends/chert/.libs/chert_database.o backends/chert/.libs/chert_databasereplicator.o backends/chert/.libs/chert_dbcheck.o backends/chert/.libs/chert_dbstats.o backends/chert/.libs/chert_document.o backends/chert/.libs/chert_metadata.o backends/chert/.libs/chert_modifiedpostlist.o backends/chert/.libs/chert_positionlist.o backends/chert/.libs/chert_postlist.o backends/chert/.libs/chert_record.o backends/chert/.libs/chert_spelling.o backends/chert/.libs/chert_spellingwordslist.o backends/chert/.libs/chert_synonym.o backends/chert/.libs/chert_table.o backends/chert/.libs/chert_termlist.o backends/chert/.libs/chert_termlisttable.o backends/chert/.libs/chert_valuelist.o backends/chert/.libs/chert_values.o backends/chert/.libs/chert_version.o backends/glass/.libs/glass_alldocspostlist.o backends/glass/.libs/glass_alltermslist.o backends/glass/.libs/glass_changes.o backends/glass/.libs/glass_check.o backends/glass/.libs/glass_compact.o backends/glass/.libs/glass_cursor.o backends/glass/.libs/glass_database.o backends/glass/.libs/glass_databasereplicator.o backends/glass/.libs/glass_dbcheck.o backends/glass/.libs/glass_dbstats.o backends/glass/.libs/glass_document.o backends/glass/.libs/glass_freelist.o backends/glass/.libs/glass_inverter.o backends/glass/.libs/glass_metadata.o backends/glass/.libs/glass_positionlist.o backends/glass/.libs/glass_postlist.o backends/glass/.libs/glass_spelling.o backends/glass/.libs/glass_spellingwordslist.o backends/glass/.libs/glass_synonym.o backends/glass/.libs/glass_table.o backends/glass/.libs/glass_termlist.o backends/glass/.libs/glass_termlisttable.o backends/glass/.libs/glass_valuelist.o backends/glass/.libs/glass_values.o backends/glass/.libs/glass_version.o backends/inmemory/.libs/inmemory_alltermslist.o backends/inmemory/.libs/inmemory_database.o backends/inmemory/.libs/inmemory_document.o backends/inmemory/.libs/inmemory_positionlist.o backends/multi/.libs/multi_alltermslist.o backends/multi/.libs/multi_postlist.o backends/multi/.libs/multi_termlist.o backends/multi/.libs/multi_valuelist.o backends/remote/.libs/remote-document.o backends/remote/.libs/net_postlist.o backends/remote/.libs/net_termlist.o backends/remote/.libs/remote-database.o common/.libs/bitstream.o common/.libs/closefrom.o common/.libs/debuglog.o common/.libs/errno_to_string.o common/.libs/fileutils.o common/.libs/io_utils.o common/.libs/keyword.o common/.libs/msvc_dirent.o common/.libs/omassert.o common/.libs/posixy_wrapper.o common/.libs/replicate_utils.o common/.libs/safe.o common/.libs/serialise-double.o common/.libs/socket_utils.o common/.libs/str.o common/.libs/stringutils.o common/.libs/compression_stream.o expand/.libs/bo1eweight.o expand/.libs/esetinternal.o expand/.libs/expandweight.o expand/.libs/ortermlist.o expand/.libs/tradeweight.o geospatial/.libs/geoencode.o geospatial/.libs/latlongcoord.o geospatial/.libs/latlong_distance_keymaker.o geospatial/.libs/latlong_metrics.o geospatial/.libs/latlong_posting_source.o languages/.libs/armenian.o languages/.libs/basque.o languages/.libs/catalan.o languages/.libs/danish.o languages/.libs/dutch.o languages/.libs/english.o languages/.libs/earlyenglish.o languages/.libs/finnish.o languages/.libs/french.o languages/.libs/german2.o languages/.libs/german.o languages/.libs/hungarian.o languages/.libs/italian.o languages/.libs/kraaij_pohlmann.o languages/.libs/lovins.o languages/.libs/norwegian.o languages/.libs/porter.o languages/.libs/portuguese.o languages/.libs/romanian.o languages/.libs/russian.o languages/.libs/spanish.o languages/.libs/swedish.o languages/.libs/turkish.o languages/.libs/stem.o languages/.libs/steminternal.o matcher/.libs/remotesubmatch.o matcher/.libs/andmaybepostlist.o matcher/.libs/andnotpostlist.o matcher/.libs/branchpostlist.o matcher/.libs/collapser.o matcher/.libs/const_database_wrapper.o matcher/.libs/exactphrasepostlist.o matcher/.libs/externalpostlist.o matcher/.libs/localsubmatch.o matcher/.libs/maxpostlist.o matcher/.libs/mergepostlist.o matcher/.libs/msetcmp.o matcher/.libs/msetpostlist.o matcher/.libs/multiandpostlist.o matcher/.libs/multimatch.o matcher/.libs/multixorpostlist.o matcher/.libs/nearpostlist.o matcher/.libs/orpostlist.o matcher/.libs/phrasepostlist.o matcher/.libs/selectpostlist.o matcher/.libs/synonympostlist.o matcher/.libs/valuegepostlist.o matcher/.libs/valuerangepostlist.o matcher/.libs/valuestreamdocument.o net/.libs/length.o net/.libs/progclient.o net/.libs/remoteconnection.o net/.libs/remoteserver.o net/.libs/remotetcpclient.o net/.libs/remotetcpserver.o net/.libs/replicatetcpclient.o net/.libs/replicatetcpserver.o net/.libs/serialise.o net/.libs/tcpclient.o net/.libs/tcpserver.o queryparser/.libs/cjk-tokenizer.o queryparser/.libs/queryparser.o queryparser/.libs/queryparser_internal.o queryparser/.libs/termgenerator.o queryparser/.libs/termgenerator_internal.o unicode/.libs/description_append.o unicode/.libs/unicode-data.o unicode/.libs/utf8itor.o weight/.libs/bb2weight.o weight/.libs/bm25weight.o weight/.libs/boolweight.o weight/.libs/dlhweight.o weight/.libs/dphweight.o weight/.libs/ifb2weight.o weight/.libs/ineb2weight.o weight/.libs/inl2weight.o weight/.libs/lmweight.o weight/.libs/pl2weight.o weight/.libs/tradweight.o weight/.libs/tfidfweight.o weight/.libs/weight.o weight/.libs/weightinternal.o   -lz -luuid -lnsl -lsocket -lm -lc   -g
Undefined                       first referenced
 symbol                             in file
std::string::rfind(char,unsigned)const                     api/.libs/compactor.o
std::string::basic_string (const std::string &)                        api/.libs/compactor.o
std::filebuf::close() api/.libs/compactor.o
std::string::_M_mutate(unsigned,unsigned,unsigned)                 api/.libs/compactor.o
std::ios_base::ios_base()                  api/.libs/compactor.o
std::ios_base::~ios_base()                  api/.libs/compactor.o
operator new[](unsigned)                               api/.libs/editdistance.o
operator new(unsigned)                               api/.libs/compactor.o
std::string::_Rep::_S_terminal            api/.libs/compactor.o
[Hint: static member std::string::_Rep::_S_terminal must be defined in the program]

std::ostream::write(const char*,int)                    backends/chert/.libs/chert_check.o
std::__throw_out_of_range(const char*)       api/.libs/compactor.o
std::string::find_first_not_of(char,unsigned)const        net/.libs/progclient.o
std::ctype<char>::_M_widen_init()const    api/.libs/compactor.o
std::string::basic_string (unsigned,char,const std::allocator<char>&)                   api/.libs/sortable-serialise.o
std::string::append(const char*,unsigned)                   api/.libs/compactor.o
std::string::append(const std::string &)                   api/.libs/compactor.o
__cxa_allocate_exception            api/.libs/compactor.o
vtable for std::exception                    backends/chert/.libs/chert_table.o
[Hint: static member vtable for std::exception must be defined in the program]

std::string::insert(unsigned,const char*,unsigned)                  api/.libs/omdocument.o
std::string::find(const char*,unsigned,unsigned)const                   api/.libs/replication.o
vtable for __cxxabiv1::__si_class_type_info api/.libs/compactor.o
[Hint: static member vtable for __cxxabiv1::__si_class_type_info must be defined in the program]

std::string::swap(std::string &)                      api/.libs/compactor.o
std::ostream::put(char)                         api/.libs/replication.o
std::__throw_length_error(const char*)       api/.libs/compactor.o
vtable for std::streambuf  api/.libs/compactor.o
std::string::_M_replace_aux(unsigned,unsigned,unsigned,char)          net/.libs/remoteserver.o
std::ostream::operator<<(int)                           api/.libs/replication.o
__cxa_vec_cctor                     backends/glass/.libs/glass_compact.o
std::string::find(char,unsigned)const                      api/.libs/compactor.o
vtable for std::bad_alloc                    backends/chert/.libs/chert_table.o
[Hint: static member vtable for std::bad_alloc must be defined in the program]

std::__throw_logic_error(const char*)        backends/chert/.libs/chert_postlist.o
__cxa_end_catch                     api/.libs/compactor.o
typeinfo for const char*                             backends/chert/.libs/chert_compact.o
std::filebuf::open(const char*,std::_Ios_Openmode) api/.libs/compactor.o
std::string::append(unsigned,char)                     api/.libs/compactor.o
__cxa_begin_catch                   api/.libs/compactor.o
std::string::basic_string (const std::string &,unsigned,unsigned)                      api/.libs/compactor.o
std::__throw_bad_cast()             api/.libs/compactor.o
std::_Rb_tree_increment(std::_Rb_tree_node_base*) api/.libs/matchspy.o
operator delete[](void*)                              api/.libs/editdistance.o
operator delete(void*)                              api/.libs/compactor.o
std::string::_M_leak_hard()               api/.libs/compactor.o
std::string::append(const std::string &,unsigned,unsigned)                 api/.libs/keymaker.o
typeinfo for std::length_error                backends/.libs/dbcheck.o
[Hint: static member typeinfo for std::length_error must be defined in the program]

__cxa_throw                         api/.libs/compactor.o
std::string::basic_string (const char*,const std::allocator<char>&)                  api/.libs/compactor.o
vtable for std::filebuf  api/.libs/compactor.o
__SUNW_ABIG3_cpp_personality        api/.libs/compactor.o
std::string::_Rep::_S_empty_rep_storage   api/.libs/compactor.o
[Hint: static member std::string::_Rep::_S_empty_rep_storage must be defined in the program]

std::string::compare(const char*)const                  api/.libs/compactor.o
__gnu_cxx::__exchange_and_add(volatile int*,int) api/.libs/compactor.o
std::string::basic_string (const char*,unsigned,const std::allocator<char>&)                 api/.libs/matchspy.o
std::__detail::_List_node_base::_M_unhook() queryparser/.libs/queryparser_internal.o
std::__throw_bad_alloc()            api/.libs/compactor.o
_Unwind_Resume                      api/.libs/compactor.o
__cxxabiv1::register_exit_code(void (*)(void)extern"C") api/.libs/query.o
typeinfo for std::bad_alloc                    backends/chert/.libs/chert_table.o
[Hint: static member typeinfo for std::bad_alloc must be defined in the program]

std::string::replace(unsigned,unsigned,const char*,unsigned)                backends/chert/.libs/chert_database.o
std::ostream::flush()                       api/.libs/replication.o
std::ostream & std::ostream::_M_insert<unsigned long long>(unsigned long long)            backends/chert/.libs/chert_check.o
std::ostream & std::ostream::_M_insert<bool>(bool)            backends/chert/.libs/chert_check.o
std::ostream & std::ostream::_M_insert<unsigned long>(unsigned long)            backends/chert/.libs/chert_check.o
std::_Rb_tree_increment(const std::_Rb_tree_node_base*) api/.libs/documentvaluelist.o
std::__basic_file<char>::~__basic_file()          api/.libs/compactor.o
vtable for __cxxabiv1::__vmi_class_type_info api/.libs/compactor.o
[Hint: static member vtable for __cxxabiv1::__vmi_class_type_info must be defined in the program]

std::string::reserve(unsigned)                     api/.libs/compactor.o
std::cerr                           net/.libs/remotetcpserver.o
[Hint: static member std::cerr must be defined in the program]

std::cout                           net/.libs/tcpserver.o
[Hint: static member std::cout must be defined in the program]

__cxxabiv1::vector_del(void*,unsigned,void (*)(void*)) backends/glass/.libs/glass_cursor.o
std::__detail::_List_node_base::swap(std::__detail::_List_node_base&,std::__detail::_List_node_base&) queryparser/.libs/queryparser_internal.o
std::string::_Rep::_S_create(unsigned,unsigned,const std::allocator<char>&)      backends/chert/.libs/chert_postlist.o
std::ios::clear(std::_Ios_Iostate) api/.libs/compactor.o
std::string::resize(unsigned,char)                     api/.libs/compactor.o
vtable for __cxxabiv1::__class_type_info api/.libs/compactor.o
[Hint: static member vtable for __cxxabiv1::__class_type_info must be defined in the program]

std::_Rb_tree_rebalance_for_erase(std::_Rb_tree_node_base*,std::_Rb_tree_rebalance_for_erase&) api/.libs/omdocument.o
std::string::_Rep::_M_destroy(const std::allocator<char>&)      api/.libs/compactor.o
std::ios_base::Init::~Init()             net/.libs/remotetcpserver.o
std::ios_base::Init::Init()             net/.libs/remotetcpserver.o
std::string::assign(const char*,unsigned)                   api/.libs/error.o
std::string::assign(const std::string &)                   api/.libs/compactor.o
std::filebuf::basic_filebuf() api/.libs/compactor.o
std::_Rb_tree_insert_and_rebalance(bool,std::_Rb_tree_node_base*,std::_Rb_tree_node_base,std::_Rb_tree_insert_and_rebalance&) api/.libs/matchspy.o
__cxa_pure_virtual                  api/.libs/errorhandler.o
std::ostream & std::__ostream_insert<char, std::char_traits<char> >(std::ostream &,const char*,int) api/.libs/compactor.o
std::ios::init(std::streambuf *) api/.libs/compactor.o
__cxa_rethrow                       api/.libs/compactor.o
__cxxabiv1::vector_new(void*,unsigned,unsigned,void (*)(void*),void (*)(void*)) backends/glass/.libs/glass_cursor.o
std::istream & std::getline<char, std::char_traits<char>, std::allocator<char> >(std::istream &,std::string &,char) api/.libs/compactor.o
std::string::_S_construct(unsigned,char,const std::allocator<char>&)       common/.libs/str.o
__cxa_vec_dtor                      backends/.libs/dbcheck.o
__cxa_vec_ctor                      backends/.libs/dbcheck.o
std::locale::~locale()                    api/.libs/compactor.o
typeinfo for std::ios_base                     api/.libs/compactor.o
[Hint: static member typeinfo for std::ios_base must be defined in the program]

std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*) api/.libs/queryinternal.o
std::string::find_first_not_of(const char*,unsigned,unsigned)const     api/.libs/valuerangeproc.o
std::_Rb_tree_decrement(std::_Rb_tree_node_base*) api/.libs/matchspy.o
std::bad_alloc::~bad_alloc()                 backends/chert/.libs/chert_table.o
ld: fatal: symbol referencing errors
*** Error code 2
make: Fatal error: Command failed for target `libxapian-1.3.la'
Current working directory /home/olly/xapian-core-1.3.2_git1069
*** Error code 1
The following command caused the error:
fail=; \
if (target_option=k; case ${target_option-} in  ?) ;;  *) echo "am__make_running_with_option: internal error: invalid"  "target option '${target_option-}' specified" >&2;  exit 1;;  esac;  has_opt=no;  sane_makeflags=$MAKEFLAGS;  if {  if test -z '1'; then  false;  elif test -n ''; then  true;  elif test -n '' && test -n ''; then  true;  else  false;  fi;  }; then  sane_makeflags=$MFLAGS;  else  case $MAKEFLAGS in  *\\[\ \      ]*)  bs=\\;  sane_makeflags=`printf '%s\n' "$MAKEFLAGS"  | sed "s/$bs$bs[$bs $bs        ]*//g"`;;  esac;  fi;  skip_next=no;  strip_trailopt ()  {  flg=`printf '%s\n' "$flg" | sed "s/$1.*$//"`;  };  for flg in $sane_makeflags; do  test $skip_next = yes && { skip_next=no; continue; };  case $flg in  *=*|--*) continue;;  -*I) strip_trailopt 'I'; skip_next=yes;;  -*I?*) strip_trailopt 'I';;  -*O) strip_trailopt 'O'; skip_next=yes;;  -*O?*) strip_trailopt 'O';;  -*l) strip_trailopt 'l'; skip_next=yes;;  -*l?*) strip_trailopt 'l';;  -[dEDm]) skip_next=yes;;  -[JT]) skip_next=yes;;  esac;  case $flg in  *$target_option*) has_opt=yes; break;;  esac;  done;  test $has_opt = yes); then \
  failcom='fail=yes'; \
else \
  failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo all-recursive | sed s/-recursive//`; \
case "all-recursive" in \
  distclean-* | maintainer-clean-*) list='. docs tests' ;; \
  *) list='. docs tests' ;; \
esac; \
for subdir in $list; do \
  echo "Making $target in $subdir"; \
  if test "$subdir" = "."; then \
    dot_seen=yes; \
    local_target="$target-am"; \
  else \
    local_target="$target"; \
  fi; \
  (CDPATH="${ZSH_VERSION+.}:" && cd $subdir && make  $local_target) \
  || eval $failcom; \
done; \
if test "$dot_seen" = "no"; then \
  make  "$target-am" || exit 1; \
fi; test -z "$fail"
make: Fatal error: Command failed for target `all-recursive'
Current working directory /home/olly/xapian-core-1.3.2_git1069
*** Error code 1
make: Fatal error: Command failed for target `all'

Original description:

I get a compilation error on Solaris 10 with Oracle Studio 12.3:

libtool: compile:  /opt/solarisstudio12.3/bin/CC -DHAVE_CONFIG_H -I. -I./common -I./include -I/opt/csw/include -xO3 -m32 -xarch=sparc -L/opt/csw/lib -c api/matchspy.cc -o api/matchspy.o >/dev/null 2>&1
source='api/omdatabase.cc' object='api/omdatabase.lo' libtool=yes \
DEPDIR=.deps depmode=none /bin/bash ./depcomp \
/bin/bash ./libtool  --tag=CXX   --mode=compile /opt/solarisstudio12.3/bin/CC  -DHAVE_CONFIG_H -I.  -I./common -I./include  -I/opt/csw/include  -xO3 -m32 -xarch=sparc -L/opt/csw/lib -c -o api/omdatabase.lo api/omdatabase.cc
libtool: compile:  /opt/solarisstudio12.3/bin/CC -DHAVE_CONFIG_H -I. -I./common -I./include -I/opt/csw/include -xO3 -m32 -xarch=sparc -L/opt/csw/lib -c api/omdatabase.cc  -KPIC -DPIC -o api/.libs/omdatabase.o
"api/omdatabase.cc", line 562: Error: Could not find a match for std::vector<unsigned>::vector(Xapian::Utf8Iterator, Xapian::Utf8Iterator) needed in Xapian::Database::get_spelling_suggestion(const std::string &, unsigned) const.
"api/omdatabase.cc", line 605: Error: Could not find a match for std::vector<unsigned>::assign(Xapian::Utf8Iterator, Xapian::Utf8Iterator) needed in Xapian::Database::get_spelling_suggestion(const std::string &, unsigned) const.
2 Error(s) detected.

Maybe cast is needed?

Attachments (1)

sun-c++-xldscope-symbolic.patch (833 bytes ) - added by Olly Betts 9 years ago.
Patch to use -xldscope-symbolic for Sun C++

Download all attachments as: .zip

Change History (18)

comment:1 by Olly Betts, 11 years ago

It used to be that Sun's compiler didn't cope with the code in the first case, but if you look around that line now, you'll see it's only used if __SUNPRO_CC < 0x580 - according to the ChangeLog I tested with 5.8 back in 2010 and it worked.

But the code in the second case compiled before, so perhaps this isn't related to that previous issue with Sun's compiler.

A cast won't help here - we can't cast the iterator objects to another type.

Do you know if Sun's implementation of the standard C++ library has improved? We currently force use of stlport4, but maybe that's now actually unhelpful now...

comment:2 by Olly Betts, 11 years ago

Looks like Cstd is forever frozen in the stone age (for "compatibility"), but as well as -library=stlport4, there's now -library=stdcxx4, which is an Apache implementation of the C++ standard library - that seems to handle the code in question better, though the docs say it's available on "Solaris 10 update 10 or Solaris 11", so that's not going to help on Solaris 9 I guess...

Last edited 11 years ago by Olly Betts (previous) (diff)

comment:3 by Olly Betts, 10 years ago

It seems likely we're going to make a compiler with C++11 support a requirement for 1.3.x (and releases going forwards) - at least nobody has so far raised any objections to my suggestion posted to the mailing list recently.

It looks like version 12.4 beta of this compiler adds partial C++11 support:

http://www.oracle.com/technetwork/server-storage/solarisstudio/overview/index.html

I suspect that the requirement to use a very recent version of this compiler will mean we no longer hit issues like the ones reported in this ticket.

comment:4 by Olly Betts, 10 years ago

Component: OtherBuild system
Description: modified (diff)
Milestone: 1.3.5
Summary: Compilation error in Xapian::Database::get_spelling_suggestionDoesn't build with Sun C++ since C++11 switch

I've done some test builds with the 12.4 compiler on unstable11s and fixed various errors that threw up.

The current status is that everything in xapian-core compiles cleanly, but the link fails, apparently due to failing to link the C++ runtime. I'm not sure how to resolve this - the man page for CC says that -G creates a shared object but doesn't link the standard libraries, but -std=c++11 is incompatible with the various options to specify standard libraries to link...

The original error reported here is no longer present though, so repurposing this ticket for getting it to build after the C++11 switch.

comment:5 by Olly Betts, 10 years ago

[226cec24ad572beb64829e1afb4bba4c9a6dd038] allows the library to build, but the tests fail with exception handling problems:

Running tests with backend "none"...
Running test: stubdb7...terminate called after throwing an instance of 'Xapian::DatabaseOpeningError'
sh: line 10: 1091: Abort(coredump)
FAIL: apitest
Running test: serialiseerror1...terminate called after throwing an instance of 'Xapian::DatabaseOpeningError'
sh: line 10: 1094: Abort(coredump)
FAIL: internaltest
Last edited 5 years ago by Olly Betts (previous) (diff)

comment:6 by Olly Betts, 9 years ago

Milestone: 1.3.51.4.x

This would be good to resolve, but we wouldn't hold the release of 1.4.0 due to a build failure with this compiler.

Last edited 9 years ago by Olly Betts (previous) (diff)

by Olly Betts, 9 years ago

Patch to use -xldscope-symbolic for Sun C++

comment:7 by Olly Betts, 9 years ago

The attached patched was sitting in a branch of my local repo. It doesn't seem sensible to apply it while Sun C++ fails to build xapian-core, but it would probably be useful to try it once that works. This option seems to be roughly equivalent to -Bsymbolic-functions in GCC, which we enable if we detect it is supported.

There's now a version 12.5 beta of this compiler according to the link above, with C++11 and C++14 mentioned in the list of changes, but it's not on opencsw yet.

comment:8 by Olly Betts, 5 years ago

Opencsw now has 12.6, so I tried a build with that, and also one with GCC on Solaris.

These shook out a few problems which I've fixed in [3a09d7cc6bf420e2a87a22f2580000055d7b0d6b] and commits preceding it.

However, with Sun C++ linking xapian-delve now fails with:

libtool: link: /opt/developerstudio12.6/bin/CC -erroff=voidretw -g -std=c++11 -errtags -o bin/.libs/xapian-delve bin/xapian-delve.o  ./.libs/libgetopt.a ./.libs/libxapian-1.5.so -lz -luuid -lnsl -lsocket -lm -R/usr/local/lib
ld: fatal: unwind table: file ./.libs/libgetopt.a(getopt.o): section .eh_frame%exchange(char**): unexpected negative integer encountered: offset 0x24

Only similar error I can find only was in this mysql bug, which doesn't enlighten me:

https://bugs.mysql.com/bug.php?id=94949

There's also a warning about use of an anonymous struct (which doesn't seem to be supported by C++11, but does seem to be a common extension). I guess we should eliminate the single use for maximum portability.

comment:9 by Olly Betts, 5 years ago

I can build the usual test programs (soaktest fails in a similar way to xapian-delve though).

unittest, internaltest and stemtest all pass.

apitest fails for honey like so:

Running test: expandweights7...terminate called after throwing an instance of 'Xapian::InvalidArgumentError'
Abort (core dumped)

This suggests exception handling isn't working correctly as the test harness should catch all exceptions. In fact from the commented above it looks like the same issue we were hitting 4 years ago.

But if I force a static library build (configure with --disable-shared) then the build completes and the testsuite passes except for a single failure with remotetcp_glass:

Running test: closedb5... FAIL: EXCEPTION std::string recursive delete of ".glass/dbw") failed, errno = File exists

Retrying just this testcase by hand, it seems to fail like that about half the time, and pass the other half.

comment:10 by Olly Betts, 5 years ago

It looks to me like that EEXIST is coming from rmdir() meaning the directory isn't empty.

Probably due to NFS being used and a file still being open.

comment:11 by Dagobert Michelsen, 5 years ago

Yes, this is a problem on the x86 hosts which get their homedirectories via NFS. As a workaround you can probably adjust the directory for intermediate results to /tmp or /var/tmp.

comment:12 by Olly Betts, 5 years ago

This was actually on sparc, but that also seems to have NFS home directories:

olly@unstable11s [unstable11s]:~ > uname -a
SunOS unstable11s 5.11 11.3 sun4u sparc SUNW,SPARC-Enterprise
olly@unstable11s [unstable11s]:~ > df .
/home/olly         (csw:/export/home/olly):102661149 blocks 102661149 files

I've since tried adding some debug code to ls -la the directory if the rmdir() fails and that confirms there's a .nfsXXX file in it.

The harness is meant to wait for remote server processes to exit after each testcase. It's not clear to me if this mechanism isn't working properly, or if it is but there's some window after than before NFS knows it doesn't need to keep the file around, or if this file is actually from something else entirely.

Looks like /tmp is mounted on swap, so /var/tmp is probably a better choice for a build tree. It'd likely make for a much speedier build too.

comment:13 by Dagobert Michelsen, 5 years ago

Ah yes, Solaris 11 Sparc is also a different machine than the one carrying the homedirs and therefore uses NFS. I'd suggest to go with /var/tmp, just please make sure to clean it regularly as I usually don't expect user stuff to be there :-)

comment:14 by Olly Betts, 5 years ago

I've eliminated the single use of an anonymous struct in [4393a20ef133c99733acb129b2ba65f7f576814b].

Retrying a build in the Sun compiler using a build directory under /var/tmp and building with --disable-shared xapian-core now builds and passes gmake check. A build with a shared library fails as above still.

comment:15 by Olly Betts, 5 years ago

I applied a revised version of the -xldscope=symbolic patch to git master in [e8696a2542b4bd8f05c3f18c8fe23b6f659e4958]. The "negative offset" issue with a shared build is still there, as it the exception handling fail.

There is also a problem I haven't noted before with configure picking up libicuc but then the link failing. I'm assuming this is because libicuc has a C++ API but was built with GCC, which presumably isn't ABI compatible with Sun C++. We could try a link test on a simple program in configure. We should also really have a --without-icu or similar option (currently it seems there isn't a good way - I had to adjust the configure test to always fail).

comment:16 by Olly Betts, 5 years ago

Milestone: 1.4.x1.4.14
Status: newassigned

I retested and the shared library build still fails with:

CC: Studio 12.6 Sun C++ 5.15 SunOS_sparc Patch 152715-02 2018/06/08

I ran configure like so:

/home/olly/xapian/xapian-core/configure CXX=/opt/developerstudio12.6/bin/CC CC=/opt/developerstudio12.6/bin/cc MAKE=gmake

Link-time warnings and errors:

olly@unstable11s [unstable11s]:/var/tmp/olly > gmake
gmake  all-recursive
gmake[1]: Entering directory '/var/tmp/olly'
Making all in .
gmake[2]: Entering directory '/var/tmp/olly'
source='/home/olly/xapian/xapian-core/bin/xapian-delve.cc' object='bin/xapian-delve.o' libtool=no \
DEPDIR=.deps depmode=none /bin/sh /home/olly/xapian/xapian-core/depcomp \
/opt/developerstudio12.6/bin/CC -DHAVE_CONFIG_H -I. -I/home/olly/xapian/xapian-core  -I/home/olly/xapian/xapian-core/common -I/home/olly/xapian/xapian-core/include -I'./include'  -I/home/olly/xapian/xapian-core/languages -Ilanguages -I/home/olly/xapian/xapian-core/queryparser  -errtags -erroff=oklambdaretmulti,voidretw  -g -std=c++11 -c -o bin/xapian-delve.o /home/olly/xapian/xapian-core/bin/xapian-delve.cc
/bin/sh ./libtool  --tag=CXX   --mode=link /opt/developerstudio12.6/bin/CC -errtags -erroff=oklambdaretmulti,voidretw  -g -std=c++11   -o bin/xapian-delve bin/xapian-delve.o  libgetopt.la libxapian-1.5.la -lm 
libtool: link: /opt/developerstudio12.6/bin/CC -errtags -erroff=oklambdaretmulti,voidretw -g -std=c++11 -o bin/.libs/xapian-delve bin/xapian-delve.o  ./.libs/libgetopt.a ./.libs/libxapian-1.5.so -lz -luuid -lnsl -lsocket -lm -R/usr/local/lib
ld: warning: unwind table: file ./.libs/libgetopt.a(getopt.o): section .eh_frame%exchange(char**): suspicious InitialLoc value 0: binary search table will be incomplete if section requires runtime relocation
source='/home/olly/xapian/xapian-core/bin/xapian-check.cc' object='bin/xapian-check.o' libtool=no \
DEPDIR=.deps depmode=none /bin/sh /home/olly/xapian/xapian-core/depcomp \
/opt/developerstudio12.6/bin/CC -DHAVE_CONFIG_H -I. -I/home/olly/xapian/xapian-core  -I/home/olly/xapian/xapian-core/common -I/home/olly/xapian/xapian-core/include -I'./include'  -I/home/olly/xapian/xapian-core/languages -Ilanguages -I/home/olly/xapian/xapian-core/queryparser  -errtags -erroff=oklambdaretmulti,voidretw  -g -std=c++11 -c -o bin/xapian-check.o /home/olly/xapian/xapian-core/bin/xapian-check.cc
/bin/sh ./libtool  --tag=CXX   --mode=link /opt/developerstudio12.6/bin/CC -errtags -erroff=oklambdaretmulti,voidretw  -g -std=c++11   -o bin/xapian-check bin/xapian-check.o  libxapian-1.5.la -lm 
libtool: link: /opt/developerstudio12.6/bin/CC -errtags -erroff=oklambdaretmulti,voidretw -g -std=c++11 -o bin/.libs/xapian-check bin/xapian-check.o  ./.libs/libxapian-1.5.so -lz -luuid -lnsl -lsocket -lm -R/usr/local/lib
source='/home/olly/xapian/xapian-core/bin/xapian-compact.cc' object='bin/xapian-compact.o' libtool=no \
DEPDIR=.deps depmode=none /bin/sh /home/olly/xapian/xapian-core/depcomp \
/opt/developerstudio12.6/bin/CC -DHAVE_CONFIG_H -I. -I/home/olly/xapian/xapian-core  -I/home/olly/xapian/xapian-core/common -I/home/olly/xapian/xapian-core/include -I'./include'  -I/home/olly/xapian/xapian-core/languages -Ilanguages -I/home/olly/xapian/xapian-core/queryparser  -errtags -erroff=oklambdaretmulti,voidretw  -g -std=c++11 -c -o bin/xapian-compact.o /home/olly/xapian/xapian-core/bin/xapian-compact.cc
/bin/sh ./libtool  --tag=CXX   --mode=link /opt/developerstudio12.6/bin/CC -errtags -erroff=oklambdaretmulti,voidretw  -g -std=c++11   -o bin/xapian-compact bin/xapian-compact.o  libgetopt.la libxapian-1.5.la -lm 
libtool: link: /opt/developerstudio12.6/bin/CC -errtags -erroff=oklambdaretmulti,voidretw -g -std=c++11 -o bin/.libs/xapian-compact bin/xapian-compact.o  ./.libs/libgetopt.a ./.libs/libxapian-1.5.so -lz -luuid -lnsl -lsocket -lm -R/usr/local/lib
source='/home/olly/xapian/xapian-core/bin/xapian-progsrv.cc' object='bin/xapian-progsrv.o' libtool=no \
DEPDIR=.deps depmode=none /bin/sh /home/olly/xapian/xapian-core/depcomp \
/opt/developerstudio12.6/bin/CC -DHAVE_CONFIG_H -I. -I/home/olly/xapian/xapian-core  -I/home/olly/xapian/xapian-core/common -I/home/olly/xapian/xapian-core/include -I'./include'  -I/home/olly/xapian/xapian-core/languages -Ilanguages -I/home/olly/xapian/xapian-core/queryparser  -errtags -erroff=oklambdaretmulti,voidretw  -g -std=c++11 -c -o bin/xapian-progsrv.o /home/olly/xapian/xapian-core/bin/xapian-progsrv.cc
/bin/sh ./libtool  --tag=CXX   --mode=link /opt/developerstudio12.6/bin/CC -errtags -erroff=oklambdaretmulti,voidretw  -g -std=c++11   -o bin/xapian-progsrv bin/xapian-progsrv.o  libgetopt.la libxapian-1.5.la -lm 
libtool: link: /opt/developerstudio12.6/bin/CC -errtags -erroff=oklambdaretmulti,voidretw -g -std=c++11 -o bin/.libs/xapian-progsrv bin/xapian-progsrv.o  ./.libs/libgetopt.a ./.libs/libxapian-1.5.so -lz -luuid -lnsl -lsocket -lm -R/usr/local/lib
ld: warning: unwind table: file ./.libs/libgetopt.a(getopt.o): section .eh_frame%exchange(char**): suspicious InitialLoc value 0: binary search table will be incomplete if section requires runtime relocation
source='/home/olly/xapian/xapian-core/bin/xapian-replicate.cc' object='bin/xapian-replicate.o' libtool=no \
DEPDIR=.deps depmode=none /bin/sh /home/olly/xapian/xapian-core/depcomp \
/opt/developerstudio12.6/bin/CC -DHAVE_CONFIG_H -I. -I/home/olly/xapian/xapian-core  -I/home/olly/xapian/xapian-core/common -I/home/olly/xapian/xapian-core/include -I'./include'  -I/home/olly/xapian/xapian-core/languages -Ilanguages -I/home/olly/xapian/xapian-core/queryparser  -errtags -erroff=oklambdaretmulti,voidretw  -g -std=c++11 -c -o bin/xapian-replicate.o /home/olly/xapian/xapian-core/bin/xapian-replicate.cc
/bin/sh ./libtool  --tag=CXX   --mode=link /opt/developerstudio12.6/bin/CC -errtags -erroff=oklambdaretmulti,voidretw  -g -std=c++11   -o bin/xapian-replicate bin/xapian-replicate.o  libgetopt.la libxapian-1.5.la -lm 
libtool: link: /opt/developerstudio12.6/bin/CC -errtags -erroff=oklambdaretmulti,voidretw -g -std=c++11 -o bin/.libs/xapian-replicate bin/xapian-replicate.o  ./.libs/libgetopt.a ./.libs/libxapian-1.5.so -lz -luuid -lnsl -lsocket -lm -R/usr/local/lib
ld: fatal: unwind table: file ./.libs/libgetopt.a(getopt.o): section .eh_frame%exchange(char**): unexpected negative integer encountered: offset 0x40

gmake[2]: *** [Makefile:2794: bin/xapian-replicate] Error 2
gmake[2]: Leaving directory '/var/tmp/olly'
gmake[1]: *** [Makefile:3954: all-recursive] Error 1
gmake[1]: Leaving directory '/var/tmp/olly'
gmake: *** [Makefile:1918: all] Error 2

We could auto-disable shared libraries based on the compiler, but it requires a lot of reordering of the configure code so given this isn't a compiler many people actually use I've taken the easier route and just documented the need to configure with --disable-shared in xapian-core/INSTALL in [02fdc5fe44224d93f8444484255a103aa916d77e]. Marking to backport to 1.4.x.

comment:17 by Olly Betts, 5 years ago

Resolution: fixed
Status: assignedclosed

Backported for 1.4.14 in [4efbd45aa47028f0c07911eb635051819ebe44a0].

Note: See TracTickets for help on using tickets.