numam-dpdk/doc/guides/prog_guide/lto.rst
Stephen Hemminger e24b8ad46b doc: avoid meson deprecation in setup
The command "meson build" causes a deprecation warning with meson 0.64.0.

WARNING: Running the setup command as `meson [options]` instead of
    `meson setup [options]` is ambiguous and deprecated.

Therefore fix the examples in the documentation.

Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Stanislaw Kardach <kda@semihalf.com>
2022-11-22 16:16:27 +01:00

34 lines
1.3 KiB
ReStructuredText

.. SPDX-License-Identifier: BSD-3-Clause
Copyright(c) 2019 Marvell International Ltd.
Link Time Optimization
======================
The DPDK supports compilation with link time optimization turned on.
This depends obviously on the ability of the compiler to do "whole
program" optimization at link time and is available only for compilers
that support that feature.
To be more specific, compiler (in addition to performing LTO) have to
support creation of ELF objects containing both normal code and internal
representation (called fat-lto-objects in gcc and icc).
This is required since during build some code is generated by parsing
produced ELF objects (pmdinfogen).
The amount of performance gain that one can get from LTO depends on the
compiler and the code that is being compiled.
However LTO is also useful for additional code analysis done by the
compiler.
In particular due to interprocedural analysis compiler can produce
additional warnings about variables that might be used uninitialized.
Some of these warnings might be "false positives" though and you might
need to explicitly initialize variable in order to silence the compiler.
Please note that turning LTO on causes considerable extension of
build time.
Link time optimization can be enabled by setting meson built-in 'b_lto' option:
.. code-block:: console
meson setup build -Db_lto=true