vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi , Yesterday i tried to emerge some kde apps , so i saw it writes strange things on my screen g++ [...] -O2 -Os -march=athlon-tbird [...] Which of this optimizations compilator realy use ? I was observing other compilations and see that sometimes portage change my flags from make.conf ( x.org AFAIR) , to its own . But i`ve never before seen such a situation , and i worry it uses kde`s default O2 , while other as O3 and Os are very usable . -- Marcin |
| |||
| On Thu, 02 Sep 2004 01:19:05 +0200, sfu scribbled on a wall: > Hi , > > Yesterday i tried to emerge some kde apps , so i saw it writes strange > things on my screen > -O2 -Os -march=athlon-tbird [...] Which of this optimizations compilator > realy use ? [...] Is this what you are asking about? - from the Handbook (that is an O, not zero)- Code Listing 16: The GCC O setting -O2 Other popular optimization flags are -pipe (use pipes rather than temporary files for communication between the various stages of compilation) and -fomit-frame-pointer (which doesn't keep the frame pointer in a register for functions that don't need one). When you define the CFLAGS and CXXFLAGS, you should combine several optimization flags, like in the following example: Code Listing 17: Defining the CFLAGS and CXXFLAGS variable CFLAGS="-march=athlon-xp -pipe -O2" # AMD64 users should not use athlon-xp CXXFLAGS="${CFLAGS}" # Use the same settings for both variables -- oNb Another happy Linux user - # 276084. Reject religion ! Embrace Jesus Christ. Linux help source | www.linuxquestions.or |
| |||
| On Wed, 01 Sep 2004 19:43:37 -0600, oldNbald wrote: > On Thu, 02 Sep 2004 01:19:05 +0200, sfu scribbled on a wall: > >> Hi , >> >> Yesterday i tried to emerge some kde apps , so i saw it writes strange >> things on my screen >> -O2 -Os -march=athlon-tbird [...] Which of this optimizations compilator >> realy use ? [...] > > Is this what you are asking about? > well my english isn`t very good but i checked this with a liitle program writing a file to disk , with -Os i is 4 kb and with O2 5kb. When i write in makefile : CFLAGS = -s -Os -O2 -march=athlon-tbird it uses O2 and binary is 5 kb when i write CFLAGS = -s -O2 -Os -march=athlon-tbird it uses Os and binary is 4 kb -- Marcin |
| |||
| -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 sfu wrote: | [snip] | well my english isn`t very good | but i checked this with a liitle program writing a file to disk , | with -Os i is 4 kb and with O2 5kb. | When i write in makefile : | CFLAGS = -s -Os -O2 -march=athlon-tbird | it uses O2 and binary is 5 kb | when i write | CFLAGS = -s -O2 -Os -march=athlon-tbird | it uses Os and binary is 4 kb | According to the gcc-manual (http://gcc.gnu.org/onlinedocs/) it's always the last parameter of a certain type, that becomes valid. In the first case (5kb binary output) -O2 is last and -Os is omitted, while it is vice versa in the second case. So you don't need to specify both, just use the one that's suiting your needs best. Greetings, Felix -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFBNuVmDH+mFzdSOa0RAgIMAKCJQzUudfpyp4RDUywr/gr1u18zIgCfa2GM 4ZYombiaMAvdEUTHnkr8Au4= =dDw9 -----END PGP SIGNATURE----- |
| |||
| On Thu, 02 Sep 2004 11:18:30 +0200, Felix Tiede wrote: > > According to the gcc-manual (http://gcc.gnu.org/onlinedocs/) it's always the > last parameter of a certain type, that becomes valid. In the first case (5kb > binary output) -O2 is last and -Os is omitted, while it is vice versa in the > second case. > > So you don't need to specify both, just use the one that's suiting your > needs best. > > Greetings, > Felix I know i don`t need , but sometimes portage sets both flags , and the question was : which one does it use ? Now i know that portage uses the last one , and that is good because it`s flag from my make.conf . -- Marcin |
| ||||
| sfu wrote: >> According to the gcc-manual (http://gcc.gnu.org/onlinedocs/) it's always >> the last parameter of a certain type, that becomes valid. In the first >> case (5kb binary output) -O2 is last and -Os is omitted, while it is vice >> versa in the second case. >> >> So you don't need to specify both, just use the one that's suiting your >> needs best. >> > I know i don`t need , but sometimes portage sets both flags , and the > question was : which one does it use ? Now i know that portage uses the > last one , and that is good because it`s flag from my make.conf . I don't think that the first flag was set by portage, but rather by the package itself. So you have a default flag in case the user did not include anythink similar in his make.conf. But if you have something in make.conf, it will be appended to the line and so that entry will be used. Ciao, Philipp |