-m32 is not compatible with -freg-struct-return #6700
Labels
c++
inactive
Denotes the issue/PR has not seen activity in the last 90 days.
platform related
Any issue releated to specific platform or OS
What version of protobuf and what language are you using?
Version: master
Language: C++
What operating system (Linux, Windows, ...) and version?
Linux
What runtime / compiler are you using (e.g., python version or gcc version)
gcc version 7.3.0 (GCC)
What did you do?
Steps to reproduce the behavior:
git clone
the master branch.mkdir build && cd build
cmake -DCMAKE_CXX_FLAGS="-m32 -freg-struct-return" -DCMAKE_INSTALL_PREFIX=$PWD -DBUILD_SHARED_LIBS=ON -Dprotobuf_BUILD_TESTS=OFF -Dprotobuf_BUILD_PROTOC_BINARIES=ON -Dprotobuf_WITH_ZLIB=OFF DCMAKE_SKIP_RPATH=TRUE ../cmake
What did you expect to see
the protoc will print the help information.
What did you see instead?
Segmentation fault (core dumped)
Make sure you include information that can help us debug (full error message, exception listing, stack trace, logs).
cd build && gdb ./protoc
(gdb) start
(gdb) bt
#0 0xf7367570 in std::__detail::_Prime_rehash_policy::_M_need_rehash(unsigned int, unsigned int, unsigned int) const () from /usr/lib/libstdc++.so.6
#1 0xf79454bb in std::_Hashtable<char const*, std::pair<char const* const, google::protobuf::internal::DescriptorTable const*>, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> >, std::__detail::_Select1st, google::protobuf::streq, google::protobuf::hash<char const*>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_insert_unique_node(unsigned int, unsigned int, std::__detail::_Hash_node<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*>, true>) () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#2 0xf7944ea0 in std::pair<std::__detail::_Node_iterator<std::pair<char const const, google::protobuf::internal::DescriptorTable const*>, false, true>, bool> std::_Hashtable<char const*, std::pair<char const* const, google::protobuf::internal::DescriptorTable const*>, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> >, std::__detail::_Select1st, google::protobuf::streq, google::protobuf::hash<char const*>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_insert<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> const&, std::__detail::_AllocNode<std::allocator<std::__detail::_Hash_node<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*>, true> > > >(std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> const&, std::__detail::_AllocNode<std::allocator<std::__detail::_Hash_node<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*>, true> > > const&, std::integral_constant<bool, true>) () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#3 0xf7944832 in std::__detail::_Insert_base<char const*, std::pair<char const* const, google::protobuf::internal::DescriptorTable const*>, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> >, std::__detail::_Select1st, google::protobuf::streq, google::protobuf::hash<char const*>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::insert(std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> const&) () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#4 0xf7944066 in std::unordered_map<char const*, google::protobuf::internal::DescriptorTable const*, google::protobuf::hash<char const*>, google::protobuf::streq, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> > >::insert(std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> const&) () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#5 0xf7943a6a in bool google::protobuf::InsertIfNotPresent<std::unordered_map<char const*, google::protobuf::internal::DescriptorTable const*, google::protobuf::hash<char const*>, google::protobuf::streq, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> > > >(std::unordered_map<char const*, google::protobuf::internal::DescriptorTable const*, google::protobuf::hash<char const*>, google::protobuf::streq, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> > >, std::unordered_map<char const, google::protobuf::internal::DescriptorTable const*, google::protobuf::hash<char const*>, google::protobuf::streq, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> > >::value_type const&) () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#6 0xf79433ca in bool google::protobuf::InsertIfNotPresent<std::unordered_map<char const*, google::protobuf::internal::DescriptorTable const*, google::protobuf::hash<char const*>, google::protobuf::streq, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> > > >(std::unordered_map<char const*, google::protobuf::internal::DescriptorTable const*, google::protobuf::hash<char const*>, google::protobuf::streq, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> > >, std::unordered_map<char const, google::protobuf::internal::DescriptorTable const*, google::protobuf::hash<char const*>, google::protobuf::streq, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> > >::value_type::first_type const&, std::unordered_map<char const*, google::protobuf::internal::DescriptorTable const*, google::protobuf::hash<char const*>, google::protobuf::streq, std::allocator<std::pair<char const* const, google::protobuf::internal::DescriptorTable const*> > >::value_type::second_type const&) () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#7 0xf7940efe in google::protobuf::(anonymous namespace)::GeneratedMessageFactory::RegisterFile(google::protobuf::internal::DescriptorTable const*) () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#8 0xf79414dd in google::protobuf::MessageFactory::InternalRegisterGeneratedFile(google::protobuf::internal::DescriptorTable const*) () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#9 0xf7907c4c in google::protobuf::(anonymous namespace)::AddDescriptorsImpl(google::protobuf::internal::DescriptorTable const*) () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#10 0xf7907cba in google::protobuf::internal::AddDescriptors(google::protobuf::internal::DescriptorTable const*) () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#11 0xf782192e in __static_initialization_and_destruction_0 () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#12 0xf782195d in _GLOBAL__sub_I_any.pb.cc () from /home/bibei/Workspace/protobuf-master/build/libprotobuf.so.3.10.0.0
#13 0xf7feabfe in call_init.part () from /lib/ld-linux.so.2
#14 0xf7feacf4 in _dl_init () from /lib/ld-linux.so.2
#15 0xf7fdc12f in _dl_start_user () from /lib/ld-linux.so.2
Anything else we should know about your project / environment
I modify the
CMAKE_CXX_FLAGS
, using-m32
and-freg-struct-return
together.The text was updated successfully, but these errors were encountered: