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.
This commit is contained in:
Xi Ruoyao 2022-11-18 13:57:47 +08:00
parent 1cc301fbb3
commit b1c8283fe7
No known key found for this signature in database
GPG Key ID: ACAAD20E19E710E3

View File

@ -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