diff options
author | Xi Ruoyao <xry111@xry111.site> | 2022-11-18 13:57:47 +0800 |
---|---|---|
committer | Xi Ruoyao <xry111@xry111.site> | 2022-11-18 13:57:47 +0800 |
commit | b1c8283fe71b3fe2d4419c3e74012e4b23052700 (patch) | |
tree | f1ac6a8553b30f3a58ed00be3b8d19913668da34 /chapter08/introduction.xml | |
parent | 1cc301fbb3db368fe1bad436a1a662c303fcc29b (diff) |
chapter08: reword description of compiler optimizations
We don't recommend customizing optimizations, but we use optimizations
provided by package default or release build mode.
Reword the paragraph so the people won't be puzzled once they see
"--enable-optimizations" in Python, or "--buildtype=release" (to prevent
unoptimized build) in BLFS meson commands.
Diffstat (limited to 'chapter08/introduction.xml')
-rw-r--r-- | chapter08/introduction.xml | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/chapter08/introduction.xml b/chapter08/introduction.xml index b05a9761a..2be7fe053 100644 --- a/chapter08/introduction.xml +++ b/chapter08/introduction.xml @@ -20,20 +20,28 @@ work is to know what each package is used for and why you (or the system) may need it.</para> - <para>We do not recommend using optimizations. They can make + <para>We do not recommend using customized optimizations. They can make a program run slightly faster, but they may also cause compilation difficulties, and problems when running the program. If a package refuses to - compile when using optimization, try to compile it without optimization and - see if that fixes the problem. Even if the package does compile when using + compile with a customized optimization, try to compile it without + optimization and see if that fixes the problem. Even if the package does compile when using a customized optimization, there is the risk it may have been compiled incorrectly because of the complex interactions between the code and the build tools. Also note that the <option>-march</option> and <option>-mtune</option> options using values not specified in the book have not been tested. This may cause problems with the toolchain packages (Binutils, GCC and Glibc). The small potential gains - achieved by using compiler optimizations are often outweighed by the risks. + achieved by customizing compiler optimizations are often outweighed by the risks. First-time builders of LFS are encouraged to build without custom - optimizations. The resulting system will still run very fast, and be stable - at the same time.</para> + optimizations.</para> + + <para>On the other hand, we keeps the optimizations enabled by the default + configuration of packages. In addition, we sometimes explicitly enable an + optimized configuration provided by the package but not enabled by + default. The package maintainers have already tested these configurations + and consider them safe, so it's not likely they would break the build. + Generally the default configuration already enables <option>-O2</option> + or <option>-O3</option>, so the resulting system will still run very fast + without any customized optimization, and be stable at the same time.</para> <para>Before the installation instructions, each installation page provides information about the package, including a concise description of what it |