uriparser / uriparser

:hocho: Strictly RFC 3986 compliant URI parsing and handling library written in C89; moved from SourceForge to GitHub

Home Page:https://uriparser.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compilation with (default) -DURIPARSER_BUILD_TESTS=ON fails on Debian sid with error: undefined reference to `pthread_getspecific'

hartwork opened this issue · comments

(Byproduct of research for #98 (comment))

Error part of the build log:

[100%] Linking CXX executable testrunner
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgtest.a(gtest-all.cc.o): in function `testing::internal::UnitTestImpl::~UnitTestImpl()':
(.text+0xac09): undefined reference to `pthread_getspecific'
/usr/bin/ld: (.text+0xac22): undefined reference to `pthread_key_delete'
/usr/bin/ld: (.text+0xad5d): undefined reference to `pthread_getspecific'
/usr/bin/ld: (.text+0xad76): undefined reference to `pthread_key_delete'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgtest.a(gtest-all.cc.o): in function `testing::internal::UnitTestImpl::UnitTestImpl(testing::UnitTest*)':
(.text+0x173c6): undefined reference to `pthread_key_create'
/usr/bin/ld: (.text+0x1759d): undefined reference to `pthread_key_create'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgtest.a(gtest-all.cc.o): in function `testing::internal::UnitTestImpl::GetTestPartResultReporterForCurrentThread()':
(.text+0x1f144): undefined reference to `pthread_getspecific'
/usr/bin/ld: (.text+0x1f1ca): undefined reference to `pthread_setspecific'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgtest.a(gtest-all.cc.o): in function `testing::UnitTest::AddTestPartResult(testing::TestPartResult::Type, char const*, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)':
(.text+0x1f451): undefined reference to `pthread_getspecific'
/usr/bin/ld: (.text+0x1f4ba): undefined reference to `pthread_setspecific'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgtest.a(gtest-all.cc.o): in function `testing::internal::UnitTestImpl::SetTestPartResultReporterForCurrentThread(testing::TestPartResultReporterInterface*)':
(.text+0x22309): undefined reference to `pthread_getspecific'
/usr/bin/ld: (.text+0x22391): undefined reference to `pthread_setspecific'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgtest.a(gtest-all.cc.o): in function `testing::internal::ThreadLocal<testing::TestPartResultReporterInterface*>::~ThreadLocal()':
(.text._ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED2Ev[_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED5Ev]+0x20): undefined reference to `pthread_getspecific'
/usr/bin/ld: (.text._ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED2Ev[_ZN7testing8internal11ThreadLocalIPNS_31TestPartResultReporterInterfaceEED5Ev]+0x35): undefined reference to `pthread_key_delete'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgtest.a(gtest-all.cc.o): in function `testing::internal::ThreadLocal<std::vector<testing::internal::TraceInfo, std::allocator<testing::internal::TraceInfo> > >::~ThreadLocal()':
(.text._ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEED2Ev[_ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEED5Ev]+0x20): undefined reference to `pthread_getspecific'
/usr/bin/ld: (.text._ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEED2Ev[_ZN7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEED5Ev]+0x35): undefined reference to `pthread_key_delete'
/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgtest.a(gtest-all.cc.o): in function `testing::internal::ThreadLocal<std::vector<testing::internal::TraceInfo, std::allocator<testing::internal::TraceInfo> > >::GetOrCreateValue() const':
(.text._ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE16GetOrCreateValueEv]+0x20): undefined reference to `pthread_getspecific'
/usr/bin/ld: (.text._ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE16GetOrCreateValueEv[_ZNK7testing8internal11ThreadLocalISt6vectorINS0_9TraceInfoESaIS3_EEE16GetOrCreateValueEv]+0xaa): undefined reference to `pthread_setspecific'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/testrunner.dir/build.make:375: testrunner] Error 1
make[1]: *** [CMakeFiles/Makefile2:129: CMakeFiles/testrunner.dir/all] Error 2
make: *** [Makefile:160: all] Error 2

Dockerfile to reproduce:

# Copyright (C) 2021 Sebastian Pipping <sebastian@pipping.org>
# Licensed under Creative Commons CC0 1.0 Universal

FROM debian:sid

RUN apt-get update && apt-get install --yes --no-install-recommends -V \
        build-essential \
        ca-certificates \
        cmake \
        doxygen \
        git \
        graphviz \
        libgtest-dev

SHELL ["bash", "-c"]

RUN git clone --depth 1 https://github.com/uriparser/uriparser uriparser \
        && \
    mkdir uriparser/build \
        && \
    cd uriparser/build \
        && \
    cmake .. \
        && \
    make -j2 \
        && \
    make -j2 check \
        && \
    make install DESTDIR="${PWD}"/root VERBOSE=1 \
        && \
    cd root/ \
        && \
    find | sort