Ticket #2414: optimization.patch

File optimization.patch, 6.8 KB (added by gerard@…, 16 years ago)

Candicate patch to the hint itself to update a couple of things.

  • optimization-vo.txt

    diff --git a/optimization-vo.txt b/optimization-vo.txt
    index 6106399..f3f6a95 100644
    a b AUTHOR: Jim Gifford <lfs-hints at jg555.com>  
    33                Originally by Thomas -Balu-Walter < tw at itreff.de >
    44                Originally by Eric Olinger <eric at supertux.com> optimization2.txt
    55
    6 DATE:           2003-10-30
     6CONTRIBUTOR: Emmanuel Trillaud <etrillaud@gmail.com>
     7
     8DATE:           2009-05-26
    79
    810LICENSE:        GNU Free Documentation License Version 1.2
    911
    convention and those package require manual editing.  
    4042To set those variables you can do the following commands in bash (or in your
    4143.bashrc if you want them to be there all the time):
    4244
    43     export CFLAGS="-O3 -march=<architecture>" &&
     45    export CFLAGS="-O2 -march=<architecture>" &&
    4446    CXXFLAGS=$CFLAGS
    4547
    4648This is a minimal set of optimizations that ensures it works on almost all
    RedHat because RedHat often uses beta software which aren't always very stable.  
    7981DEFINITIONS FOR FLAGS:
    8082
    8183For more information on compiler optimization flags see the GCC Command
    82 s page in the Online GCC 3.3.1 docs at:
     84s page in the Online GCC 4.4.0 docs at:
    8385
    84 http://gcc.gnu.org/onlinedocs/gcc-3.3.1/gcc/Optimize-Options.html#Optimize%20Options
    85 http://gcc.gnu.org/onlinedocs/gcc-3.3.1/gcc/i386-and-x86-64-Options.html#i386%20and%20x86-64%20Options
     86http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Optimize-Options.html#Optimize-Options
     87http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options
    8688
    8789-s
    8890        A linker option that remove all symbol table and relocation
    8991        information from the binary.
    9092
    91 -O3
     93-O<x>
    9294        This flag sets the optimizing level for the binary.
    93                 3       Highest level, machine specific code is generated.
    94                         Auto-magically adds the -finline-functions and
    95                         -frename-registers flags.
    96                 2       Most make files have this set up as Default, performs all 
    97                         supported optimizations that do not involve a space-speed
    98                         tradeoff. Adds the -fforce-mem flag auto-magically.
    99                 1       Minimal optimizations are performed. Default for the compiler,
    100                         if nothing is given.
    101                 0       Don't optimize.
    102                 s       Same as O2 but does additional optimizations for size.
     95            -O3     Highest level, machine specific code is generated.
     96                    Auto-magically adds the -finline-functions and
     97                    -frename-registers flags.
     98            -O2     Most make files have this set up as Default, performs all 
     99                    supported optimizations that do not involve a space-speed
     100                    tradeoff. Adds the -fforce-mem flag auto-magically.
     101            -O1     Minimal optimizations are performed.
     102            -0      Performs optimizations that don't take too much time
     103            -O0     Reduce compilation time, the default.
     104            -Os     Same as -O2 but does additional optimizations for size and
     105                    disable those which increase code size.
    103106
    104107-fomit-frame-pointer
    105108        Tells the compiler not to keep the frame pointer in
    http://gcc.gnu.org/onlinedocs/gcc-3.3.1/gcc/i386-and-x86-64-Options.html#i386%20  
    109112        in many functions. It also makes debugging impossible
    110113        on some machines.
    111114
    112 -march=pentium3
     115-march=<arch>
    113116        Defines the instructions set to use when compiling. -mpcu is implied
    114         be the same as -march when only -march is used.
    115                 i386                    Intel 386 Prcoessor
    116                 i486                    Intel/AMD 486 Processor
    117                 pentium                 Intel Pentium Processor
    118                 pentiumpro              Intel Pentium Pro Processor
    119                 pentium2                Intel PentiumII/Celeron Processor
    120                 pentium3                Intel PentiumIII/Celeron Processor
    121                 pentium4                Intel Pentium 4/Celeron Processor
    122                 k6                      AMD K6 Processor
    123                 k6-2                    AMD K6-2 Processor
    124                 K6-3                    AMD K6-3 Processor
    125                 athlon                  AMD Athlon/Duron Processor
    126                 athlon-tbird            AMD Athlon Thunderbird Processor
    127                 athlon-4                AMD Athlon Version 4 Processor
    128                 athlon-xp               AMD Athlon XP Processor
    129                 athlon-mp               AMD Athlon MP Processor
    130                 winchip-c6              Winchip C6 Processor
    131                 winchip2                Winchip 2 Processor
    132                 c3                      VIA C3 Cyrix Processor
     117        be the same as -march when only -march is used. Here is some possible
     118        values for <arch>. A complete list can be found in the man page of gcc
     119            i386            Intel 386 Prcoessor
     120            i486            Intel/AMD 486 Processor
     121            pentium         Intel Pentium Processor
     122            pentiumpro      Intel Pentium Pro Processor
     123            pentium2        Intel PentiumII/Celeron Processor
     124            pentium3        Intel PentiumIII/Celeron Processor
     125            pentium4        Intel Pentium 4/Celeron Processor
     126            k6              AMD K6 Processor
     127            k6-2            AMD K6-2 Processor
     128            K6-3            AMD K6-3 Processor
     129            athlon          AMD Athlon/Duron Processor
     130            athlon-tbird    AMD Athlon Thunderbird Processor
     131            athlon-4        AMD Athlon Version 4 Processor
     132            athlon-xp       AMD Athlon XP Processor
     133            athlon-mp       AMD Athlon MP Processor
     134            winchip-c6      Winchip C6 Processor
     135            winchip2        Winchip 2 Processor
     136            c3              VIA C3 Cyrix Processor
    133137
    134138-mmmx
    135139-msse
    136140-msse2
    137141-m3dnow
    138         These switches enable or disable the use of built-in functions
    139         that allow direct access to the MMX, SSE and 3Dnow extensions
    140         of the instruction set.
     142        These switches enable or disable the use of built-in functions
     143        that allow direct access to the MMX, SSE and 3Dnow extensions
     144        of the instruction set.
    141145       
    142 OPTIMIZATION LINKS:
     146OPTIMIZATION LINK:
    143147 
    144 Safe flags to use for gentoo-1.4 
    145 http://www.freehackers.org/gentoo/gccflags/flag_gcc3.html
    146 
    147 Securing & Optimizing Linux: The Ultimate Solution v2.0
    148 http://www.openna.com/products/books/sol/solus.php
     148Safe flags to use for gentoo
     149http://en.gentoo-wiki.com/wiki/Safe_Cflags
    149150
    150151PERSON EXPERIENCE:
    151152
    http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12590  
    158159http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10655
    159160http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8440
    160161
    161 VERSION:        1.2
    162 
    163 CHANGELOG:      1.2 Fixed Typos
    164                 1.1 Fixed Typos and Cut-n-Paste Errors
    165                 1.0 Adopted by Jim Gifford
    166 
    167  New Version of this document can be viewed from http://cvs.jg555.com/viewcvs.cgi/lfs-hints
    168 
     162VERSION:    1.3
    169163
     164CHANGELOG:
     165        1.3 Update to gcc 4.4.0, update links, reformating
     166        1.2 Fixed Typos
     167        1.1 Fixed Typos and Cut-n-Paste Errors
     168        1.0 Adopted by Jim Gifford
    170169