public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: gcc and small command line tasks
@ 2005-08-11 15:11 patriciak784-gccmainling
  0 siblings, 0 replies; 7+ messages in thread
From: patriciak784-gccmainling @ 2005-08-11 15:11 UTC (permalink / raw)
  To: jaynicks; +Cc: gcc-help

jaynicks@earthlink.net wrote:
> Hullo,
> 
> I cannot find the switch(es)/params to make a small
taks, e.g.  
hello.c
> results in 471,836 byte task which seems a little
large.
> 
> Been through mans and googles and have missed the
information so far.

I think you are looking for optimizing flags.
A whole list of flags is availible at
http://gcc.gnu.org/onlinedocs/!last release of gcc
series (for example
gcc-3.4.4)!/gcc/index.html#toc_Invoking-GCC
I use "-fpeel-loops -O3 -fforce-addr -ftracer -s -g0"
but all symbols for debugging are removed because of
-g0 and -s.




	

	
		
___________________________________________________________ 
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de

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

* RE: gcc and small command line tasks
@ 2005-08-12 20:45 Meissner, Michael
  0 siblings, 0 replies; 7+ messages in thread
From: Meissner, Michael @ 2005-08-12 20:45 UTC (permalink / raw)
  To: James Nickson, Nelson H. F. Beebe, gcc-help; +Cc: beebe

On some of the embedded systems I worked on in the past, if you included
printf, it could easily take 1/2 or more of the available memory (32K or
so), since in these systems you usually don't have floating point
instructions, and printf drags in the whole floating point and long long
support functions to support %f and %Ld (newlib for instance has iprintf
that is integer only).

-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of James Nickson
Sent: Friday, August 12, 2005 12:09 PM
To: Nelson H. F. Beebe; gcc-help@gcc.gnu.org
Cc: beebe@math.utah.edu
Subject: Re: gcc and small command line tasks

Thank you Dr. Beebe, got it in one.

I did not think so much  as 400K would be needed for a printf (laughing
at
myself again).

Thanks all,

Jay

At 06:45 AM 8/12/05 -0600, Nelson H. F. Beebe wrote:
>James Nickson <jaynicks@earthlink.net> asks why a hello-world test
>produced a 471K executable program.
>
>I suspect that what Jack was seeing in the simple hello.c test is the
>difference between static and dynamic linking.  
>
>For example, on Sun Solaris 8:
>
>	% gcc -o hello hello.c
>	% ls -l hello
>	-rwxrwxr-x  1 beebe staff 6196 Aug 12 06:38 hello
>
>	% gcc -static -o hello hello.c
>	% ls -l hello
>	-rwxrwxr-x  1 beebe staff 363296 Aug 12 06:39 hello
>
>While dynamic linking is the default on all modern operating systems,
>there are cases (e.g., CD-ROM distribution of software and standalone
>boot and rescue disks) where static linking is required to avoid
>dependencies on shared libraries that might be in different locations
>on some remote system than on the system where the executable was
>built, or might be corrupted (consider what happens to your Unix
>system if /lib/libc.so.1 develops a bad disk block: virtually nothing
>can run).
>
>
>-----------------------------------------------------------------------
----
----
>- Nelson H. F. Beebe                    Tel: +1 801 581 5254
   -
>- University of Utah                    FAX: +1 801 581 4148
   -
>- Department of Mathematics, 110 LCB    Internet e-mail:
beebe@math.utah.edu  -
>- 155 S 1400 E RM 233                       beebe@acm.org
beebe@computer.org -
>- Salt Lake City, UT 84112-0090, USA    URL:
http://www.math.utah.edu/~beebe  -
>-----------------------------------------------------------------------
----
----
>
=============================================
James Nickson                                  jaynicks@lccdigital.com
19 O.Cheq.Nk.Rd., Wellfleet, MA                      508.349.2422


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

* Re: gcc and small command line tasks
  2005-08-12 12:45 Nelson H. F. Beebe
@ 2005-08-12 16:07 ` James Nickson
  0 siblings, 0 replies; 7+ messages in thread
From: James Nickson @ 2005-08-12 16:07 UTC (permalink / raw)
  To: Nelson H. F. Beebe, gcc-help; +Cc: beebe

Thank you Dr. Beebe, got it in one.

I did not think so much  as 400K would be needed for a printf (laughing at
myself again).

Thanks all,

Jay

At 06:45 AM 8/12/05 -0600, Nelson H. F. Beebe wrote:
>James Nickson <jaynicks@earthlink.net> asks why a hello-world test
>produced a 471K executable program.
>
>I suspect that what Jack was seeing in the simple hello.c test is the
>difference between static and dynamic linking.  
>
>For example, on Sun Solaris 8:
>
>	% gcc -o hello hello.c
>	% ls -l hello
>	-rwxrwxr-x  1 beebe staff 6196 Aug 12 06:38 hello
>
>	% gcc -static -o hello hello.c
>	% ls -l hello
>	-rwxrwxr-x  1 beebe staff 363296 Aug 12 06:39 hello
>
>While dynamic linking is the default on all modern operating systems,
>there are cases (e.g., CD-ROM distribution of software and standalone
>boot and rescue disks) where static linking is required to avoid
>dependencies on shared libraries that might be in different locations
>on some remote system than on the system where the executable was
>built, or might be corrupted (consider what happens to your Unix
>system if /lib/libc.so.1 develops a bad disk block: virtually nothing
>can run).
>
>
>---------------------------------------------------------------------------
----
>- Nelson H. F. Beebe                    Tel: +1 801 581 5254
   -
>- University of Utah                    FAX: +1 801 581 4148
   -
>- Department of Mathematics, 110 LCB    Internet e-mail:
beebe@math.utah.edu  -
>- 155 S 1400 E RM 233                       beebe@acm.org
beebe@computer.org -
>- Salt Lake City, UT 84112-0090, USA    URL:
http://www.math.utah.edu/~beebe  -
>---------------------------------------------------------------------------
----
>
=============================================
James Nickson                                  jaynicks@lccdigital.com
19 O.Cheq.Nk.Rd., Wellfleet, MA                      508.349.2422

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

* Re: gcc and small command line tasks
@ 2005-08-12 12:45 Nelson H. F. Beebe
  2005-08-12 16:07 ` James Nickson
  0 siblings, 1 reply; 7+ messages in thread
From: Nelson H. F. Beebe @ 2005-08-12 12:45 UTC (permalink / raw)
  To: James Nickson, gcc-help; +Cc: beebe

James Nickson <jaynicks@earthlink.net> asks why a hello-world test
produced a 471K executable program.

I suspect that what Jack was seeing in the simple hello.c test is the
difference between static and dynamic linking.  

For example, on Sun Solaris 8:

	% gcc -o hello hello.c
	% ls -l hello
	-rwxrwxr-x  1 beebe staff 6196 Aug 12 06:38 hello

	% gcc -static -o hello hello.c
	% ls -l hello
	-rwxrwxr-x  1 beebe staff 363296 Aug 12 06:39 hello

While dynamic linking is the default on all modern operating systems,
there are cases (e.g., CD-ROM distribution of software and standalone
boot and rescue disks) where static linking is required to avoid
dependencies on shared libraries that might be in different locations
on some remote system than on the system where the executable was
built, or might be corrupted (consider what happens to your Unix
system if /lib/libc.so.1 develops a bad disk block: virtually nothing
can run).


-------------------------------------------------------------------------------
- Nelson H. F. Beebe                    Tel: +1 801 581 5254                  -
- University of Utah                    FAX: +1 801 581 4148                  -
- Department of Mathematics, 110 LCB    Internet e-mail: beebe@math.utah.edu  -
- 155 S 1400 E RM 233                       beebe@acm.org  beebe@computer.org -
- Salt Lake City, UT 84112-0090, USA    URL: http://www.math.utah.edu/~beebe  -
-------------------------------------------------------------------------------

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

* gcc and small command line tasks
@ 2005-08-12 12:32 James Nickson
  0 siblings, 0 replies; 7+ messages in thread
From: James Nickson @ 2005-08-12 12:32 UTC (permalink / raw)
  To: gcc-help

On the printf("hello\n\n") programs that were winding up a 471K executable
modules--  it is a distribution problem (or my installations although no
errors were indicated).

I Live-CD'd another distro and the programs are 11K so I'll take it up with
the distro folks 

Sorry for the inconvenience.

Jay Nickson
=============================================
James Nickson                                  jaynicks@lccdigital.com
19 O.Cheq.Nk.Rd., Wellfleet, MA                      508.349.2422

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

* Re: gcc and small command line tasks
  2005-08-11 13:31 James Nickson
@ 2005-08-11 13:51 ` Arturas Moskvinas
  0 siblings, 0 replies; 7+ messages in thread
From: Arturas Moskvinas @ 2005-08-11 13:51 UTC (permalink / raw)
  To: James Nickson; +Cc: gcc-help

> Hullo,
> 
> I cannot find the switch(es)/params to make a small taks, e.g.  hello.c
> results in 471,836 byte task which seems a little large.
> 
> Been through mans and googles and have missed the information so far.

What do you mean by that task??? Memory consumption?

Arturas Moskvinas

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

* gcc and small command line tasks
@ 2005-08-11 13:31 James Nickson
  2005-08-11 13:51 ` Arturas Moskvinas
  0 siblings, 1 reply; 7+ messages in thread
From: James Nickson @ 2005-08-11 13:31 UTC (permalink / raw)
  To: gcc-help

Hullo,

I cannot find the switch(es)/params to make a small taks, e.g.  hello.c
results in 471,836 byte task which seems a little large.

Been through mans and googles and have missed the information so far.

Thanks in advance,

Jay Nickson
=============================================
James Nickson                                  jaynicks@lccdigital.com
19 O.Cheq.Nk.Rd., Wellfleet, MA                      508.349.2422

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

end of thread, other threads:[~2005-08-12 20:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-11 15:11 gcc and small command line tasks patriciak784-gccmainling
  -- strict thread matches above, loose matches on Subject: below --
2005-08-12 20:45 Meissner, Michael
2005-08-12 12:45 Nelson H. F. Beebe
2005-08-12 16:07 ` James Nickson
2005-08-12 12:32 James Nickson
2005-08-11 13:31 James Nickson
2005-08-11 13:51 ` Arturas Moskvinas

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).