cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Disable clock_gettime checking

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Mon, 7 Nov 2011 11:31:34 -0800

On Mon, Nov 07, 2011 at 10:29:29AM -0800, Gopakumar Pillai wrote:
> Sorry, I can't do static linking, since I am trying to reduce size of
> binaries here, other binaries may be using the same lib too.

I don't understand--I compiled a clock_gettime() "hello world" program
on x86 and it was 7179 bytes when statically linked with librt. When
dynamically linked, it was 7146 bytes, but librt.so was another 30684
bytes for a total of 37830 bytes. So, statically linking saves 30651
bytes of disk space for me (since I wouldn't need librt.so).

> Editing curl_config.h - exactly what I didn't want to do, since things
> may change in it in future versions of libcurl.

True, but a lot more than just curl_config variables can change in future
versions of libcurl, such as utilizing more exports from librt than just
clock_gettime.

> Did see a lot of issues around librt and clock_gettime, thought someone
> would have thought of disabling it in a proper way. Looks like not! Let
> this be a request for such a change - say --without-librt

It's not necessarily that simple. configure tries to find libraries that
export symbols, and it just happens that clock_gettime is exported by
librt on some systems. But, librt is a system library that also exports
plenty of other symbols, and configure could pull it in for those. I don't
think any are used by libcurl directly right now under Linux, but they
could be in the future, or they could be on other platforms, or they could
be by other libraries on which libcurl is dependent. So, --without-librt
would be much trickier to implement as, for example,
--disable-clock-gettime would be.

The question becomes whether it's worthwhile implementing it, as well as
testing and maintaining it indefinitely into the future, given that it
seems like a very specialized use case and given that there are already
other ways to accomplish it.

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-11-07