Gentoo Archives: gentoo-user

From: "Stefan G. Weichinger" <lists@×××××.at>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] How to properly change CFLAGS ?
Date: Wed, 23 Aug 2006 19:52:02
Message-Id: 44ECB05F.30200@xunil.at
In Reply to: Re: [gentoo-user] How to properly change CFLAGS ? by Richard Fish
1 Richard Fish wrote:
2
3 > Gcc is (almost) always built with -O2 on Gentoo, but it does not
4 > matter anyway. The CFLAGS that gcc is built with does not effect the
5 > binaries it generates...only the code and the flags passed to gcc
6 > during the compilation effect this. If your model were correct, you
7 > would need a gcc built with -Os for using -Os, a gcc built with "-Os
8 > -fweb" for building with "-Os -fweb", "-O3" for building with -O3,
9 > "-O3 -mmx" for ... and so on.
10 >
11 > Think about this for a second. What you are claiming here is that the
12 > output of this bash script can depend upon what CFLAGS bash was built
13 > with:
14 >
15 > #!/bin/bash
16 > echo -e "\x48\x65\x6c\x6c\x6f\x20\x57\x6f\x72\x6c\x64\x21"
17 >
18 > Admittedly a compiler is many orders of magnitude more complex than
19 > this, but functionally the same. Only the code and the options passed
20 > to the compiler can effect its output. Or to put another way, one
21 > could write a C compiler in java, C#, python, or even shell script
22 > that would support the exact same flags as gcc and generate the exact
23 > same code. They would almost certainly be much, much slower, but the
24 > output would be the same. It is identical in concept to changing the
25 > flags that _gcc_ is built with...the gcc program itself changes
26 > (hopefully gets faster), but the output remains the same.
27
28 I might be a newbie in terms of this list, but this is completely clear
29 to *me*.
30
31 Thanks anyway,
32 maybe this helps in getting this to the Howtos, the Wiki, etc.
33
34 Stefan
35 --
36 gentoo-user@g.o mailing list