Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gtest build fails with pthread errors #241

Closed
goatshriek opened this issue Sep 21, 2022 · 1 comment
Closed

gtest build fails with pthread errors #241

goatshriek opened this issue Sep 21, 2022 · 1 comment
Assignees
Labels
bug something is broken or missing build pertains to the configuration and build stages stale inactive issue or pull request

Comments

@goatshriek
Copy link
Owner

goatshriek commented Sep 21, 2022

As described in #239, the invocation of make check fails with the following errors:

/usr/bin/ld: /usr/lib/x86_64-linux-gnu/libgtest.a(gtest-all.cc.o): undefined reference to symbol  pthread_getspecific@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line

This appears to be an issue with the pthread flags not being passed in to the linking stage of the build of google test. The issue was observed on a debian system using GCC. If possible, please provide the following information to help with reproduction:

  • version of debian (e.g. /etc/debian_version)
  • versions of cmake and gcc

A few first ideas:

It looks like include(FindThreads) was inadvertently removed from the cmake build at some point, which later variables including CMAKE_THREAD_LIBS_INIT depend on. Please add this to the top of tools/cmake/google_libs.cmake and see if the issue is resolved in a fresh configure/build.

If that doesn't work, please try updating the google_libs_cxx_flags variable in tools/cmake/google_libs.cmake to include -pthread at the end:

if(CYGWIN)
  set(google_libs_cxx_flags "-std=gnu++11 -pthread")
else()
  set(google_libs_cxx_flags "-std=c++11 -pthread")
endif()
@goatshriek goatshriek changed the title make check fails with pthread errors gtest build fails with pthread errors Sep 21, 2022
@goatshriek goatshriek self-assigned this Sep 21, 2022
@goatshriek goatshriek added bug something is broken or missing build pertains to the configuration and build stages labels Sep 21, 2022
@goatshriek goatshriek added the stale inactive issue or pull request label Aug 24, 2023
@goatshriek
Copy link
Owner Author

This will be closed in a month if no further context is provided for the issue, under the assumption that the proposed fixes resolved the problem.

@goatshriek goatshriek closed this as not planned Won't fix, can't repro, duplicate, stale May 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something is broken or missing build pertains to the configuration and build stages stale inactive issue or pull request
Projects
None yet
Development

No branches or pull requests

1 participant