Mail Archives: djgpp/1999/07/28/09:33:12
Okay, I was an idiot when I asked this question and it's gotten out of
hand. I did know what -s and -S are I just read in a another message
someone talking about and compression I then asked the question without
thinking. So i'm sorry for the confusion and making people answer it, but I
did read the replies.=).
Here is what they really do. The below message had them right but switch to
two s's.
-s translated your c code to assembly (I don't know how to so this with
optimization?? could someon tell me?)
-S envokes the preprocessor to work on your file before it envokes gcc.
Nifty for assembly because you can add #defined macros and stuff. It's
what Allegro does to create such well structured assembly routines.
Thanks from Dan Gold..
On the topic, which compiles to better assembly a while() {} loop or a
for(;;) {} loop. I've heard while is the best or better used for continuous
loops. Don't answer if you consider this to far Off the topic...
----------
> From: matthew DOT krause AT juno DOT com
> To: djgpp AT delorie DOT com
> Subject: Re: Does -s have affect performance?
> Date: Tuesday, July 27, 1999 8:44 PM
>
> >Do you mean "gcc -s"? That switch is used to generate the assembler code
> so
> >that -- provided you can understand assembler -- you can have a look at
> exactly
> >what is happening in your program.
>
> Actually, gcc -s strips debug information from your program while gcc -S
> aborts the compilation process after the assembler code has been made...
>
> #`-S'
> # Stop after the stage of compilation proper; do not assemble. The
> # output is in the form of an assembler code file for each
> # non-assembler input file specified.
> # By default, the assembler file name for a source file is made by
> # replacing the suffix `.c', `.i', etc., with `.s'.
> # Input files that don't require compilation are ignored.
>
> as opposed to
>
> #`-s'
> # Remove all symbol table and relocation information from the
> # executable.
>
> </gcc.info>
>
> The key difference being that -s is passed to the linker, while -S is
> passed to the compiler...
> -s will reduce the size of the your program. A similar effect can be had
> by passing -s to the linker can be had running strip.exe on your program.
>
>
> The allegro demo game(renamed test) compiled out to 937 748 bytes(command
> line=D:\gcc -o test.exe test.c -lalleg), and was reduced to 557 568 bytes
> with strip.exe. The size of the program was further reduced to 555 520
> bytes by passing -s the the linker (command line= D:\gcc -o test.exe
> test.c -lalleg -s) and not running strip.exe
>
> Running upx.exe --best on the stock executable (no -s nor strip.exe
> cmdline=D:\gcc -o test.exe test.c -lalleg) reduced the size of the exe to
> 219 980 (23.46% of its former size). Running strip on that _increased_
> the size of the executable to 222 540 bytes... Moral of the story: Don't
> be greedy (and it specifically says not to do that in the docs, anyway)
>
> And now, a question, (OT, of course): Anyone willing to help me set up
> mingw32? Specifically, how do you pass long commandlines to non-DJGPP
> programs (both the V and Allegro makefiles are having trouble with too
> long arguments being passed to ar, and where can I get a win32 version
> of gnumake?
>
> Matthew Krause of Orange, CT USA
> ICQ UIN : 21302667
> AIM: RedBaronMK
>
>
>
>
>
>
>
> ___________________________________________________________________
> Get the Internet just the way you want it.
> Free software, free e-mail, and free Internet access for a month!
> Try Juno Web: http://dl.www.juno.com/dynoget/tagj.
- Raw text -