Closed mosullivan93 closed 1 year ago
@LebedevRI @dmah42 I'm happy to close this PR. I've learned that if using pkg-config
on its own you need to include the --static
flag to resolve the correct linker arguments. That fixes my original problem: broken in glibc 2.31, working in glibc 2.35.
I get the feeling it's best to keep things as they are (where you've had no complaints for quite some time) rather than change these flags in order to allow it to accidentally work correctly across both libc environments.
@LebedevRI @dmah42 I'm happy to close this PR. I've learned that if using
pkg-config
on its own you need to include the--static
flag to resolve the correct linker arguments. That fixes my original problem: broken in glibc 2.31, working in glibc 2.35.
Nice!
I get the feeling it's best to keep things as they are (where you've had no complaints for quite some time) rather than change these flags in order to allow it to accidentally work correctly across both libc environments.
Yeah, i think the LHS of the diff isn't incorrect.
When glibc < 2.34,
-lpthread
or-pthread
needs to be present in order for this project to be linked successfully. CMake provides the@CMAKE_THREAD_LIBS_INIT@
variable that will expand to the necessary flag. This will typically expand to-lpthreads
, but users can override this behaviour if they wish by setting theTHREADS_PREFER_PTHREAD_FLAG
variable to TRUE/ON/etc.This patch ensures the thread library is always present in the linker options and restores the default behaviour.