Ticket #2414: optimization.patch
File optimization.patch, 6.8 KB (added by , 16 years ago) |
---|
-
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> 3 3 Originally by Thomas -Balu-Walter < tw at itreff.de > 4 4 Originally by Eric Olinger <eric at supertux.com> optimization2.txt 5 5 6 DATE: 2003-10-30 6 CONTRIBUTOR: Emmanuel Trillaud <etrillaud@gmail.com> 7 8 DATE: 2009-05-26 7 9 8 10 LICENSE: GNU Free Documentation License Version 1.2 9 11 … … convention and those package require manual editing. 40 42 To set those variables you can do the following commands in bash (or in your 41 43 .bashrc if you want them to be there all the time): 42 44 43 export CFLAGS="-O 3-march=<architecture>" &&45 export CFLAGS="-O2 -march=<architecture>" && 44 46 CXXFLAGS=$CFLAGS 45 47 46 48 This 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. 79 81 DEFINITIONS FOR FLAGS: 80 82 81 83 For more information on compiler optimization flags see the GCC Command 82 s page in the Online GCC 3.3.1docs at:84 s page in the Online GCC 4.4.0 docs at: 83 85 84 http://gcc.gnu.org/onlinedocs/gcc- 3.3.1/gcc/Optimize-Options.html#Optimize%20Options85 http://gcc.gnu.org/onlinedocs/gcc- 3.3.1/gcc/i386-and-x86-64-Options.html#i386%20and%20x86-64%20Options86 http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/Optimize-Options.html#Optimize-Options 87 http://gcc.gnu.org/onlinedocs/gcc-4.4.0/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options 86 88 87 89 -s 88 90 A linker option that remove all symbol table and relocation 89 91 information from the binary. 90 92 91 -O 393 -O<x> 92 94 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. 103 106 104 107 -fomit-frame-pointer 105 108 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 109 112 in many functions. It also makes debugging impossible 110 113 on some machines. 111 114 112 -march= pentium3115 -march=<arch> 113 116 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 133 137 134 138 -mmmx 135 139 -msse 136 140 -msse2 137 141 -m3dnow 138 139 140 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. 141 145 142 OPTIMIZATION LINK S:146 OPTIMIZATION LINK: 143 147 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 148 Safe flags to use for gentoo 149 http://en.gentoo-wiki.com/wiki/Safe_Cflags 149 150 150 151 PERSON EXPERIENCE: 151 152 … … http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12590 158 159 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10655 159 160 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8440 160 161 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 162 VERSION: 1.3 169 163 164 CHANGELOG: 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 170 169