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

"./configure --enable-threaded-resolver --disable-rt" doesn't work #3294

Closed
claudiusaiz opened this issue Nov 21, 2018 · 6 comments
Closed
Labels

Comments

@claudiusaiz
Copy link

claudiusaiz commented Nov 21, 2018

I did this

Trying to configure the library in the following way doesn't work:

./configure --enable-threaded-resolver --disable-rt
...
checking whether to enable the threaded resolver... yes
checking whether to use POSIX threads for threaded resolver... auto
configure: error: Threaded resolver enabled but no thread library found

I expected the following

Without the --disable-rt flag, the configure works:
./configure --enable-threaded-resolver

I don't see why the threaded resolver should care about librt, so I guess it should work.

curl/libcurl version

libcurl version: 7.62.0

operating system

$ cat /etc/issue 
Arch Linux \r (\l)
$ uname -srm
Linux 4.18.16-arch1-1-ARCH x86_64
@bagder
Copy link
Member

bagder commented Nov 21, 2018

I can reproduce this as well but I don't consider it very important. Why do you want to degrade the internal time-keeping? (Basically looking for an argument to not remove --disable-rt ...)

@claudiusaiz
Copy link
Author

In my case, I am linking curl into another library which previously did not depend on librt, so I'm trying to prevent breaking backward compatibility by introducing new dependencies.

@bagder
Copy link
Member

bagder commented Nov 21, 2018

I believe curl's configure script has detected and used -lrt by default since ed80eb5. Done more than 10 years ago. --disable-rt was introduced in cee21eb, July 2015.

I can't recall why it doesn't allow the combination pthreads and no librt. I presume removing that check and testing would be a good first step!

@danielgustafsson
Copy link
Member

danielgustafsson commented Nov 21, 2018

ISTR librt being linked with libpthreads.so at some systems in the past, but I don't have a system in front of me to test on.

update: on Debian 9 librt is linked with linux-vdso.so. libpthread.so.0 libc.so.6 /lib64/ld-linux-x86-64.so.2

@bagder
Copy link
Member

bagder commented Nov 21, 2018

So by using pthreads (ie the threaded resolver on a non-windows box) you will get the rt lib in the package as well no matter what you tell curl's configure script.

@claudiusaiz, that means if you really insist on building without using -lrt, you're probably more or less forced to also disable the threaded resolver. If you're trying to keep the exact behavior of an old build, that probably makes sense too since curl used to build with the sync resolver by default up until d86e918 (August 2017).

@claudiusaiz
Copy link
Author

Thanks, but since I want to maintain backward compatibility and still have the performance advantages of --enable-thread-resolver (as I did in my previously used version), I will try to disable the check in the configure file to see how it goes. So far it went ok with a basic test (uploading a file to an https server).

@lock lock bot locked as resolved and limited conversation to collaborators Feb 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

3 participants