You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Mladen Turk <mt...@apache.org> on 2006/10/18 12:48:41 UTC

Strange size of produced APR binaries on Solaris

Hi,

Building APR gives a really strange binary sizes on Solaris.

$ gcc --version
gcc (GCC) 3.3.2
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ uname -a
SunOS dev12.qa.atl.jboss.com 5.9 Generic_118558-25 sun4u sparc SUNW,Sun-Fire-V210


The APR is 1.2.7, and a simple
./configure --prefix=/foo/bar
make && make install

produces the libapr-1.so.0.2.7 sized 3094060 bytes.

Now, is that normal?
It is twice the size then any other platform.
For example the libcrypto from OpenSSL is usually double
the size then APR on any platform (even Solaris 10 x86),
but on sparc it's the half the size 1427960 bytes compared
with apr.

Anyone knows what might be the reason, and why the produced
binaries are four times larger then expected?

Regards,
Mladen.

Re: Strange size of produced APR binaries on Solaris

Posted by Tollef Fog Heen <tf...@err.no>.
* Joe Orton 

| > In any case, it should be turned off by default thought.
| 
| Most of the people who care about this are those who are redistributing 
| binaries, which is a tiny minority of all those who build from source.  
| For everyone else, it doesn't really matter, and getting useful 
| backtraces is far better than burning a bit of disk space.

.. and a lot of those distributing binaries are distributing debug
symbols as well, so having the unstripped binaries there is good.

-- 
Tollef Fog Heen                                                        ,''`.
UNIX is user friendly, it's just picky about who its friends are      : :' :
                                                                      `. `' 
                                                                        `-  

Re: Strange size of produced APR binaries on Solaris

Posted by Mladen Turk <mt...@apache.org>.
Justin Erenkrantz wrote:
> 
> +1.  We should stick with debug symbols by default.

So in general this relates to the windows .pdb files
embedded in the binary, correct? If so, then fine.

> Those who are
> doing binary releases can figure out how to run strip themselves...

The problem is that this 'howto' was hard to find, and requires
a manual intervention that could be either explained or defined.

I'll try adding a line inside README.dev about that.

Regards,
Mladen.


Re: Strange size of produced APR binaries on Solaris

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On 10/18/06, Joe Orton <jo...@redhat.com> wrote:
> > In any case, it should be turned off by default thought.
>
> Most of the people who care about this are those who are redistributing
> binaries, which is a tiny minority of all those who build from source.
> For everyone else, it doesn't really matter, and getting useful
> backtraces is far better than burning a bit of disk space.

+1.  We should stick with debug symbols by default.  Those who are
doing binary releases can figure out how to run strip themselves...
-- justin

Re: Strange size of produced APR binaries on Solaris

Posted by Joe Orton <jo...@redhat.com>.
On Wed, Oct 18, 2006 at 01:19:42PM +0200, Mladen Turk wrote:
> Joe Orton wrote:
> >On Wed, Oct 18, 2006 at 12:48:41PM +0200, Mladen Turk wrote:
> >>Building APR gives a really strange binary sizes on Solaris.
> >...
> >>produces the libapr-1.so.0.2.7 sized 3094060 bytes.
> >
> >Debugging info, needs stripping (strip -x on Solaris IIRC).
> 
> Can this be done within the APR build itself, unless something
> like --enable-maintainer-mode is defined, that IMHO should
> have debugging turned on? Or is this genuine Solaris?

Making --disable-debug strip -g from CFLAGS would not be unreasonable, I 
suppose.

> In any case, it should be turned off by default thought.

Most of the people who care about this are those who are redistributing 
binaries, which is a tiny minority of all those who build from source.  
For everyone else, it doesn't really matter, and getting useful 
backtraces is far better than burning a bit of disk space.

Regards,

joe

Re: Strange size of produced APR binaries on Solaris

Posted by Mladen Turk <mt...@apache.org>.
Joe Orton wrote:
> On Wed, Oct 18, 2006 at 12:48:41PM +0200, Mladen Turk wrote:
>> Building APR gives a really strange binary sizes on Solaris.
> ...
>> produces the libapr-1.so.0.2.7 sized 3094060 bytes.
> 
> Debugging info, needs stripping (strip -x on Solaris IIRC).
>

Can this be done within the APR build itself, unless something
like --enable-maintainer-mode is defined, that IMHO should
have debugging turned on? Or is this genuine Solaris?

In any case, it should be turned off by default thought.

Regards,
Mladen.





Re: Strange size of produced APR binaries on Solaris

Posted by Joe Orton <jo...@redhat.com>.
On Wed, Oct 18, 2006 at 12:48:41PM +0200, Mladen Turk wrote:
> Building APR gives a really strange binary sizes on Solaris.
...
> produces the libapr-1.so.0.2.7 sized 3094060 bytes.

Debugging info, needs stripping (strip -x on Solaris IIRC).

joe

Re: Strange size of produced APR binaries on Solaris

Posted by Mladen Turk <mt...@apache.org>.
Davi Arnaut wrote:
> 
> Could you please strip it and see what happens ? It won't hurt.
> 

I don't have a strip on the box.
Where can I find that? Is that something custom, or it comes
in by default?

Regards,
Mladen.


Re: Strange size of produced APR binaries on Solaris

Posted by Justin Erenkrantz <ju...@erenkrantz.com>.
On 10/18/06, Mladen Turk <mt...@apache.org> wrote:
> Can the reason for that be a -g compile switch?
> If so, do you have any idea how to suppress it during
> the build ?

CFLAGS="-O2" ./configure ...

If you don't specify any CFLAGS, autoconf defaults to "-g -O2".  -- justin

Re: Strange size of produced APR binaries on Solaris

Posted by Davi Arnaut <da...@haxent.com.br>.
Mladen Turk wrote:
> Davi Arnaut wrote:
>  >
>  > Could you please strip it and see what happens ? It won't hurt.
>  >
> 
> OK.
> /usr/ccs/bin/strip -x libapr-1.so.0.2.7 resizes the .so
> to the much 'normal' size of 170616 bytes from default 3M.

Nice.

> Can the reason for that be a -g compile switch?
> If so, do you have any idea how to suppress it during
> the build ?

Hack configure.in to remove the flag for your platform or use your own
CFLAGS.

--
Davi Arnaut


Re: Strange size of produced APR binaries on Solaris

Posted by Mladen Turk <mt...@apache.org>.
Davi Arnaut wrote:
 >
 > Could you please strip it and see what happens ? It won't hurt.
 >

OK.
/usr/ccs/bin/strip -x libapr-1.so.0.2.7 resizes the .so
to the much 'normal' size of 170616 bytes from default 3M.

Can the reason for that be a -g compile switch?
If so, do you have any idea how to suppress it during
the build ?

Regards,
Mladen.


Re: Strange size of produced APR binaries on Solaris

Posted by Davi Arnaut <da...@haxent.com.br>.
Mladen Turk wrote:
> Davi Arnaut wrote:
>> Debugging symbols ? other library linked statically (expat ?) ?
> 
> It's APR ./configure && make && make install

This might add a -g to the flags.

>> Have you tried to strip ?
> 
> No. Like said it's default build for APR.
> If the strip is needed (what ever that might be,
> so please share some light) then it should be the
> part of the make thought.

Could you please strip it and see what happens ? It won't hurt.

>> Also you can objdump -h and diff it's output to compare the size of each
>> section with a older "normal" .so.
>>
> 
> Don't get it. What is 'older "normal" .so'
> I'm trying to build the APR from the sources.

An older apr shared object whose size you considered "normal".

--
Davi Arnaut

Re: Strange size of produced APR binaries on Solaris

Posted by Mladen Turk <mt...@apache.org>.
Davi Arnaut wrote:
> 
> Debugging symbols ? other library linked statically (expat ?) ?

It's APR ./configure && make && make install

> Have you tried to strip ?

No. Like said it's default build for APR.
If the strip is needed (what ever that might be,
so please share some light) then it should be the
part of the make thought.

> 
> Also you can objdump -h and diff it's output to compare the size of each
> section with a older "normal" .so.
>

Don't get it. What is 'older "normal" .so'
I'm trying to build the APR from the sources.

Regards,
Mladen.

Re: Strange size of produced APR binaries on Solaris

Posted by Davi Arnaut <da...@haxent.com.br>.
Mladen Turk wrote:
> Hi,
> 
> Building APR gives a really strange binary sizes on Solaris.
> 
> $ gcc --version
> gcc (GCC) 3.3.2
> Copyright (C) 2003 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> $ uname -a
> SunOS dev12.qa.atl.jboss.com 5.9 Generic_118558-25 sun4u sparc SUNW,Sun-Fire-V210
> 
> 
> The APR is 1.2.7, and a simple
> ./configure --prefix=/foo/bar
> make && make install
> 
> produces the libapr-1.so.0.2.7 sized 3094060 bytes.
> 
> Now, is that normal?
> It is twice the size then any other platform.
> For example the libcrypto from OpenSSL is usually double
> the size then APR on any platform (even Solaris 10 x86),
> but on sparc it's the half the size 1427960 bytes compared
> with apr.
> 
> Anyone knows what might be the reason, and why the produced
> binaries are four times larger then expected?

Debugging symbols ? other library linked statically (expat ?) ? Have you
tried to strip ?

Also you can objdump -h and diff it's output to compare the size of each
section with a older "normal" .so.

--
Davi Arnaut