facebook/folly

/usr/include/c++/v1/cxxabi.h:182:8: error: redefinition of '__cxa_eh_globals'

yurivict opened this issue · 2 comments

[ 62% 217/338] /usr/local/libexec/ccache/c++ -DFMT_SHARED -DFOLLY_XLOG_STRIP_PREFIXES=\"/wrkdirs/usr/ports/devel/folly/work/folly-2024.06.17.00:/wrkdirs/usr/ports/devel/folly/work/.build\" -DGFLAGS_IS_A_DLL=0 -D_GNU_SOURCE -D_REENTRANT -I/wrkdirs/usr/ports/devel/folly/work/folly-2024.06.17.00 -I/wrkdirs/usr/ports/devel/folly/work/.build -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -fPIC -DGLOG_USE_GLOG_EXPORT -isystem /usr/local/include -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -fPIC -DGLOG_USE_GLOG_EXPORT -isystem /usr/local/include  -DNDEBUG -g -Wall -Wextra -O3 -std=gnu++17 -fPIC -g -finput-charset=UTF-8 -fsigned-char -Wall -Wno-deprecated -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused -Wuninitialized -Wunused-label -Wunused-result -Wno-noexcept-type -Wno-nullability-completeness -Wno-inconsistent-missing-override -faligned-new -fopenmp -MD -MT CMakeFiles/folly_base.dir/folly/lang/Exception.cpp.o -MF CMakeFiles/folly_base.dir/folly/lang/Exception.cpp.o.d -o CMakeFiles/folly_base.dir/folly/lang/Exception.cpp.o -c /wrkdirs/usr/ports/devel/folly/work/folly-2024.06.17.00/folly/lang/Exception.cpp 
FAILED: CMakeFiles/folly_base.dir/folly/lang/Exception.cpp.o
/usr/local/libexec/ccache/c++ -DFMT_SHARED -DFOLLY_XLOG_STRIP_PREFIXES=\"/wrkdirs/usr/ports/devel/folly/work/folly-2024.06.17.00:/wrkdirs/usr/ports/devel/folly/work/.build\" -DGFLAGS_IS_A_DLL=0 -D_GNU_SOURCE -D_REENTRANT -I/wrkdirs/usr/ports/devel/folly/work/folly-2024.06.17.00 -I/wrkdirs/usr/ports/devel/folly/work/.build -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -fPIC -DGLOG_USE_GLOG_EXPORT -isystem /usr/local/include -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -fPIC -DGLOG_USE_GLOG_EXPORT -isystem /usr/local/include  -DNDEBUG -g -Wall -Wextra -O3 -std=gnu++17 -fPIC -g -finput-charset=UTF-8 -fsigned-char -Wall -Wno-deprecated -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused -Wuninitialized -Wunused-label -Wunused-result -Wno-noexcept-type -Wno-nullability-completeness -Wno-inconsistent-missing-override -faligned-new -fopenmp -MD -MT CMakeFiles/folly_base.dir/folly/lang/Exception.cpp.o -MF CMakeFiles/folly_base.dir/folly/lang/Exception.cpp.o.d -o CMakeFiles/folly_base.dir/folly/lang/Exception.cpp.o -c /wrkdirs/usr/ports/devel/folly/work/folly-2024.06.17.00/folly/lang/Exception.cpp
In file included from /wrkdirs/usr/ports/devel/folly/work/folly-2024.06.17.00/folly/lang/Exception.cpp:227:
/usr/include/c++/v1/cxxabi.h:182:8: error: redefinition of '__cxa_eh_globals'
struct __cxa_eh_globals
       ^
/wrkdirs/usr/ports/devel/folly/work/folly-2024.06.17.00/folly/lang/Exception.cpp:29:8: note: previous definition is here
struct __cxa_eh_globals {                             
       ^
/wrkdirs/usr/ports/devel/folly/work/folly-2024.06.17.00/folly/lang/Exception.cpp:636:23: error: no member named '__cxa_allocate_exception' in namespace '__cxxabiv1'
  void* object = abi::__cxa_allocate_exception(arg.size);
                 ~~~~~^                               
/wrkdirs/usr/ports/devel/folly/work/folly-2024.06.17.00/folly/lang/Exception.cpp:642:41: error: no member named 'get_unexpected' in namespace 'std'
    exception->unexpectedHandler = std::get_unexpected();
                                   ~~~~~^
/wrkdirs/usr/ports/devel/folly/work/folly-2024.06.17.00/folly/lang/Exception.cpp:655:42: error: no member named '__cxa_free_exception' in namespace '__cxxabiv1'
    scope_guard_ rollback{std::bind(abi::__cxa_free_exception, object)};
                                    ~~~~~^ 
/wrkdirs/usr/ports/devel/folly/work/folly-2024.06.17.00/folly/lang/Exception.cpp:601:10: error: no matching function for call to 'catch_exception'
  return catch_exception(static_cast<Try&&>(t), std::current_exception);
         ^~~~~~~~~~~~~~~
/wrkdirs/usr/ports/devel/folly/work/folly-2024.06.17.00/folly/lang/Exception.cpp:654:10: note: in instantiation of function template specialization 'folly::detail::catch_current_exception_<(lambda at /wrkdirs/usr/ports/devel/folly/work/folly-2024.06.17.00/folly/lang/Exception.cpp:654:35)>' requested here
  return catch_current_exception_([&] {    
         ^
/wrkdirs/usr/ports/devel/folly/work/folly-2024.06.17.00/folly/lang/Exception.h:243:24: note: candidate template ignored: couldn't infer template argument 'E'
FOLLY_ERASE_TRYCATCH R catch_exception(Try&& t, Catch&& c, CatchA&&... a) {
                       ^

@Orvid @yfeldblum
This problem seems to have similar reasons as #2232

clang-18
FreeBSD 14.1

@Orvid @yfeldblum
There is still something wrong with this.
With this patch, it builds for me on FreeBSD 14.1-STABLE, but it fails on 14.0-RELEASE-p4.

/wrkdirs/usr/ports/devel/folly/work/folly-2024.06.17.00/folly/lang/Exception.cpp:637:23: error: no member named '__cxa_allocate_exception' in namespace '__cxxabiv1'
  void* object = abi::__cxa_allocate_exception(arg.size);
                 ~~~~~^
/wrkdirs/usr/ports/devel/folly/work/folly-2024.06.17.00/folly/lang/Exception.cpp:643:41: error: no member named 'get_unexpected' in namespace 'std'
    exception->unexpectedHandler = std::get_unexpected();
                                   ~~~~~^
/wrkdirs/usr/ports/devel/folly/work/folly-2024.06.17.00/folly/lang/Exception.cpp:656:42: error: no member named '__cxa_free_exception' in namespace '__cxxabiv1'
    scope_guard_ rollback{std::bind(abi::__cxa_free_exception, object)};
                                    ~~~~~^
/wrkdirs/usr/ports/devel/folly/work/folly-2024.06.17.00/folly/lang/Exception.cpp:602:10: error: no matching function for call to 'catch_exception'
  return catch_exception(static_cast<Try&&>(t), std::current_exception);
         ^~~~~~~~~~~~~~~

@yurivict Ah, I only tested on 14.1.