Skip to content

Error when compiling with -DBUILD_SHARED_LIBS=ON #384

@xkonni

Description

@xkonni

trying to compile openr with the build_openr.sh on a vanilla ubuntu 20.04 docker container.

after some fixing the build script (patch: openr-build-2004.txt) i manage to compile until fbthrift, which fails with the message error: relocation refers to local symbol "" [3032]

Details here:

      |                                                                            ^
/src/openr/build/deps/fbthrift/thrift/lib/cpp/concurrency/Mutex.h:246:37: warning: 'ReadWriteMutex' is deprecated: use folly::SharedMutex, std::shared_mutex, or std::shared_timed_mutex [-Wdeprecated-declarations]
  246 |   const ReadWriteMutex* rw_mutex_ = nullptr;
      |                                     ^~~~~~~
/src/openr/build/deps/fbthrift/thrift/lib/cpp/concurrency/Mutex.h:67:80: note: declared here
   67 |     "use folly::SharedMutex, std::shared_mutex, or std::shared_timed_mutex")]] ReadWriteMutex {
      |                                                                                ^~~~~~~~~~~~~~
[100%] Linking CXX shared library ../../../lib/libthriftcpp2.so
CMakeFiles/thriftcpp2.dir/util/ScopedServerInterfaceThread.cpp.o(.note.stapsdt+0x14): error: relocation refers to local symbol "" [3032], which is defined in a discarded section
  section group signature: "_ZN6apache6thrift11concurrency13ThreadManager5ImplTIN5folly11LifoSemImplISt6atomicNS4_19SaturatingSemaphoreILb1ES6_EEEEE15reportTaskStatsERKNS2_4TaskERKNSt6chrono10time_pointINSE_3_V212steady_clockENSE_8durationIlSt5ratioILl1ELl1000000000EEEEEESO_"
  prevailing definition is from CMakeFiles/thriftcpp2.dir/server/ThriftServer.cpp.o
collect2: error: ld returned 1 exit status
make[2]: *** [thrift/lib/cpp2/CMakeFiles/thriftcpp2.dir/build.make:994: lib/libthriftcpp2.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:747: thrift/lib/cpp2/CMakeFiles/thriftcpp2.dir/all] Error 2
make: *** [Makefile:130: all] Error 2

This is related to the -DBUILD_SHARED_LIBS=ON flag, removing it does fix the fbthrift compilation.
However the next openr-dependency fbzmq requires it.

Does anyone know how to address this?

Thank you so much!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions