On Thu, May 12, 2011 at 07:58:14AM -0700, John Reiser wrote:
> > Hi, in the packaging readme[0] for valgrind it's stated that it's a bad
> > idea to strip what's in /usr/lib/valgrind/ ...
> 
> > FWIW this is a matter of 227Mb large /usr/lib/valgrind versus 71Mb without
> > debug.
> 
> Which machine architecture and compiler?

amd64 gcc, but indeed with -g, because it's how binaries are supposed to
be built in Debian.

> There's a difference between stripped (applying /usr/bin/strip, 
> /usr/bin/objcopy,
> flags such as -s -S to /usr/bin/ld, etc.) and non-debug (no -g in CFLAGS).
> Only developers of valgrind need debug symbols (-g) inside valgrind itself.

I know about the difference, but stupidly thought that valgrind needed
the latter (debug symbols).

By default, after build, debian strip:

  - libraries with:
    strip --remove-section=.comment --remove-section=.note --strip-unnedded
  - exectutables with:
    strip --remove-section=.comment --remove-section=.note

Would this be okay to do that? (I think so since my earlier test proves
it works).

> After installing a recent Fedora 15 .rpm for valgrind-3.6.1:
> -----
> $ ls -l /usr/bin/valgrind /usr/lib64/valgrind/memcheck-amd64-linux
> -rwxr-xr-x. 1 root root    43260 May  3 02:49 /usr/bin/valgrind
> -rwxr-xr-x. 1 root root 13742515 May  3 02:49 
> /usr/lib64/valgrind/memcheck-amd64-linux

I'm in the same numbers, which means that fedora does the same as Debian
(and distros usually do that btw), and build in -g and do not strip.
total 232036
    drwxr-xr-x   2 root root     4096 12 mai   13:49 .
    drwxr-xr-x 231 root root    90112 10 mai   23:02 ..
    -rwxr-xr-x   1 root root 11694337 12 mai   13:37 cachegrind-amd64-linux
    -rwxr-xr-x   1 root root  6349469 12 mai   13:37 cachegrind-x86-linux
    -rwxr-xr-x   1 root root 12049332 12 mai   13:37 callgrind-amd64-linux
    -rwxr-xr-x   1 root root  6660945 12 mai   13:37 callgrind-x86-linux
    -rwxr-xr-x   1 root root 12104936 12 mai   13:37 drd-amd64-linux
    -rwxr-xr-x   1 root root  6662606 12 mai   13:37 drd-x86-linux
    -rwxr-xr-x   1 root root 11532388 12 mai   13:37 exp-bbv-amd64-linux
    -rwxr-xr-x   1 root root  6231331 12 mai   13:37 exp-bbv-x86-linux
    -rwxr-xr-x   1 root root 11563895 12 mai   13:37 exp-dhat-amd64-linux
    -rwxr-xr-x   1 root root  6255989 12 mai   13:37 exp-dhat-x86-linux
    -rwxr-xr-x   1 root root 11844280 12 mai   13:37 exp-ptrcheck-amd64-linux
    -rwxr-xr-x   1 root root  6469495 12 mai   13:37 exp-ptrcheck-x86-linux
    -rwxr-xr-x   1 root root 12001111 12 mai   13:37 helgrind-amd64-linux
    -rwxr-xr-x   1 root root  6603351 12 mai   13:37 helgrind-x86-linux
    -rwxr-xr-x   1 root root 11542032 12 mai   13:37 lackey-amd64-linux
    -rwxr-xr-x   1 root root  6243031 12 mai   13:37 lackey-x86-linux
    -rwxr-xr-x   1 root root 11616620 12 mai   13:37 massif-amd64-linux
    -rwxr-xr-x   1 root root  6296640 12 mai   13:37 massif-x86-linux
    -rwxr-xr-x   1 root root 12585174 12 mai   13:37 memcheck-amd64-linux
    -rwxr-xr-x   1 root root  6911323 12 mai   13:37 memcheck-x86-linux
    -rwxr-xr-x   1 root root 11517333 12 mai   13:37 none-amd64-linux
    -rwxr-xr-x   1 root root  6218296 12 mai   13:37 none-x86-linux
    -rw-r--r--   1 root root     8736 12 mai   13:37 
vgpreload_core-amd64-linux.so
    -rw-r--r--   1 root root     6611 12 mai   13:37 vgpreload_core-x86-linux.so
    -rw-r--r--   1 root root   246346 12 mai   13:37 
vgpreload_drd-amd64-linux.so
    -rw-r--r--   1 root root   171160 12 mai   13:37 vgpreload_drd-x86-linux.so
    -rw-r--r--   1 root root    53878 12 mai   13:37 
vgpreload_exp-dhat-amd64-linux.so
    -rw-r--r--   1 root root    41312 12 mai   13:37 
vgpreload_exp-dhat-x86-linux.so
    -rw-r--r--   1 root root    81584 12 mai   13:37 
vgpreload_exp-ptrcheck-amd64-linux.so
    -rw-r--r--   1 root root    62454 12 mai   13:37 
vgpreload_exp-ptrcheck-x86-linux.so
    -rw-r--r--   1 root root   157372 12 mai   13:37 
vgpreload_helgrind-amd64-linux.so
    -rw-r--r--   1 root root   119497 12 mai   13:37 
vgpreload_helgrind-x86-linux.so
    -rw-r--r--   1 root root    53878 12 mai   13:37 
vgpreload_massif-amd64-linux.so
    -rw-r--r--   1 root root    41312 12 mai   13:37 
vgpreload_massif-x86-linux.so
    -rw-r--r--   1 root root   141577 12 mai   13:37 
vgpreload_memcheck-amd64-linux.so
    -rw-r--r--   1 root root   105811 12 mai   13:37 
vgpreload_memcheck-x86-linux.so

If you strip --strip-debug (which basically should be the same as not
building with -g if I'm correct) then memcheck-amd64-linux here is:

    -rwxr-xr-x 1 madcoder madcoder 4751991 12 mai   17:06 
/home/madcoder/memcheck-amd64-linux

which is basically 4M instead of 11.5… du your /usr/lib/valgrind you'll see 
it's huge!

> > Secondly, valgrinds installs a few archives namely:
> >     /usr/lib/valgrind/libcoregrind-amd64-linux.a
> >     /usr/lib/valgrind/libcoregrind-x86-linux.a
> >     /usr/lib/valgrind/libreplacemalloc_toolpreload-amd64-linux.a
> >     /usr/lib/valgrind/libreplacemalloc_toolpreload-x86-linux.a
> >     /usr/lib/valgrind/libvex-amd64-linux.a
> >     /usr/lib/valgrind/libvex-x86-linux.a
> 
> These are needed only for development of valgrind tools.  They are
> not needed for ordinary invocation of valgrind tools.

I assumed so, thanks.
-- 
·O·  Pierre Habouzit
··O                                                [email protected]
OOO                                                http://www.madism.org

------------------------------------------------------------------------------
Achieve unprecedented app performance and reliability
What every C/C++ and Fortran developer should know.
Learn how Intel has extended the reach of its next-generation tools
to help boost performance applications - inlcuding clusters.
http://p.sf.net/sfu/intel-dev2devmay
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to