cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: reducing the libcurl footprint

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Tue, 25 Sep 2007 15:56:22 -0700

On Tue, Sep 25, 2007 at 02:30:32PM -0700, Ganesh Ragavan wrote:
> Thanks for the replies. Following is configuration I am using:
>
> Platform: PowerPC 405
> gcc version: 3.3.1
> libcurl version: 7.16.4
>
> I included the options that you mentioned in the configure line and used -R
> option to remove the .comment section. The size I could get was 146KB after
> stripping, though I didn't remove anything from the code. Also I haven't tried
> the static linking option yet.
>
> Could you please let me know the architecture that you used for getting the 98
> KiB size that you mentioned?

i386. I just checked into CVS a couple of minor changes that reduce that
figure to 97 KiB, BTW :^)

> Also could you let me know the other sections like .comment that I could
> remove?

That depends on your toolchain; I can't say if there's anything else that
yours generates that's superfluous. My old gcc 2.95.3 PPC toolchain doesn't
leave me any obvious candidates. I should note that it's also generating
code that's 36% larger than for x86.

The debugging sections should already be removed with one of the strip
options mentioned there. You might be able to remove the .gnu.version*
sections if you fiddle with some other fields, but there's probably not
much else.

This patch will save another few KB:

--- sendf.h 27 Mar 2007 04:17:26 -0000 1.40
+++ sendf.h 25 Sep 2007 21:59:19 -0000
@@ -46,7 +46,8 @@

 #endif /* CURL_DISABLE_VERBOSE_STRINGS */

-#define failf Curl_failf
+/*#define failf Curl_failf*/
+#define failf(x...) do { } while (0)

 #define CLIENTWRITE_BODY 1
 #define CLIENTWRITE_HEADER 2

If you're this concerned about size, you may want want to investigate if
you can use CodePack compression or some other kind of run-time code
decompressor.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2007-09-26