public inbox for gsl-discuss@sourceware.org
 help / color / mirror / Atom feed
* static size
@ 2000-06-23 15:09 Diego Saravia
  2000-06-26 13:39 ` Brian Gough
  0 siblings, 1 reply; 4+ messages in thread
From: Diego Saravia @ 2000-06-23 15:09 UTC (permalink / raw)
  To: gsl-discuss

      I finally be able to do static using autoconf and automake 
     Thanks to all people that help me.

      I like to compile static because you do not have to distribute or
compile
      libraries in other machines

      When I use static in 0.6 the executable is huge,
      in 0.5 it was smaller
      When gcc links a library, puts all the library code in the executable?
      Is there a way to change that, no using dinamic, so gcc puts only the
code
      that is used?

      Is really easy to work with only one gsl library file, but ...

      I have little experience with gcc, sorry if I am doing some silly
error.
--
Diego Saravia
dsa@unsa.edu.ar

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: static size
  2000-06-23 15:09 static size Diego Saravia
@ 2000-06-26 13:39 ` Brian Gough
  2000-06-26 13:41   ` Brian Gough
  2000-06-26 15:56   ` Evgeny Stambulchik
  0 siblings, 2 replies; 4+ messages in thread
From: Brian Gough @ 2000-06-26 13:39 UTC (permalink / raw)
  To: Diego Saravia; +Cc: gsl-discuss

The final size of executable files should be about the same, since the
linker should only include the .o files that are used by the program.

You can use 'nm' on the executable to see what symbols are being
included.  If the whole library is included then that would indicate a
problem that would be worth knowing about.

Diego Saravia writes:
 > 
 > 
 >       I finally be able to do static using autoconf and automake 
 >      Thanks to all people that help me.
 > 
 >       I like to compile static because you do not have to distribute or
 > compile
 >       libraries in other machines
 > 
 >       When I use static in 0.6 the executable is huge,
 >       in 0.5 it was smaller
 >       When gcc links a library, puts all the library code in the executable?
 >       Is there a way to change that, no using dinamic, so gcc puts only the
 > code
 >       that is used?
 > 
 >       Is really easy to work with only one gsl library file, but ...
 > 
 >       I have little experience with gcc, sorry if I am doing some silly
 > error.
 > --
 > Diego Saravia
 > dsa@unsa.edu.ar
 > 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: static size
  2000-06-26 13:39 ` Brian Gough
@ 2000-06-26 13:41   ` Brian Gough
  2000-06-26 15:56   ` Evgeny Stambulchik
  1 sibling, 0 replies; 4+ messages in thread
From: Brian Gough @ 2000-06-26 13:41 UTC (permalink / raw)
  To: gsl-discuss; +Cc: Diego Saravia

Brian Gough writes:
 > The final size of executable files should be about the same, since the
 > linker should only include the .o files that are used by the program.

This is how it works on my system, anyway.

bjg|debian> ld --version
GNU ld 2.9.1

Typical example,

bjg|debian> cd histogram
bjg|debian> gcc -static -I .. gsl-histogram.c -lgsl -lm
bjg|debian> ls -l a.out
-rwxrwxr-x   1 bjg      bjg        269691 Jun 26 21:40 a.out*
bjg|debian> strip a.out
bjg|debian> ls -l a.out
-rwxrwxr-x   1 bjg      bjg        170384 Jun 26 21:40 a.out*

regards
Brian


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: static size
  2000-06-26 13:39 ` Brian Gough
  2000-06-26 13:41   ` Brian Gough
@ 2000-06-26 15:56   ` Evgeny Stambulchik
  1 sibling, 0 replies; 4+ messages in thread
From: Evgeny Stambulchik @ 2000-06-26 15:56 UTC (permalink / raw)
  To: gsl-discuss; +Cc: Diego Saravia

On 26-Jun-00 Brian Gough wrote:

>  The final size of executable files should be about the same, since the
>  linker should only include the .o files that are used by the program.

Plus the object files the functions in those .o files depend upon etc - while
linking against a dynamic library would add only a negligible amount to the
total size (pointers to the function table).

Regards,

Evgeny

PS. And doing `strip <executable>' would make the code much smaller in size ;-).

   ____________________________________________________________
  / Evgeny Stambulchik  <fnevgeny@plasma-gate.weizmann.ac.il>  \
 /  Plasma Laboratory, Weizmann Institute of Science, Israel \  \
 |  Phone : (972)8-934-3610  == | == FAX   : (972)8-934-3491 |  |
 |  URL   :    http://plasma-gate.weizmann.ac.il/~fnevgeny/  |  |
 |  Finger for PGP key >=====================================+  |
 |______________________________________________________________|

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2000-06-26 15:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-23 15:09 static size Diego Saravia
2000-06-26 13:39 ` Brian Gough
2000-06-26 13:41   ` Brian Gough
2000-06-26 15:56   ` Evgeny Stambulchik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).