etrillaud at gmail.com
Tue May 26 14:56:53 PDT 2009
Le Tue, 26 May 2009 15:45:30 -0500,
Bruce Dubbs <bruce.dubbs at gmail.com> a écrit :
> Emmanuel Trillaud wrote:
> > I am currently translating some hints in french, including the
> > optimization one. I was planning to proposed a patch soon to update
> > the hint and I saw your status report on LFS 6.5.
> >> #2414 Evaluate Optimization hint unassigned
> > here is some things that could be change :
> > * the hint seems to recommand the use of -O3 by default. I read
> > some doc (http://www.gentoo.org/doc/en/gcc-optimization.xml) which
> > recommands to not use -O3 with the 4.x series
> > * the links to the online gcc doc point to the doc of gcc 3.3.1 :
> > this should be update
> > * the external link
> > (http://www.freehackers.org/gentoo/gccflags/flag_gcc3.html) in no
> > longer valid. It could be replace by :
> > http://en.gentoo-wiki.com/wiki/Safe_Cflags
> > * some minor clean up could be done too
> > If you are interrested by my remarks, I can provide a patch.
> Yes, please. Patches are welcome.
> -- Bruce
It seems that the attachement has been remove. So here is the patch.
diff --git a/optimization.txt b/optimization.txt
index 6106399..f3f6a95 100644
@@ -3,7 +3,9 @@ AUTHOR: Jim Gifford <lfs-hints at jg555.com>
Originally by Thomas -Balu-Walter < tw at itreff.de >
Originally by Eric Olinger <eric at supertux.com> optimization2.txt
+CONTRIBUTOR: Emmanuel Trillaud <etrillaud at gmail.com>
LICENSE: GNU Free Documentation License Version 1.2
@@ -40,7 +42,7 @@ convention and those package require manual editing.
To set those variables you can do the following commands in bash (or in your
.bashrc if you want them to be there all the time):
- export CFLAGS="-O3 -march=<architecture>" &&
+ export CFLAGS="-O2 -march=<architecture>" &&
This is a minimal set of optimizations that ensures it works on almost all
@@ -79,27 +81,28 @@ RedHat because RedHat often uses beta software which aren't always very stable.
DEFINITIONS FOR FLAGS:
For more information on compiler optimization flags see the GCC Command
-s page in the Online GCC 3.3.1 docs at:
+s page in the Online GCC 4.4.0 docs at:
A linker option that remove all symbol table and relocation
information from the binary.
This flag sets the optimizing level for the binary.
- 3 Highest level, machine specific code is generated.
- Auto-magically adds the -finline-functions and
- -frename-registers flags.
- 2 Most make files have this set up as Default, performs all
- supported optimizations that do not involve a space-speed
- tradeoff. Adds the -fforce-mem flag auto-magically.
- 1 Minimal optimizations are performed. Default for the compiler,
- if nothing is given.
- 0 Don't optimize.
- s Same as O2 but does additional optimizations for size.
+ -O3 Highest level, machine specific code is generated.
+ Auto-magically adds the -finline-functions and
+ -frename-registers flags.
+ -O2 Most make files have this set up as Default, performs all
+ supported optimizations that do not involve a space-speed
+ tradeoff. Adds the -fforce-mem flag auto-magically.
+ -O1 Minimal optimizations are performed.
+ -0 Performs optimizations that don't take too much time
+ -O0 Reduce compilation time, the default.
+ -Os Same as -O2 but does additional optimizations for size and
+ disable those which increase code size.
Tells the compiler not to keep the frame pointer in
@@ -109,43 +112,41 @@ http://gcc.gnu.org/onlinedocs/gcc-3.3.1/gcc/i386-and-x86-64-Options.html#i386%20
in many functions. It also makes debugging impossible
on some machines.
Defines the instructions set to use when compiling. -mpcu is implied
- be the same as -march when only -march is used.
- i386 Intel 386 Prcoessor
- i486 Intel/AMD 486 Processor
- pentium Intel Pentium Processor
- pentiumpro Intel Pentium Pro Processor
- pentium2 Intel PentiumII/Celeron Processor
- pentium3 Intel PentiumIII/Celeron Processor
- pentium4 Intel Pentium 4/Celeron Processor
- k6 AMD K6 Processor
- k6-2 AMD K6-2 Processor
- K6-3 AMD K6-3 Processor
- athlon AMD Athlon/Duron Processor
- athlon-tbird AMD Athlon Thunderbird Processor
- athlon-4 AMD Athlon Version 4 Processor
- athlon-xp AMD Athlon XP Processor
- athlon-mp AMD Athlon MP Processor
- winchip-c6 Winchip C6 Processor
- winchip2 Winchip 2 Processor
- c3 VIA C3 Cyrix Processor
+ be the same as -march when only -march is used. Here is some possible
+ values for <arch>. A complete list can be found in the man page of gcc
+ i386 Intel 386 Prcoessor
+ i486 Intel/AMD 486 Processor
+ pentium Intel Pentium Processor
+ pentiumpro Intel Pentium Pro Processor
+ pentium2 Intel PentiumII/Celeron Processor
+ pentium3 Intel PentiumIII/Celeron Processor
+ pentium4 Intel Pentium 4/Celeron Processor
+ k6 AMD K6 Processor
+ k6-2 AMD K6-2 Processor
+ K6-3 AMD K6-3 Processor
+ athlon AMD Athlon/Duron Processor
+ athlon-tbird AMD Athlon Thunderbird Processor
+ athlon-4 AMD Athlon Version 4 Processor
+ athlon-xp AMD Athlon XP Processor
+ athlon-mp AMD Athlon MP Processor
+ winchip-c6 Winchip C6 Processor
+ winchip2 Winchip 2 Processor
+ c3 VIA C3 Cyrix Processor
- These switches enable or disable the use of built-in functions
- that allow direct access to the MMX, SSE and 3Dnow extensions
- of the instruction set.
+ These switches enable or disable the use of built-in functions
+ that allow direct access to the MMX, SSE and 3Dnow extensions
+ of the instruction set.
-Safe flags to use for gentoo-1.4
-Securing & Optimizing Linux: The Ultimate Solution v2.0
+Safe flags to use for gentoo
@@ -158,13 +159,11 @@ http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12590
-CHANGELOG: 1.2 Fixed Typos
- 1.1 Fixed Typos and Cut-n-Paste Errors
- 1.0 Adopted by Jim Gifford
- New Version of this document can be viewed from http://cvs.jg555.com/viewcvs.cgi/lfs-hints
+ 1.3 Update to gcc 4.4.0, update links, reformating
+ 1.2 Fixed Typos
+ 1.1 Fixed Typos and Cut-n-Paste Errors
+ 1.0 Adopted by Jim Gifford
More information about the lfs-dev