Skip to content

Compilation with CMake Failure - Undefined references VarintUtilsTest VarintUtilsBench #682

@envolution

Description

@envolution
{standard input}: Assembler messages:
{standard input}:1375: Warning: setting incorrect section attributes for .rodata.thrift.data
[828/857] Building CXX object thrift/lib/cpp2/test/CMakeFiles/ProtocolBench.dir/__/__/__/conformance/if/gen-cpp2/patch_data_types.cpp.o
[829/857] Building CXX object thrift/lib/cpp2/test/CMakeFiles/ProtocolBench.dir/__/__/__/conformance/if/gen-cpp2/patch_data_types_binary.cpp.o
[830/857] Building CXX object thrift/lib/cpp2/test/CMakeFiles/ProtocolBench.dir/__/__/__/conformance/if/gen-cpp2/patch_data_types_serialization.cpp.o
[831/857] Building CXX object thrift/lib/cpp2/test/CMakeFiles/ProtocolBench.dir/__/__/__/conformance/if/gen-cpp2/patch_data_types_compact.cpp.o
[832/857] Building CXX object thrift/lib/cpp2/test/CMakeFiles/ProtocolBench.dir/__/__/__/conformance/if/gen-cpp2/serialization_metadata.cpp.o
[833/857] Building CXX object thrift/lib/cpp2/test/CMakeFiles/ProtocolBench.dir/__/__/__/conformance/if/gen-cpp2/conformance_constants.cpp.o
[834/857] Building CXX object thrift/lib/cpp2/test/CMakeFiles/ProtocolBench.dir/__/__/__/conformance/if/gen-cpp2/conformance_data.cpp.o
[835/857] Building CXX object thrift/lib/cpp2/test/CMakeFiles/ProtocolBench.dir/__/__/__/conformance/if/gen-cpp2/conformance_types_binary.cpp.o
[836/857] Building CXX object thrift/lib/cpp2/test/CMakeFiles/ProtocolBench.dir/__/__/__/conformance/if/gen-cpp2/conformance_types.cpp.o
[837/857] Linking CXX executable bin/VarintUtilsBench
FAILED: [code=1] bin/VarintUtilsBench 
: && /usr/bin/c++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection         -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/home/builder/pkg_builds/build-fbthrift-4f82ba17/src=/usr/src/debug/fbthrift -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now          -Wl,-z,pack-relative-relocs -Wl,--dependency-file=thrift/lib/cpp/util/test/CMakeFiles/VarintUtilsBench.dir/link.d thrift/lib/cpp/util/test/CMakeFiles/VarintUtilsBench.dir/VarintUtilsBench.cpp.o -o bin/VarintUtilsBench  -Wl,-rpath,/home/builder/pkg_builds/build-fbthrift-4f82ba17/src/fbthrift-2025.11.17.00/build/lib:  lib/libthriftcpp2.so.2025.11.17.00  /usr/lib/libfollybenchmark.so.2025.11.17.00  lib/libthriftfrozen2.so.2025.11.17.00  lib/libthriftmetadata.so.2025.11.17.00  lib/libthriftanyrep.so  lib/libthrifttype.so.2025.11.17.00  lib/libthriftprotocol.so.2025.11.17.00  lib/libasync.so.2025.11.17.00  lib/libruntime.so  lib/libtransport.so.2025.11.17.00  lib/librpcmetadata.so.2025.11.17.00  lib/libconcurrency.so.2025.11.17.00  /lib/libzstd.so  /usr/lib/libwangle.so.2025.11.17.00  /usr/lib/libfizz.so.2025.11.17.00  /usr/lib/libz.so  /usr/lib/libsodium.so  /usr/lib/librt.a  lib/libthrift-core.so.2025.11.17.00  lib/libthrifttyperep.so.2025.11.17.00  lib/libthriftannotation.so.2025.11.17.00  lib/libcommon.so  lib/libserverdbginfo.so.2025.11.17.00  /usr/lib/libxxhash.so  /usr/lib/libfolly.so.2025.11.17.00  /usr/lib/libfmt.so.12.1.0  /usr/lib/libgflags.so.2.2.2  /usr/lib/libboost_context.so.1.89.0  /usr/lib/libboost_filesystem.so.1.89.0  /usr/lib/libboost_program_options.so.1.89.0  /usr/lib/libboost_regex.so.1.89.0  /usr/lib/libboost_thread.so.1.89.0  /usr/lib/libboost_atomic.so.1.89.0  /usr/lib/libboost_chrono.so.1.89.0  /usr/lib/libboost_container.so.1.89.0  /usr/lib/libboost_date_time.so.1.89.0  /usr/lib/libdouble-conversion.so  /usr/lib/libglog.so.0.7.1  /usr/lib/libgflags.so.2.2.2  /usr/lib/libevent.so  /usr/lib/libz.so  /usr/lib/libssl.so  /usr/lib/libcrypto.so  /usr/lib/libbz2.so  /usr/lib/liblzma.so  /usr/lib/liblz4.so  /usr/lib/libzstd.so  /usr/lib/libsnappy.so  /usr/lib/libdwarf.so  /usr/lib/libiberty.a  /usr/lib/libaio.so  /usr/lib/liburing.so  /usr/lib/libsodium.so  -ldl  /usr/lib/libunwind.so && :
/usr/bin/ld: lib/libthriftmetadata.so.2025.11.17.00: undefined reference to `apache::thrift::detail::md::genStructFieldMetadata(apache::thrift::syntax_graph::StructuredNode const&, apache::thrift::metadata::ThriftField&, apache::thrift::detail::md::EncodedThriftField const&, unsigned long)'
/usr/bin/ld: lib/libthrifttype.so.2025.11.17.00: undefined reference to `apache::thrift::type::AnyStruct::AnyStruct()'
/usr/bin/ld: lib/libthrifttype.so.2025.11.17.00: undefined reference to `apache::thrift::type::SemiAnyStruct::~SemiAnyStruct()'
/usr/bin/ld: lib/libthriftmetadata.so.2025.11.17.00: undefined reference to `apache::thrift::detail::md::structuredAnnotationsEquality(std::vector<apache::thrift::metadata::ThriftConstStruct, std::allocator<apache::thrift::metadata::ThriftConstStruct> >, std::vector<apache::thrift::metadata::ThriftConstStruct, std::allocator<apache::thrift::metadata::ThriftConstStruct> >, std::vector<apache::thrift::syntax_graph::TypeRef, std::allocator<apache::thrift::syntax_graph::TypeRef> > const&)'
/usr/bin/ld: lib/libthriftmetadata.so.2025.11.17.00: undefined reference to `apache::thrift::detail::md::cvInteger(long)'
/usr/bin/ld: lib/libthrifttype.so.2025.11.17.00: undefined reference to `apache::thrift::type::SemiAnyStruct::SemiAnyStruct()'
/usr/bin/ld: lib/libthrifttype.so.2025.11.17.00: undefined reference to `apache::thrift::type::SemiAnyStruct::SemiAnyStruct(apache::thrift::type::SemiAnyStruct&&)'
/usr/bin/ld: lib/libthriftmetadata.so.2025.11.17.00: undefined reference to `apache::thrift::detail::md::genStructMetadata(apache::thrift::metadata::ThriftMetadata&, apache::thrift::syntax_graph::StructuredNode const&, apache::thrift::detail::md::Options)'
/usr/bin/ld: lib/libthrifttype.so.2025.11.17.00: undefined reference to `apache::thrift::type::AnyStruct::~AnyStruct()'
/usr/bin/ld: lib/libthriftmetadata.so.2025.11.17.00: undefined reference to `apache::thrift::detail::md::cvString(char const*)'
/usr/bin/ld: lib/libthriftmetadata.so.2025.11.17.00: undefined reference to `apache::thrift::detail::md::genEnumMetadata(apache::thrift::metadata::ThriftMetadata&, apache::thrift::syntax_graph::EnumNode const&, apache::thrift::detail::md::Options)'
/usr/bin/ld: lib/libthriftmetadata.so.2025.11.17.00: undefined reference to `apache::thrift::detail::md::getAnnotationTypes(std::span<apache::thrift::syntax_graph::Annotation const, 18446744073709551615ul>)'
/usr/bin/ld: lib/libthriftmetadata.so.2025.11.17.00: undefined reference to `apache::thrift::detail::md::genServiceMetadata(apache::thrift::syntax_graph::ServiceNode const&, apache::thrift::metadata::ThriftMetadata&, apache::thrift::detail::md::Options)'
/usr/bin/ld: lib/libthriftmetadata.so.2025.11.17.00: undefined reference to `apache::thrift::detail::md::cvStruct(char const*, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, apache::thrift::metadata::ThriftConstValue, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, apache::thrift::metadata::ThriftConstValue> > >&&)'
/usr/bin/ld: lib/libthriftmetadata.so.2025.11.17.00: undefined reference to `apache::thrift::detail::md::schemaRegistryMutex()'
collect2: error: ld returned 1 exit status
[838/857] Linking CXX executable bin/VarintUtilsTest
FAILED: [code=1] bin/VarintUtilsTest thrift/lib/cpp/util/test/VarintUtilsTest[1]_tests.cmake /home/builder/pkg_builds/build-fbthrift-4f82ba17/src/fbthrift-2025.11.17.00/build/thrift/lib/cpp/util/test/VarintUtilsTest[1]_tests.cmake 
: && /usr/bin/c++ -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=3 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection         -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -Wp,-D_GLIBCXX_ASSERTIONS -g -ffile-prefix-map=/home/builder/pkg_builds/build-fbthrift-4f82ba17/src=/usr/src/debug/fbthrift -Wl,-O1 -Wl,--sort-common -Wl,--as-needed -Wl,-z,relro -Wl,-z,now          -Wl,-z,pack-relative-relocs -Wl,--dependency-file=thrift/lib/cpp/util/test/CMakeFiles/VarintUtilsTest.dir/link.d thrift/lib/cpp/util/test/CMakeFiles/VarintUtilsTest.dir/VarintUtilsTest.cpp.o -o bin/VarintUtilsTest  -Wl,-rpath,/home/builder/pkg_builds/build-fbthrift-4f82ba17/src/fbthrift-2025.11.17.00/build/lib  /usr/lib/libgtest_main.so.1.17.0  lib/libthriftcpp2.so.2025.11.17.00  /usr/lib/libgtest.so.1.17.0  lib/libthriftfrozen2.so.2025.11.17.00  lib/libthriftmetadata.so.2025.11.17.00  lib/libthriftanyrep.so  lib/libthrifttype.so.2025.11.17.00  lib/libthriftprotocol.so.2025.11.17.00  lib/libasync.so.2025.11.17.00  lib/libruntime.so  lib/libtransport.so.2025.11.17.00  lib/librpcmetadata.so.2025.11.17.00  lib/libconcurrency.so.2025.11.17.00  /lib/libzstd.so  /usr/lib/libwangle.so.2025.11.17.00  /usr/lib/libfizz.so.2025.11.17.00  /usr/lib/libz.so  /usr/lib/libsodium.so  /usr/lib/librt.a  lib/libthrift-core.so.2025.11.17.00  lib/libthrifttyperep.so.2025.11.17.00  lib/libthriftannotation.so.2025.11.17.00  lib/libcommon.so  lib/libserverdbginfo.so.2025.11.17.00  /usr/lib/libfolly.so.2025.11.17.00  /usr/lib/libfmt.so.12.1.0  /usr/lib/libgflags.so.2.2.2  /usr/lib/libboost_context.so.1.89.0  /usr/lib/libboost_filesystem.so.1.89.0  /usr/lib/libboost_program_options.so.1.89.0  /usr/lib/libboost_regex.so.1.89.0  /usr/lib/libboost_thread.so.1.89.0  /usr/lib/libboost_atomic.so.1.89.0  /usr/lib/libboost_chrono.so.1.89.0  /usr/lib/libboost_container.so.1.89.0  /usr/lib/libboost_date_time.so.1.89.0  /usr/lib/libdouble-conversion.so  /usr/lib/libglog.so.0.7.1  /usr/lib/libgflags.so.2.2.2  /usr/lib/libevent.so  /usr/lib/libz.so  /usr/lib/libssl.so  /usr/lib/libcrypto.so  /usr/lib/libbz2.so  /usr/lib/liblzma.so  /usr/lib/liblz4.so  /usr/lib/libzstd.so  /usr/lib/libsnappy.so  /usr/lib/libdwarf.so  /usr/lib/libiberty.a  /usr/lib/libaio.so  /usr/lib/liburing.so  /usr/lib/libsodium.so  -ldl  /usr/lib/libunwind.so  /usr/lib/libxxhash.so && cd /home/builder/pkg_builds/build-fbthrift-4f82ba17/src/fbthrift-2025.11.17.00/build/thrift/lib/cpp/util/test && /usr/bin/cmake -D TEST_TARGET=VarintUtilsTest -D TEST_EXECUTABLE=/home/builder/pkg_builds/build-fbthrift-4f82ba17/src/fbthrift-2025.11.17.00/build/bin/VarintUtilsTest -D TEST_EXECUTOR= -D TEST_WORKING_DIR=/home/builder/pkg_builds/build-fbthrift-4f82ba17/src/fbthrift-2025.11.17.00/build/thrift/lib/cpp/util/test -D TEST_EXTRA_ARGS= -D TEST_PROPERTIES= -D TEST_PREFIX= -D TEST_SUFFIX= -D TEST_FILTER= -D NO_PRETTY_TYPES=FALSE -D NO_PRETTY_VALUES=FALSE -D TEST_LIST=VarintUtilsTest_TESTS -D CTEST_FILE=/home/builder/pkg_builds/build-fbthrift-4f82ba17/src/fbthrift-2025.11.17.00/build/thrift/lib/cpp/util/test/VarintUtilsTest[1]_tests.cmake -D TEST_DISCOVERY_TIMEOUT=5 -D TEST_DISCOVERY_EXTRA_ARGS= -D TEST_XML_OUTPUT_DIR= -P /usr/share/cmake/Modules/GoogleTestAddTests.cmake
/usr/bin/ld: lib/libthriftmetadata.so.2025.11.17.00: undefined reference to `apache::thrift::detail::md::genStructFieldMetadata(apache::thrift::syntax_graph::StructuredNode const&, apache::thrift::metadata::ThriftField&, apache::thrift::detail::md::EncodedThriftField const&, unsigned long)'
/usr/bin/ld: lib/libthrifttype.so.2025.11.17.00: undefined reference to `apache::thrift::type::AnyStruct::AnyStruct()'
/usr/bin/ld: lib/libthrifttype.so.2025.11.17.00: undefined reference to `apache::thrift::type::SemiAnyStruct::~SemiAnyStruct()'
/usr/bin/ld: lib/libthriftmetadata.so.2025.11.17.00: undefined reference to `apache::thrift::detail::md::structuredAnnotationsEquality(std::vector<apache::thrift::metadata::ThriftConstStruct, std::allocator<apache::thrift::metadata::ThriftConstStruct> >, std::vector<apache::thrift::metadata::ThriftConstStruct, std::allocator<apache::thrift::metadata::ThriftConstStruct> >, std::vector<apache::thrift::syntax_graph::TypeRef, std::allocator<apache::thrift::syntax_graph::TypeRef> > const&)'
/usr/bin/ld: lib/libthriftmetadata.so.2025.11.17.00: undefined reference to `apache::thrift::detail::md::cvInteger(long)'
/usr/bin/ld: lib/libthrifttype.so.2025.11.17.00: undefined reference to `apache::thrift::type::SemiAnyStruct::SemiAnyStruct()'
/usr/bin/ld: lib/libthrifttype.so.2025.11.17.00: undefined reference to `apache::thrift::type::SemiAnyStruct::SemiAnyStruct(apache::thrift::type::SemiAnyStruct&&)'
/usr/bin/ld: lib/libthriftmetadata.so.2025.11.17.00: undefined reference to `apache::thrift::detail::md::genStructMetadata(apache::thrift::metadata::ThriftMetadata&, apache::thrift::syntax_graph::StructuredNode const&, apache::thrift::detail::md::Options)'
/usr/bin/ld: lib/libthrifttype.so.2025.11.17.00: undefined reference to `apache::thrift::type::AnyStruct::~AnyStruct()'
/usr/bin/ld: lib/libthriftmetadata.so.2025.11.17.00: undefined reference to `apache::thrift::detail::md::cvString(char const*)'
/usr/bin/ld: lib/libthriftmetadata.so.2025.11.17.00: undefined reference to `apache::thrift::detail::md::genEnumMetadata(apache::thrift::metadata::ThriftMetadata&, apache::thrift::syntax_graph::EnumNode const&, apache::thrift::detail::md::Options)'
/usr/bin/ld: lib/libthriftmetadata.so.2025.11.17.00: undefined reference to `apache::thrift::detail::md::getAnnotationTypes(std::span<apache::thrift::syntax_graph::Annotation const, 18446744073709551615ul>)'
/usr/bin/ld: lib/libthriftmetadata.so.2025.11.17.00: undefined reference to `apache::thrift::detail::md::genServiceMetadata(apache::thrift::syntax_graph::ServiceNode const&, apache::thrift::metadata::ThriftMetadata&, apache::thrift::detail::md::Options)'
/usr/bin/ld: lib/libthriftmetadata.so.2025.11.17.00: undefined reference to `apache::thrift::detail::md::cvStruct(char const*, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, apache::thrift::metadata::ThriftConstValue, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, apache::thrift::metadata::ThriftConstValue> > >&&)'
/usr/bin/ld: lib/libthriftmetadata.so.2025.11.17.00: undefined reference to `apache::thrift::detail::md::schemaRegistryMutex()'
collect2: error: ld returned 1 exit status
[839/857] Building CXX object thrift/lib/cpp2/test/CMakeFiles/ProtocolBench.dir/__/__/__/conformance/if/gen-cpp2/conformance_types_compact.cpp.o
[840/857] Building CXX object thrift/lib/cpp2/test/CMakeFiles/ProtocolBench.dir/__/__/__/conformance/if/gen-cpp2/conformance_types_serialization.cpp.o
[841/857] Building CXX object thrift/lib/cpp2/test/CMakeFiles/ProtocolBench.dir/__/__/__/conformance/if/gen-cpp2/patch_data_metadata.cpp.o
[842/857] Building CXX object thrift/lib/cpp2/test/CMakeFiles/ProtocolBench.dir/__/__/__/conformance/if/gen-cpp2/conformance_metadata.cpp.o
ninja: build stopped: subcommand failed.

built via:

  cmake -S . -B build \
    -G Ninja \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -Wno-dev \
    -Denable_tests=ON \
    -DBUILD_SHARED_LIBS=ON \
    -Dthriftpy3=OFF \
    -Dthriftpy=ON \
    -DCMAKE_CXX_STANDARD=20 \
    -DPACKAGE_VERSION="$pkgver"

  cmake --build build
}

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